szetszwo commented on a change in pull request #2978:
URL: https://github.com/apache/ozone/pull/2978#discussion_r782933872
##########
File path:
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java
##########
@@ -180,6 +182,7 @@ public BlockDataStreamOutput(
checksum = new Checksum(config.getChecksumType(),
config.getBytesPerChecksum());
metrics = XceiverClientManager.getXceiverClientMetrics();
+ buffersForPutBlock = new ArrayList<>();
Review comment:
Remove this line. The list will be created in writeChunk(..).
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java
##########
@@ -256,4 +257,22 @@ public void testMinPacketSize() throws Exception {
validateData(keyName, dataString.concat(dataString).getBytes(UTF_8));
}
+ @Test
+ public void testTotalAckDataLength() throws Exception {
+ int dataLength = 400;
+ String keyName = getKeyName();
+ OzoneDataStreamOutput key = createKey(
+ keyName, ReplicationType.RATIS, 0);
+ byte[] data =
+ ContainerTestHelper.getFixedLengthString(keyString, dataLength)
+ .getBytes(UTF_8);
+ KeyDataStreamOutput keyDataStreamOutput =
+ (KeyDataStreamOutput) key.getByteBufStreamOutput();
+ BlockDataStreamOutputEntry stream =
+ keyDataStreamOutput.getStreamEntries().get(0);
+ key.write(ByteBuffer.wrap(data));
+ key.close();
+ Assert.assertTrue(stream.getTotalAckDataLength()==dataLength);
Review comment:
Use assertEquals, i.e.
```
Assert.assertEquals(dataLength, stream.getTotalAckDataLength());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]