imbajin commented on code in PR #2095:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2095#discussion_r1122677331


##########
hugegraph-core/src/main/java/org/apache/hugegraph/util/StringEncoding.java:
##########
@@ -137,18 +129,23 @@ public static byte[] compress(String value) {
     }
 
     public static byte[] compress(String value, float bufferRatio) {
-        BytesBuffer buf = LZ4Util.compress(encode(value), BLOCK_SIZE,
-                                           bufferRatio);
-        return buf.bytes();
+        try (BytesBuffer buf = LZ4Util.compress(encode(value), BLOCK_SIZE, 
bufferRatio)) {
+            return buf.bytes();
+        } catch (IOException e) {

Review Comment:
   the IOException throws by `LZ4Util.compress/decompress` & we just auto 
release the `BytesBuffer` when it used up, so if we don't catch exception, we 
need to throws out? (so as the `decompress`



-- 
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: dev-unsubscr...@hugegraph.apache.org

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

Reply via email to