dlmarion commented on code in PR #2665:
URL: https://github.com/apache/accumulo/pull/2665#discussion_r881724768
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ClientContext.java:
##########
@@ -332,6 +340,75 @@ public synchronized BatchWriterConfig
getBatchWriterConfig() {
return batchWriterConfig;
}
+ /**
+ * @return map of live scan server addresses to lock uuids.
+ */
+ public Map<String,UUID> getScanServers() {
+ Map<String,UUID> 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) {
+ UUID uuid = UUID.fromString(new String(lockData, UTF_8));
+ liveScanServers.put(addr, uuid);
+ }
+ } catch (Exception e) {
+ log.error("Error validating zookeeper scan server node: " + addr, e);
+ }
+ }
+ return liveScanServers;
+ }
+
+ /**
+ * @return the scan server dispatcher implementation used for determining
which scan servers will
+ * be used when performing an eventually consistent scan
+ */
+ public synchronized ScanServerDispatcher getScanServerDispatcher() {
+ ensureOpen();
+ if (scanServerDispatcher == null) {
+ String clazz =
ClientProperty.SCAN_SERVER_DISPATCHER.getValue(info.getProperties());
Review Comment:
Addressed in 5c039df
--
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]