javeme commented on code in PR #2095:
URL:
https://github.com/apache/incubator-hugegraph/pull/2095#discussion_r1101418717
##########
hugegraph-core/src/main/java/org/apache/hugegraph/util/StringEncoding.java:
##########
@@ -92,33 +96,21 @@ public static int getAsciiByteLength(String value) {
}
public static byte[] encode(String value) {
- try {
- return value.getBytes("UTF-8");
- } catch (UnsupportedEncodingException e) {
- throw new HugeException("Failed to encode string", e);
- }
+ return value.getBytes(UTF_8);
Review Comment:
please don't change the logic
##########
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:
seems don't need to catch IOException
##########
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)) {
Review Comment:
keep the origin logic, or split into a new commit?
##########
hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraShard.java:
##########
@@ -56,12 +56,13 @@
* CassandraShard is used for cassandra scanning operations.
* Each shard represents a range of tokens for a node.
* Reading data from a given shard does not cross multiple nodes.
+ * <p>
* Refer to AbstractColumnFamilyInputFormat from:
* <a href="https://github.com/2013Commons/hive-cassandra/">...</a>
*/
public class CassandraShard {
- // The minimal shard size should >= 1M to prevent too many number of shards
+ /** The minimal shard size should >= 1M to prevent too many number of
shards */
Review Comment:
ok
--
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]