HDDS-1291. Set OmKeyArgs#refreshPipeline flag properly to avoid reading from stale pipeline. Contributed by Xiaoyu Yao. (#639)
This commit is contained in:
parent
f854a89190
commit
dea6f2a065
@ -664,6 +664,7 @@ public OzoneInputStream getKey(
|
|||||||
.setVolumeName(volumeName)
|
.setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
OmKeyInfo keyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
||||||
LengthInputStream lengthInputStream =
|
LengthInputStream lengthInputStream =
|
||||||
@ -739,6 +740,7 @@ public OzoneKeyDetails getKeyDetails(
|
|||||||
.setVolumeName(volumeName)
|
.setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
OmKeyInfo keyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
||||||
|
|
||||||
|
@ -107,6 +107,7 @@ public Map<String, OmKeyInfo> createKeys(int numOfKeys, int keySize)
|
|||||||
.setVolumeName(volume)
|
.setVolumeName(volume)
|
||||||
.setBucketName(bucket)
|
.setBucketName(bucket)
|
||||||
.setKeyName(key)
|
.setKeyName(key)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo location = cluster.getOzoneManager()
|
OmKeyInfo location = cluster.getOzoneManager()
|
||||||
.lookupKey(arg);
|
.lookupKey(arg);
|
||||||
|
@ -117,6 +117,7 @@ public void testBCSID() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName).
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName).
|
||||||
setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName("ratis")
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName("ratis")
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
List<OmKeyLocationInfo> keyLocationInfos =
|
List<OmKeyLocationInfo> keyLocationInfos =
|
||||||
|
@ -132,6 +132,7 @@ public void testBlockWritesWithFlushAndClose() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
waitForContainerClose(key);
|
waitForContainerClose(key);
|
||||||
@ -165,6 +166,7 @@ public void testBlockWritesCloseConsistency() throws Exception {
|
|||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setType(HddsProtos.ReplicationType.RATIS)
|
.setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
waitForContainerClose(key);
|
waitForContainerClose(key);
|
||||||
@ -198,6 +200,7 @@ public void testMultiBlockWrites() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
waitForContainerClose(key);
|
waitForContainerClose(key);
|
||||||
@ -257,6 +260,7 @@ public void testMultiBlockWrites2() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
waitForContainerClose(key);
|
waitForContainerClose(key);
|
||||||
@ -300,6 +304,7 @@ public void testMultiBlockWrites3() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
waitForContainerClose(key);
|
waitForContainerClose(key);
|
||||||
@ -418,6 +423,7 @@ public void testBlockWriteViaRatis() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName).
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName).
|
||||||
setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
||||||
@ -451,6 +457,7 @@ public void testBlockWrites() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
waitForContainerClose(key);
|
waitForContainerClose(key);
|
||||||
|
@ -150,6 +150,7 @@ public void testBlockWritesWithDnFailures() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
Assert.assertEquals(data.length, keyInfo.getDataSize());
|
Assert.assertEquals(data.length, keyInfo.getDataSize());
|
||||||
@ -192,6 +193,7 @@ public void testMultiBlockWritesWithDnFailures() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
Assert.assertEquals(2 * data.getBytes().length, keyInfo.getDataSize());
|
Assert.assertEquals(2 * data.getBytes().length, keyInfo.getDataSize());
|
||||||
@ -238,6 +240,7 @@ public void testMultiBlockWritesWithIntermittentDnFailures()
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
Assert.assertEquals(3 * data.getBytes().length, keyInfo.getDataSize());
|
Assert.assertEquals(3 * data.getBytes().length, keyInfo.getDataSize());
|
||||||
@ -278,6 +281,7 @@ public void testWriteSmallFile() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
|
|
||||||
@ -338,6 +342,7 @@ public void testContainerExclusionWithClosedContainerException()
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
|
|
||||||
@ -398,6 +403,7 @@ public void testDatanodeExclusionWithMajorityCommit() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
|
|
||||||
@ -460,6 +466,7 @@ public void testPipelineExclusionWithPipelineFailure() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
.setBucketName(bucketName).setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
OmKeyInfo keyInfo = cluster.getOzoneManager().lookupKey(keyArgs);
|
||||||
|
|
||||||
|
@ -203,6 +203,7 @@ private boolean verifyRatisReplication(String volumeName, String bucketName,
|
|||||||
.setVolumeName(volumeName)
|
.setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
HddsProtos.ReplicationType replicationType =
|
HddsProtos.ReplicationType replicationType =
|
||||||
HddsProtos.ReplicationType.valueOf(type.toString());
|
HddsProtos.ReplicationType.valueOf(type.toString());
|
||||||
|
@ -547,6 +547,7 @@ private boolean verifyRatisReplication(String volumeName, String bucketName,
|
|||||||
.setVolumeName(volumeName)
|
.setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
HddsProtos.ReplicationType replicationType =
|
HddsProtos.ReplicationType replicationType =
|
||||||
HddsProtos.ReplicationType.valueOf(type.toString());
|
HddsProtos.ReplicationType.valueOf(type.toString());
|
||||||
@ -619,7 +620,7 @@ public void testValidateBlockLengthWithCommitKey() throws IOException {
|
|||||||
out.close();
|
out.close();
|
||||||
OmKeyArgs.Builder builder = new OmKeyArgs.Builder();
|
OmKeyArgs.Builder builder = new OmKeyArgs.Builder();
|
||||||
builder.setVolumeName(volumeName).setBucketName(bucketName)
|
builder.setVolumeName(volumeName).setBucketName(bucketName)
|
||||||
.setKeyName(keyName);
|
.setKeyName(keyName).setRefreshPipeline(true);
|
||||||
OmKeyInfo keyInfo = ozoneManager.lookupKey(builder.build());
|
OmKeyInfo keyInfo = ozoneManager.lookupKey(builder.build());
|
||||||
|
|
||||||
List<OmKeyLocationInfo> locationInfoList =
|
List<OmKeyLocationInfo> locationInfoList =
|
||||||
@ -891,7 +892,7 @@ public void testGetKeyDetails() throws IOException, OzoneException {
|
|||||||
// First, confirm the key info from the client matches the info in OM.
|
// First, confirm the key info from the client matches the info in OM.
|
||||||
OmKeyArgs.Builder builder = new OmKeyArgs.Builder();
|
OmKeyArgs.Builder builder = new OmKeyArgs.Builder();
|
||||||
builder.setVolumeName(volumeName).setBucketName(bucketName)
|
builder.setVolumeName(volumeName).setBucketName(bucketName)
|
||||||
.setKeyName(keyName);
|
.setKeyName(keyName).setRefreshPipeline(true);
|
||||||
OmKeyLocationInfo keyInfo = ozoneManager.lookupKey(builder.build()).
|
OmKeyLocationInfo keyInfo = ozoneManager.lookupKey(builder.build()).
|
||||||
getKeyLocationVersions().get(0).getBlocksLatestVersionOnly().get(0);
|
getKeyLocationVersions().get(0).getBlocksLatestVersionOnly().get(0);
|
||||||
long containerID = keyInfo.getContainerID();
|
long containerID = keyInfo.getContainerID();
|
||||||
|
@ -144,7 +144,7 @@ public void testPutKeyAndGetKeyThreeNodes()
|
|||||||
// First, confirm the key info from the client matches the info in OM.
|
// First, confirm the key info from the client matches the info in OM.
|
||||||
OmKeyArgs.Builder builder = new OmKeyArgs.Builder();
|
OmKeyArgs.Builder builder = new OmKeyArgs.Builder();
|
||||||
builder.setVolumeName(volumeName).setBucketName(bucketName)
|
builder.setVolumeName(volumeName).setBucketName(bucketName)
|
||||||
.setKeyName(keyName);
|
.setKeyName(keyName).setRefreshPipeline(true);
|
||||||
OmKeyLocationInfo keyInfo = ozoneManager.lookupKey(builder.build()).
|
OmKeyLocationInfo keyInfo = ozoneManager.lookupKey(builder.build()).
|
||||||
getKeyLocationVersions().get(0).getBlocksLatestVersionOnly().get(0);
|
getKeyLocationVersions().get(0).getBlocksLatestVersionOnly().get(0);
|
||||||
long containerID = keyInfo.getContainerID();
|
long containerID = keyInfo.getContainerID();
|
||||||
|
@ -218,6 +218,7 @@ private boolean verifyRatisReplication(String volumeName, String bucketName,
|
|||||||
.setVolumeName(volumeName)
|
.setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
HddsProtos.ReplicationType replicationType =
|
HddsProtos.ReplicationType replicationType =
|
||||||
HddsProtos.ReplicationType.valueOf(type.toString());
|
HddsProtos.ReplicationType.valueOf(type.toString());
|
||||||
|
@ -143,7 +143,9 @@ public void testBlockDeletion() throws Exception {
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName(volumeName)
|
||||||
.setBucketName(bucketName).setKeyName(keyName).setDataSize(0)
|
.setBucketName(bucketName).setKeyName(keyName).setDataSize(0)
|
||||||
.setType(HddsProtos.ReplicationType.RATIS)
|
.setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).build();
|
.setFactor(HddsProtos.ReplicationFactor.ONE)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
|
.build();
|
||||||
List<OmKeyLocationInfoGroup> omKeyLocationInfoGroupList =
|
List<OmKeyLocationInfoGroup> omKeyLocationInfoGroupList =
|
||||||
om.lookupKey(keyArgs).getKeyLocationVersions();
|
om.lookupKey(keyArgs).getKeyLocationVersions();
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public void testIfCloseContainerCommandHandlerIsInvoked() throws Exception {
|
|||||||
new OmKeyArgs.Builder().setVolumeName("test").setBucketName("test")
|
new OmKeyArgs.Builder().setVolumeName("test").setBucketName("test")
|
||||||
.setType(HddsProtos.ReplicationType.RATIS)
|
.setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(1024)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(1024)
|
||||||
.setKeyName("standalone").build();
|
.setKeyName("standalone").setRefreshPipeline(true).build();
|
||||||
OmKeyLocationInfo omKeyLocationInfo =
|
OmKeyLocationInfo omKeyLocationInfo =
|
||||||
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
||||||
.get(0).getBlocksLatestVersionOnly().get(0);
|
.get(0).getBlocksLatestVersionOnly().get(0);
|
||||||
@ -157,7 +157,9 @@ public void testCloseContainerViaStandAlone()
|
|||||||
new OmKeyArgs.Builder().setVolumeName("test").setBucketName("test")
|
new OmKeyArgs.Builder().setVolumeName("test").setBucketName("test")
|
||||||
.setType(HddsProtos.ReplicationType.RATIS)
|
.setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(1024)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(1024)
|
||||||
.setKeyName("standalone").build();
|
.setKeyName("standalone")
|
||||||
|
.setRefreshPipeline(true)
|
||||||
|
.build();
|
||||||
|
|
||||||
OmKeyLocationInfo omKeyLocationInfo =
|
OmKeyLocationInfo omKeyLocationInfo =
|
||||||
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
||||||
@ -205,7 +207,7 @@ public void testCloseContainerViaRatis() throws IOException,
|
|||||||
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName("test").
|
OmKeyArgs keyArgs = new OmKeyArgs.Builder().setVolumeName("test").
|
||||||
setBucketName("test").setType(HddsProtos.ReplicationType.RATIS)
|
setBucketName("test").setType(HddsProtos.ReplicationType.RATIS)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.THREE).setDataSize(1024)
|
.setFactor(HddsProtos.ReplicationFactor.THREE).setDataSize(1024)
|
||||||
.setKeyName("ratis").build();
|
.setKeyName("ratis").setRefreshPipeline(true).build();
|
||||||
|
|
||||||
OmKeyLocationInfo omKeyLocationInfo =
|
OmKeyLocationInfo omKeyLocationInfo =
|
||||||
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
||||||
|
@ -76,7 +76,9 @@ public void test() throws IOException, TimeoutException, InterruptedException,
|
|||||||
new OmKeyArgs.Builder().setVolumeName("test").setBucketName("test")
|
new OmKeyArgs.Builder().setVolumeName("test").setBucketName("test")
|
||||||
.setType(HddsProtos.ReplicationType.STAND_ALONE)
|
.setType(HddsProtos.ReplicationType.STAND_ALONE)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(1024)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(1024)
|
||||||
.setKeyName("test").build();
|
.setKeyName("test")
|
||||||
|
.setRefreshPipeline(true)
|
||||||
|
.build();
|
||||||
|
|
||||||
OmKeyLocationInfo omKeyLocationInfo =
|
OmKeyLocationInfo omKeyLocationInfo =
|
||||||
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
||||||
|
@ -234,7 +234,9 @@ private ContainerID getContainerID(String keyName) throws IOException {
|
|||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setType(HddsProtos.ReplicationType.STAND_ALONE)
|
.setType(HddsProtos.ReplicationType.STAND_ALONE)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE)
|
.setFactor(HddsProtos.ReplicationFactor.ONE)
|
||||||
.setKeyName(keyName).build();
|
.setKeyName(keyName)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
|
.build();
|
||||||
|
|
||||||
OmKeyLocationInfo omKeyLocationInfo =
|
OmKeyLocationInfo omKeyLocationInfo =
|
||||||
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
cluster.getOzoneManager().lookupKey(keyArgs).getKeyLocationVersions()
|
||||||
|
@ -105,6 +105,7 @@ public void testContainerReportKeyWrite() throws Exception {
|
|||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
.setType(HddsProtos.ReplicationType.STAND_ALONE)
|
.setType(HddsProtos.ReplicationType.STAND_ALONE)
|
||||||
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(keySize)
|
.setFactor(HddsProtos.ReplicationFactor.ONE).setDataSize(keySize)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
@ -115,6 +115,7 @@ public void testAllocateCommit() throws Exception {
|
|||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
.setDataSize(1000)
|
.setDataSize(1000)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// 1st update, version 0
|
// 1st update, version 0
|
||||||
@ -214,6 +215,7 @@ public void testReadLatestVersion() throws Exception {
|
|||||||
.setBucketName(bucketName)
|
.setBucketName(bucketName)
|
||||||
.setKeyName(keyName)
|
.setKeyName(keyName)
|
||||||
.setDataSize(1000)
|
.setDataSize(1000)
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
String dataString = RandomStringUtils.randomAlphabetic(100);
|
String dataString = RandomStringUtils.randomAlphabetic(100);
|
||||||
|
@ -479,6 +479,7 @@ public LengthInputStream newKeyReader(KeyArgs args) throws IOException,
|
|||||||
.setBucketName(args.getBucketName())
|
.setBucketName(args.getBucketName())
|
||||||
.setKeyName(args.getKeyName())
|
.setKeyName(args.getKeyName())
|
||||||
.setDataSize(args.getSize())
|
.setDataSize(args.getSize())
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
OmKeyInfo keyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
||||||
return KeyInputStream.getFromOmKeyInfo(
|
return KeyInputStream.getFromOmKeyInfo(
|
||||||
@ -513,6 +514,7 @@ public KeyInfo getKeyInfo(KeyArgs args) throws IOException, OzoneException {
|
|||||||
.setVolumeName(args.getVolumeName())
|
.setVolumeName(args.getVolumeName())
|
||||||
.setBucketName(args.getBucketName())
|
.setBucketName(args.getBucketName())
|
||||||
.setKeyName(args.getKeyName())
|
.setKeyName(args.getKeyName())
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
OmKeyInfo omKeyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
OmKeyInfo omKeyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
||||||
@ -534,6 +536,7 @@ public KeyInfo getKeyInfoDetails(KeyArgs args) throws IOException{
|
|||||||
.setVolumeName(args.getVolumeName())
|
.setVolumeName(args.getVolumeName())
|
||||||
.setBucketName(args.getBucketName())
|
.setBucketName(args.getBucketName())
|
||||||
.setKeyName(args.getKeyName())
|
.setKeyName(args.getKeyName())
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo omKeyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
OmKeyInfo omKeyInfo = ozoneManagerClient.lookupKey(keyArgs);
|
||||||
List<KeyLocation> keyLocations = new ArrayList<>();
|
List<KeyLocation> keyLocations = new ArrayList<>();
|
||||||
|
@ -500,6 +500,7 @@ private LookupKeyResponse lookupKey(LookupKeyRequest request)
|
|||||||
.setVolumeName(keyArgs.getVolumeName())
|
.setVolumeName(keyArgs.getVolumeName())
|
||||||
.setBucketName(keyArgs.getBucketName())
|
.setBucketName(keyArgs.getBucketName())
|
||||||
.setKeyName(keyArgs.getKeyName())
|
.setKeyName(keyArgs.getKeyName())
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
OmKeyInfo keyInfo = impl.lookupKey(omKeyArgs);
|
OmKeyInfo keyInfo = impl.lookupKey(omKeyArgs);
|
||||||
resp.setKeyInfo(keyInfo.getProtobuf());
|
resp.setKeyInfo(keyInfo.getProtobuf());
|
||||||
@ -516,6 +517,7 @@ private RenameKeyResponse renameKey(RenameKeyRequest request)
|
|||||||
.setVolumeName(keyArgs.getVolumeName())
|
.setVolumeName(keyArgs.getVolumeName())
|
||||||
.setBucketName(keyArgs.getBucketName())
|
.setBucketName(keyArgs.getBucketName())
|
||||||
.setKeyName(keyArgs.getKeyName())
|
.setKeyName(keyArgs.getKeyName())
|
||||||
|
.setRefreshPipeline(true)
|
||||||
.build();
|
.build();
|
||||||
impl.renameKey(omKeyArgs, request.getToKeyName());
|
impl.renameKey(omKeyArgs, request.getToKeyName());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user