dlmarion commented on code in PR #6065:
URL: https://github.com/apache/accumulo/pull/6065#discussion_r2708174663


##########
core/src/main/java/org/apache/accumulo/core/fate/zookeeper/ServiceLock.java:
##########
@@ -716,6 +719,32 @@ public long getSessionId() throws KeeperException, 
InterruptedException {
     }
   }
 
+  /**
+   * This method will delete multiple server locks for a given path according 
the predicate
+   * conditions.
+   *
+   * @param hostPortPredicate conditional predicate for determining if the 
lock should be removed.
+   * @param messageOutput function for setting where the output from the 
lockPath goes
+   * @param dryRun allows lock format validation and the messageOutput to be 
sent without actually
+   *        deleting the lock
+   *
+   */
+  public static void deleteLocks(ZooReaderWriter zk, String zPath,
+      Predicate<HostAndPort> hostPortPredicate, Consumer<String> 
messageOutput, Boolean dryRun)
+      throws KeeperException, InterruptedException {
+    if (zk.exists(zPath)) {

Review Comment:
   We should probably add some input validation to make sure that the objects 
are not null (e.g. `Objects.requireNonNull`).



-- 
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]

Reply via email to