yangl commented on a change in pull request #10715: URL: https://github.com/apache/pulsar/pull/10715#discussion_r647198868
########## File path: pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZkUtils.java ########## @@ -121,4 +124,45 @@ public static String getParentForPath(final String path) { final String parentPath = sb.toString(); return (parentPath.length() == 0) ? null : parentPath; } + + + /** + * Returns the trimmed "/ledgers" string + * + * @param path connect path sting + * @return the trimmed "/ledgers" string + */ + public static final String trimLedgersDefaultRootPath(String path) { + String rs = path; + if (StringUtils.endsWith(path, "/")) { + rs = StringUtils.substringBeforeLast(path, "/"); + } + // defalut "/ledgers" need to trim + if (StringUtils.endsWith(path, LEDGERS_DEFAULT_ROOT_PATH)) { Review comment: > will set data to ip:port/ledgers/bookies path? yes, this will cause incompatibility, but i think we should do this correctly. the people can move the data to the bookie's zookeeper by manual. > ZkBookieRackAffinityMapping will be used for bookkeeper client and bookkeeper auto recovery, it will call trimLedgersDefaultRootPath, and it shouldn't just trim the default value. done, now use the bookie's Metadata Service Uri. -- 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: us...@infra.apache.org