dlmarion commented on code in PR #4861:
URL: https://github.com/apache/accumulo/pull/4861#discussion_r1904394851
##########
server/compactor/src/main/java/org/apache/accumulo/compactor/Compactor.java:
##########
@@ -258,16 +258,18 @@ protected void checkIfCanceled() {
protected void announceExistence(HostAndPort clientAddress)
throws KeeperException, InterruptedException {
- String hostPort = ExternalCompactionUtil.getHostPortString(clientAddress);
-
ZooReaderWriter zoo = getContext().getZooReaderWriter();
- String compactorQueuePath =
- getContext().getZooKeeperRoot() + Constants.ZCOMPACTORS + "/" +
this.getResourceGroup();
- String zPath = compactorQueuePath + "/" + hostPort;
+ final ServiceLockPath path =
+ getContext().getServerPaths().createCompactorPath(getResourceGroup(),
clientAddress);
+ // The ServiceLockPath contains a resource group in the path which is not
created
+ // at initialization time. If it does not exist, then create it.
+ final String compactorGroupPath =
+ path.toString().substring(0, path.toString().lastIndexOf("/" +
path.getServer()));
+ LOG.debug("Creating compactor resource group path in zookeeper: {}",
compactorGroupPath);
try {
- zoo.mkdirs(compactorQueuePath);
- zoo.putPersistentData(zPath, new byte[] {}, NodeExistsPolicy.SKIP);
+ zoo.mkdirs(compactorGroupPath);
+ zoo.putPersistentData(path.toString(), new byte[] {},
NodeExistsPolicy.SKIP);
Review Comment:
Created #5225 for this.
--
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]