dlmarion commented on code in PR #2665:
URL: https://github.com/apache/accumulo/pull/2665#discussion_r939132929
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java:
##########
@@ -332,6 +392,51 @@ public synchronized BatchWriterConfig
getBatchWriterConfig() {
return batchWriterConfig;
}
+ public static class ScanServerInfo {
+ public final UUID uuid;
+ public final String group;
+
+ public ScanServerInfo(UUID uuid, String group) {
+ this.uuid = uuid;
+ this.group = group;
+ }
+
+ }
+
+ /**
+ * @return map of live scan server addresses to lock uuids.
+ */
+ public Map<String,ScanServerInfo> getScanServers() {
+ Map<String,ScanServerInfo> liveScanServers = new HashMap<>();
+ String root = this.getZooKeeperRoot() + Constants.ZSSERVERS;
+ var addrs = this.getZooCache().getChildren(root);
+ for (String addr : addrs) {
+ try {
+ final var zLockPath = ServiceLock.path(root + "/" + addr);
+ ZcStat stat = new ZcStat();
+ byte[] lockData = ServiceLock.getLockData(getZooCache(), zLockPath,
stat);
+ if (lockData != null) {
+ String[] fields = new String(lockData, UTF_8).split(",", 2);
+ UUID uuid = UUID.fromString(fields[0]);
+ String group = fields[1];
+ liveScanServers.put(addr, new ScanServerInfo(uuid, group));
+ }
+ } catch (Exception e) {
+ log.error("Error validating zookeeper scan server node: " + addr, e);
Review Comment:
Resolved in f437fed
--
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]