[
https://issues.apache.org/jira/browse/STORM-1257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15117302#comment-15117302
]
ASF GitHub Bot commented on STORM-1257:
---------------------------------------
Github user revans2 commented on a diff in the pull request:
https://github.com/apache/storm/pull/1047#discussion_r50842034
--- Diff: storm-core/src/jvm/org/apache/storm/utils/Utils.java ---
@@ -1382,5 +1382,43 @@ public static TopologyInfo getTopologyInfo(String
name, String asUser, Map storm
public static int toPositive(int number) {
return number & Integer.MAX_VALUE;
}
+
+ public static RuntimeException wrapInRuntime(Exception e){
+ if (e instanceof RuntimeException){
+ return (RuntimeException)e;
+ }else {
+ return new RuntimeException(e);
+ }
+ }
+
+ public static List<String> tokenizePath(String path) {
+ String[] toks = path.split(File.separator);
+ java.util.ArrayList<String> rtn = new ArrayList<String>();
+ for (String str : toks) {
+ if (!str.isEmpty()) {
+ rtn.add(str);
+ }
+ }
+ return rtn;
+ }
+
+ public static String toksToPath(List<String> toks) {
+ StringBuffer buff = new StringBuffer();
+ buff.append(File.separator);
+ int size = toks.size();
+ for (int i = 0; i < size; i++) {
+ buff.append(toks.get(i));
+ if (i < (size - 1)) {
+ buff.append(File.separator);
+ }
+
+ }
+ return buff.toString();
+ }
+
+ public static String normalizePath(String path) {
+ String rtn = toksToPath(tokenizePath(path));
+ return rtn;
+ }
--- End diff --
Can we please move tokenizePath, toksToPath, and normalizePath to
Zookeeper.java? and change them from using File.separator, to use "/". The
issue is that they are specific to zookeeper so need the "/", without it on
windows it will not work. They should never have been in util.clj to begin
with. I'll update the util.clj JIRA to indicate this too.
> port backtype.storm.zookeeper to java
> -------------------------------------
>
> Key: STORM-1257
> URL: https://issues.apache.org/jira/browse/STORM-1257
> Project: Apache Storm
> Issue Type: New Feature
> Components: storm-core
> Reporter: Robert Joseph Evans
> Assignee: John Fang
> Labels: java-migration, jstorm-merger
>
> A wrapper around zookeeper/curator.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)