|
@@ -24,8 +24,8 @@ import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
|
|
import org.apache.hadoop.hdds.scm.XceiverClientManager;
|
|
import org.apache.hadoop.hdds.scm.XceiverClientManager;
|
|
import org.apache.hadoop.hdds.scm.XceiverClientMetrics;
|
|
import org.apache.hadoop.hdds.scm.XceiverClientMetrics;
|
|
import org.apache.hadoop.hdds.scm.XceiverClientRatis;
|
|
import org.apache.hadoop.hdds.scm.XceiverClientRatis;
|
|
-import org.apache.hadoop.hdds.scm.container.common.helpers
|
|
|
|
- .ContainerNotOpenException;
|
|
|
|
|
|
+import org.apache.hadoop.hdds.scm.client.HddsClientUtils;
|
|
|
|
+import org.apache.hadoop.hdds.scm.container.common.helpers.ContainerNotOpenException;
|
|
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
|
|
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
|
|
import org.apache.hadoop.hdds.scm.storage.BlockOutputStream;
|
|
import org.apache.hadoop.hdds.scm.storage.BlockOutputStream;
|
|
import org.apache.hadoop.ozone.MiniOzoneCluster;
|
|
import org.apache.hadoop.ozone.MiniOzoneCluster;
|
|
@@ -75,27 +75,23 @@ public class TestBlockOutputStreamWithFailures {
|
|
*
|
|
*
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
- @Before
|
|
|
|
- public void init() throws Exception {
|
|
|
|
|
|
+ @Before public void init() throws Exception {
|
|
chunkSize = 100;
|
|
chunkSize = 100;
|
|
flushSize = 2 * chunkSize;
|
|
flushSize = 2 * chunkSize;
|
|
maxFlushSize = 2 * flushSize;
|
|
maxFlushSize = 2 * flushSize;
|
|
blockSize = 2 * maxFlushSize;
|
|
blockSize = 2 * maxFlushSize;
|
|
- conf.set(OzoneConfigKeys.OZONE_CLIENT_WATCH_REQUEST_TIMEOUT, "5000ms");
|
|
|
|
|
|
+ conf.set(OzoneConfigKeys.OZONE_CLIENT_WATCH_REQUEST_TIMEOUT, "1s");
|
|
conf.setTimeDuration(HDDS_SCM_WATCHER_TIMEOUT, 1000, TimeUnit.MILLISECONDS);
|
|
conf.setTimeDuration(HDDS_SCM_WATCHER_TIMEOUT, 1000, TimeUnit.MILLISECONDS);
|
|
- conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 3, TimeUnit.SECONDS);
|
|
|
|
|
|
+ conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 5, TimeUnit.SECONDS);
|
|
conf.set(OzoneConfigKeys.OZONE_CLIENT_CHECKSUM_TYPE, "NONE");
|
|
conf.set(OzoneConfigKeys.OZONE_CLIENT_CHECKSUM_TYPE, "NONE");
|
|
conf.setQuietMode(false);
|
|
conf.setQuietMode(false);
|
|
conf.setStorageSize(OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE, 4,
|
|
conf.setStorageSize(OzoneConfigKeys.OZONE_SCM_BLOCK_SIZE, 4,
|
|
StorageUnit.MB);
|
|
StorageUnit.MB);
|
|
- cluster = MiniOzoneCluster.newBuilder(conf)
|
|
|
|
- .setNumDatanodes(7)
|
|
|
|
- .setBlockSize(blockSize)
|
|
|
|
- .setChunkSize(chunkSize)
|
|
|
|
|
|
+ cluster = MiniOzoneCluster.newBuilder(conf).setNumDatanodes(7)
|
|
|
|
+ .setBlockSize(blockSize).setChunkSize(chunkSize)
|
|
.setStreamBufferFlushSize(flushSize)
|
|
.setStreamBufferFlushSize(flushSize)
|
|
.setStreamBufferMaxSize(maxFlushSize)
|
|
.setStreamBufferMaxSize(maxFlushSize)
|
|
- .setStreamBufferSizeUnit(StorageUnit.BYTES)
|
|
|
|
- .build();
|
|
|
|
|
|
+ .setStreamBufferSizeUnit(StorageUnit.BYTES).build();
|
|
cluster.waitForClusterToBeReady();
|
|
cluster.waitForClusterToBeReady();
|
|
//the easiest way to create an open container is creating a key
|
|
//the easiest way to create an open container is creating a key
|
|
client = OzoneClientFactory.getClient(conf);
|
|
client = OzoneClientFactory.getClient(conf);
|
|
@@ -114,25 +110,24 @@ public class TestBlockOutputStreamWithFailures {
|
|
/**
|
|
/**
|
|
* Shutdown MiniDFSCluster.
|
|
* Shutdown MiniDFSCluster.
|
|
*/
|
|
*/
|
|
- @After
|
|
|
|
- public void shutdown() {
|
|
|
|
|
|
+ @After public void shutdown() {
|
|
if (cluster != null) {
|
|
if (cluster != null) {
|
|
cluster.shutdown();
|
|
cluster.shutdown();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testWatchForCommitWithCloseContainerException() throws Exception {
|
|
|
|
|
|
+ @Test public void testWatchForCommitWithCloseContainerException()
|
|
|
|
+ throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
@@ -155,15 +150,14 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 6,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 6, metrics.getTotalOpCount());
|
|
|
|
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
@@ -199,8 +193,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 8,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 8, metrics.getTotalOpCount());
|
|
|
|
|
|
// flush is a sync call, all pending operations will complete
|
|
// flush is a sync call, all pending operations will complete
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
@@ -233,9 +226,8 @@ public class TestBlockOutputStreamWithFailures {
|
|
// rewritten plus one partial chunk plus two putBlocks for flushSize
|
|
// rewritten plus one partial chunk plus two putBlocks for flushSize
|
|
// and one flush for partial chunk
|
|
// and one flush for partial chunk
|
|
key.flush();
|
|
key.flush();
|
|
-
|
|
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
|
|
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
@@ -247,8 +239,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertEquals(0, keyOutputStream.getStreamEntries().size());
|
|
Assert.assertEquals(0, keyOutputStream.getStreamEntries().size());
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
@@ -259,25 +250,23 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 22,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 22, metrics.getTotalOpCount());
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testWatchForCommitDatanodeFailure() throws Exception {
|
|
|
|
|
|
+ @Test public void testWatchForCommitDatanodeFailure() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
@@ -299,14 +288,13 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 6,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 6, metrics.getTotalOpCount());
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
@@ -344,8 +332,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 8,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 8, metrics.getTotalOpCount());
|
|
|
|
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// no impact on the counters and data structures
|
|
// no impact on the counters and data structures
|
|
@@ -376,8 +363,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
// now close the stream, It will update the ack length after watchForCommit
|
|
// now close the stream, It will update the ack length after watchForCommit
|
|
key.close();
|
|
key.close();
|
|
- Assert
|
|
|
|
- .assertEquals(blockSize, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(blockSize, blockOutputStream.getTotalAckDataLength());
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
@@ -396,25 +382,23 @@ public class TestBlockOutputStreamWithFailures {
|
|
// 4 flushes at flushSize boundaries + 2 flush for partial chunks
|
|
// 4 flushes at flushSize boundaries + 2 flush for partial chunks
|
|
Assert.assertEquals(putBlockCount + 6,
|
|
Assert.assertEquals(putBlockCount + 6,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 16,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 16, metrics.getTotalOpCount());
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void test2DatanodesFailure() throws Exception {
|
|
|
|
|
|
+ @Test public void test2DatanodesFailure() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
@@ -436,14 +420,13 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 6,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 6, metrics.getTotalOpCount());
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
@@ -479,8 +462,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 8,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 8, metrics.getTotalOpCount());
|
|
|
|
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// no impact on the counters and data structures
|
|
// no impact on the counters and data structures
|
|
@@ -512,7 +494,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
// rewritten plus one partial chunk plus two putBlocks for flushSize
|
|
// rewritten plus one partial chunk plus two putBlocks for flushSize
|
|
// and one flush for partial chunk
|
|
// and one flush for partial chunk
|
|
key.flush();
|
|
key.flush();
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof RaftRetryFailureException);
|
|
.getIoException()) instanceof RaftRetryFailureException);
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
@@ -522,8 +504,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
key.close();
|
|
key.close();
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
@@ -533,30 +514,27 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 22,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 22, metrics.getTotalOpCount());
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
- Assert.assertEquals(0, keyOutputStream.getStreamEntries().size());
|
|
|
|
|
|
+ Assert.assertEquals(0, keyOutputStream.getLocationInfoList().size());
|
|
validateData(keyName, data1);
|
|
validateData(keyName, data1);
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testFailureWithPrimeSizedData() throws Exception {
|
|
|
|
|
|
+ @Test public void testFailureWithPrimeSizedData() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
@@ -577,24 +555,21 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount,
|
|
Assert.assertEquals(putBlockCount,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 1,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 1, metrics.getTotalOpCount());
|
|
|
|
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
-
|
|
|
|
Assert.assertEquals(2, blockOutputStream.getBufferPool().getSize());
|
|
Assert.assertEquals(2, blockOutputStream.getBufferPool().getSize());
|
|
Assert.assertEquals(dataLength, blockOutputStream.getWrittenDataLength());
|
|
Assert.assertEquals(dataLength, blockOutputStream.getWrittenDataLength());
|
|
|
|
|
|
- Assert.assertEquals(0,
|
|
|
|
- blockOutputStream.getTotalDataFlushedLength());
|
|
|
|
|
|
+ Assert.assertEquals(0, blockOutputStream.getTotalDataFlushedLength());
|
|
|
|
|
|
Assert.assertTrue(blockOutputStream.getTotalAckDataLength() == 0);
|
|
Assert.assertTrue(blockOutputStream.getTotalAckDataLength() == 0);
|
|
|
|
|
|
@@ -613,8 +588,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 1,
|
|
Assert.assertEquals(putBlockCount + 1,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 3,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 3, metrics.getTotalOpCount());
|
|
|
|
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// no impact on the counters and data structures
|
|
// no impact on the counters and data structures
|
|
@@ -641,7 +615,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
key.flush();
|
|
key.flush();
|
|
|
|
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
@@ -653,8 +627,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
@@ -664,26 +637,24 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 9,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
- Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 0);
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 9, metrics.getTotalOpCount());
|
|
|
|
+ Assert.assertTrue(keyOutputStream.getLocationInfoList().size() == 0);
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testExceptionDuringClose() throws Exception {
|
|
|
|
|
|
+ @Test public void testExceptionDuringClose() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
OzoneOutputStream key = createKey(keyName, ReplicationType.RATIS, 0);
|
|
@@ -704,24 +675,21 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount,
|
|
Assert.assertEquals(putBlockCount,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 1,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 1, metrics.getTotalOpCount());
|
|
|
|
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
-
|
|
|
|
Assert.assertEquals(2, blockOutputStream.getBufferPool().getSize());
|
|
Assert.assertEquals(2, blockOutputStream.getBufferPool().getSize());
|
|
Assert.assertEquals(dataLength, blockOutputStream.getWrittenDataLength());
|
|
Assert.assertEquals(dataLength, blockOutputStream.getWrittenDataLength());
|
|
|
|
|
|
- Assert.assertEquals(0,
|
|
|
|
- blockOutputStream.getTotalDataFlushedLength());
|
|
|
|
|
|
+ Assert.assertEquals(0, blockOutputStream.getTotalDataFlushedLength());
|
|
|
|
|
|
Assert.assertTrue(blockOutputStream.getTotalAckDataLength() == 0);
|
|
Assert.assertTrue(blockOutputStream.getTotalAckDataLength() == 0);
|
|
|
|
|
|
@@ -740,8 +708,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 1,
|
|
Assert.assertEquals(putBlockCount + 1,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 3,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 3, metrics.getTotalOpCount());
|
|
|
|
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// no impact on the counters and data structures
|
|
// no impact on the counters and data structures
|
|
@@ -767,15 +734,14 @@ public class TestBlockOutputStreamWithFailures {
|
|
// now close the stream, It will hit exception
|
|
// now close the stream, It will hit exception
|
|
key.close();
|
|
key.close();
|
|
|
|
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
@@ -785,26 +751,24 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 9,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 9, metrics.getTotalOpCount());
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 0);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 0);
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testWatchForCommitWithSingleNodeRatis() throws Exception {
|
|
|
|
|
|
+ @Test public void testWatchForCommitWithSingleNodeRatis() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key =
|
|
OzoneOutputStream key =
|
|
@@ -828,15 +792,14 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 6,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 6, metrics.getTotalOpCount());
|
|
|
|
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
@@ -872,8 +835,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 8,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 8, metrics.getTotalOpCount());
|
|
|
|
|
|
// flush is a sync call, all pending operations will complete
|
|
// flush is a sync call, all pending operations will complete
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
@@ -907,7 +869,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
// and one flush for partial chunk
|
|
// and one flush for partial chunk
|
|
key.flush();
|
|
key.flush();
|
|
|
|
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
.getIoException()) instanceof ContainerNotOpenException);
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
Assert.assertTrue(keyOutputStream.getRetryCount() == 0);
|
|
@@ -919,10 +881,9 @@ public class TestBlockOutputStreamWithFailures {
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
- Assert.assertEquals(0, keyOutputStream.getStreamEntries().size());
|
|
|
|
|
|
+ Assert.assertEquals(0, keyOutputStream.getLocationInfoList().size());
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(pendingPutBlockCount,
|
|
Assert.assertEquals(pendingPutBlockCount,
|
|
@@ -931,25 +892,23 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 22,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 22, metrics.getTotalOpCount());
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testDatanodeFailureWithSingleNodeRatis() throws Exception {
|
|
|
|
|
|
+ @Test public void testDatanodeFailureWithSingleNodeRatis() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key =
|
|
OzoneOutputStream key =
|
|
@@ -972,14 +931,13 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 6,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 6, metrics.getTotalOpCount());
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 1);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
@@ -1015,8 +973,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 8,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 8, metrics.getTotalOpCount());
|
|
|
|
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// no impact on the counters and data structures
|
|
// no impact on the counters and data structures
|
|
@@ -1044,7 +1001,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
|
|
|
|
key.flush();
|
|
key.flush();
|
|
|
|
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof RaftRetryFailureException);
|
|
.getIoException()) instanceof RaftRetryFailureException);
|
|
Assert.assertEquals(1, raftClient.getCommitInfoMap().size());
|
|
Assert.assertEquals(1, raftClient.getCommitInfoMap().size());
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
@@ -1052,8 +1009,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
Assert.assertEquals(2, keyOutputStream.getStreamEntries().size());
|
|
// now close the stream, It will update the ack length after watchForCommit
|
|
// now close the stream, It will update the ack length after watchForCommit
|
|
key.close();
|
|
key.close();
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
@@ -1073,27 +1029,25 @@ public class TestBlockOutputStreamWithFailures {
|
|
// flush failed + 3 more flushes for the next block
|
|
// flush failed + 3 more flushes for the next block
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 22,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
- Assert.assertEquals(0, keyOutputStream.getStreamEntries().size());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 22, metrics.getTotalOpCount());
|
|
|
|
+ Assert.assertEquals(0, keyOutputStream.getLocationInfoList().size());
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
cluster.restartHddsDatanode(pipeline.getNodes().get(0), true);
|
|
cluster.restartHddsDatanode(pipeline.getNodes().get(0), true);
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
validateData(keyName, dataString.concat(dataString).getBytes());
|
|
}
|
|
}
|
|
|
|
|
|
- @Test
|
|
|
|
- public void testDatanodeFailureWithPreAllocation() throws Exception {
|
|
|
|
|
|
+ @Test public void testDatanodeFailureWithPreAllocation() throws Exception {
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientMetrics metrics =
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
XceiverClientManager.getXceiverClientMetrics();
|
|
- long writeChunkCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long putBlockCount = metrics.getContainerOpCountMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
- long pendingWriteChunkCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.WriteChunk);
|
|
|
|
- long pendingPutBlockCount = metrics.getContainerOpsMetrics(
|
|
|
|
- ContainerProtos.Type.PutBlock);
|
|
|
|
|
|
+ long writeChunkCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long putBlockCount =
|
|
|
|
+ metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock);
|
|
|
|
+ long pendingWriteChunkCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk);
|
|
|
|
+ long pendingPutBlockCount =
|
|
|
|
+ metrics.getContainerOpsMetrics(ContainerProtos.Type.PutBlock);
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
long totalOpCount = metrics.getTotalOpCount();
|
|
String keyName = getKeyName();
|
|
String keyName = getKeyName();
|
|
OzoneOutputStream key =
|
|
OzoneOutputStream key =
|
|
@@ -1117,14 +1071,13 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
Assert.assertEquals(putBlockCount + 2,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 6,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 6, metrics.getTotalOpCount());
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
Assert.assertTrue(key.getOutputStream() instanceof KeyOutputStream);
|
|
- KeyOutputStream keyOutputStream = (KeyOutputStream)key.getOutputStream();
|
|
|
|
|
|
+ KeyOutputStream keyOutputStream = (KeyOutputStream) key.getOutputStream();
|
|
|
|
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 3);
|
|
Assert.assertTrue(keyOutputStream.getStreamEntries().size() == 3);
|
|
- OutputStream stream = keyOutputStream.getStreamEntries().get(0)
|
|
|
|
- .getOutputStream();
|
|
|
|
|
|
+ OutputStream stream =
|
|
|
|
+ keyOutputStream.getStreamEntries().get(0).getOutputStream();
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
Assert.assertTrue(stream instanceof BlockOutputStream);
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
BlockOutputStream blockOutputStream = (BlockOutputStream) stream;
|
|
|
|
|
|
@@ -1160,8 +1113,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
Assert.assertEquals(putBlockCount + 3,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 8,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 8, metrics.getTotalOpCount());
|
|
|
|
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// Since the data in the buffer is already flushed, flush here will have
|
|
// no impact on the counters and data structures
|
|
// no impact on the counters and data structures
|
|
@@ -1188,7 +1140,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
|
|
|
|
key.flush();
|
|
key.flush();
|
|
|
|
|
|
- Assert.assertTrue(keyOutputStream.checkForException(blockOutputStream
|
|
|
|
|
|
+ Assert.assertTrue(HddsClientUtils.checkForException(blockOutputStream
|
|
.getIoException()) instanceof RaftRetryFailureException);
|
|
.getIoException()) instanceof RaftRetryFailureException);
|
|
|
|
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
// Make sure the retryCount is reset after the exception is handled
|
|
@@ -1197,13 +1149,12 @@ public class TestBlockOutputStreamWithFailures {
|
|
|
|
|
|
// now close the stream, It will update the ack length after watchForCommit
|
|
// now close the stream, It will update the ack length after watchForCommit
|
|
key.close();
|
|
key.close();
|
|
- Assert
|
|
|
|
- .assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
|
|
|
|
+ Assert.assertEquals(dataLength, blockOutputStream.getTotalAckDataLength());
|
|
// make sure the bufferPool is empty
|
|
// make sure the bufferPool is empty
|
|
Assert
|
|
Assert
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
.assertEquals(0, blockOutputStream.getBufferPool().computeBufferData());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
Assert.assertNull(blockOutputStream.getCommitIndex2flushedDataMap());
|
|
- Assert.assertEquals(0, keyOutputStream.getStreamEntries().size());
|
|
|
|
|
|
+ Assert.assertEquals(0, keyOutputStream.getLocationInfoList().size());
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
Assert.assertEquals(pendingWriteChunkCount,
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
metrics.getContainerOpsMetrics(ContainerProtos.Type.WriteChunk));
|
|
Assert.assertEquals(pendingPutBlockCount,
|
|
Assert.assertEquals(pendingPutBlockCount,
|
|
@@ -1219,8 +1170,7 @@ public class TestBlockOutputStreamWithFailures {
|
|
// flush failed + 3 more flushes for the next block
|
|
// flush failed + 3 more flushes for the next block
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
Assert.assertEquals(putBlockCount + 8,
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
metrics.getContainerOpCountMetrics(ContainerProtos.Type.PutBlock));
|
|
- Assert.assertEquals(totalOpCount + 22,
|
|
|
|
- metrics.getTotalOpCount());
|
|
|
|
|
|
+ Assert.assertEquals(totalOpCount + 22, metrics.getTotalOpCount());
|
|
// Written the same data twice
|
|
// Written the same data twice
|
|
String dataString = new String(data1, UTF_8);
|
|
String dataString = new String(data1, UTF_8);
|
|
cluster.restartHddsDatanode(pipeline.getNodes().get(0), true);
|
|
cluster.restartHddsDatanode(pipeline.getNodes().get(0), true);
|