jt2594838 commented on a change in pull request #25: Fix sonar
URL: https://github.com/apache/incubator-iotdb/pull/25#discussion_r250492738
 
 

 ##########
 File path: 
tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkBuffer.java
 ##########
 @@ -144,16 +141,15 @@ public int writePageHeaderAndDataIntoBuff(ByteBuffer 
data, int valueCount,
     this.totalValueCount += valueCount;
 
     // write page content to temp PBAOS
-    try {
+    try(WritableByteChannel channel = Channels.newChannel(pageBuffer)) {
       LOG.debug("start to flush a page data into buffer, buffer position {} ", 
pageBuffer.size());
       if (compressor.getType().equals(CompressionType.UNCOMPRESSED)) {
-        WritableByteChannel channel = Channels.newChannel(pageBuffer);
         channel.write(data);
       } else {
         if (data.isDirect()) {
-          WritableByteChannel channel = Channels.newChannel(pageBuffer);
           channel.write(compressedData);
         } else {
+          assert compressedBytes != null;
 
 Review comment:
   assert?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to