Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ public boolean isFile() {
return isFile;
}

public boolean isHsync() {
return metadata.containsKey(OzoneConsts.HSYNC_CLIENT_ID);
}

/**
* updates the length of the each block in the list given.
* This will be called when the key is being committed to OzoneManager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.hadoop.hdds.scm.pipeline.PipelineID;
import org.apache.hadoop.ozone.ClientVersion;
import org.apache.hadoop.ozone.OzoneAcl;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.om.helpers.OmKeyInfo.Builder;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
import org.apache.hadoop.ozone.security.acl.IAccessAuthorizer;
Expand Down Expand Up @@ -59,6 +60,10 @@ public void protobufConversion() throws IOException {
key.getProtobuf(ClientVersion.CURRENT_VERSION));

Assert.assertEquals(key, keyAfterSerialization);

Assert.assertFalse(key.isHsync());
key.getMetadata().put(OzoneConsts.HSYNC_CLIENT_ID, "clientid");
Assert.assertTrue(key.isHsync());
}

@Test
Expand All @@ -82,6 +87,7 @@ public void getProtobufMessageEC() throws IOException {

// EC Config
key = createOmKeyInfo(new ECReplicationConfig(3, 2));
Assert.assertFalse(key.isHsync());
omKeyProto = key.getProtobuf(ClientVersion.CURRENT_VERSION);

Assert.assertEquals(3, omKeyProto.getEcReplicationConfig().getData());
Expand Down