Shenjiaqi commented on code in PR #20860:
URL: https://github.com/apache/flink/pull/20860#discussion_r990613581


##########
flink-runtime/src/test/java/org/apache/flink/runtime/state/memory/ByteStreamStateHandleTest.java:
##########
@@ -172,4 +172,15 @@ public void testBulkReadINdexOutOfBounds() throws 
IOException {
             // expected
         }
     }
+
+    @Test
+    public void testStreamWithEmptyByteArray() throws IOException {
+        final byte[] data = new byte[0];
+        final ByteStreamStateHandle handle = new ByteStreamStateHandle("name", 
data);
+
+        FSDataInputStream in = handle.openInputStream();

Review Comment:
   Add try with resource when using FSDataInputStream.



##########
flink-runtime/src/test/java/org/apache/flink/runtime/state/memory/ByteStreamStateHandleTest.java:
##########
@@ -172,4 +172,15 @@ public void testBulkReadINdexOutOfBounds() throws 
IOException {
             // expected
         }
     }
+
+    @Test
+    public void testStreamWithEmptyByteArray() throws IOException {
+        final byte[] data = new byte[0];
+        final ByteStreamStateHandle handle = new ByteStreamStateHandle("name", 
data);
+
+        FSDataInputStream in = handle.openInputStream();

Review Comment:
   > This input stream could be closed properly.
   
   I will add try with resource when using FSDataInputStream.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to