Ethanlm commented on a change in pull request #3388:
URL: https://github.com/apache/storm/pull/3388#discussion_r600715583
##########
File path:
external/storm-eventhubs/src/main/java/org/apache/storm/eventhubs/spout/ZookeeperStateStore.java
##########
@@ -60,7 +61,7 @@ public void close() {
@Override
public void saveData(String statePath, String data) {
data = data == null ? "" : data;
- byte[] bytes = data.getBytes();
+ byte[] bytes = DFSUtil.string2Bytes(data);
Review comment:
I prefer to not introduce hadoop dependencies just for this single
function since its implementation is really simple
https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java#L273
https://github.com/apache/hadoop/blob/trunk/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSUtilClient.java#L114-L120
This `DFSUtil.string2Bytes(data)` method is basically equivalent to
`data.getBytes(StandardCharsets.UTF_8.name());`.
Can you explain more about the issues you have encountered and maybe provide
a test case?
Thanks
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]