Manno15 commented on a change in pull request #1958:
URL: https://github.com/apache/accumulo/pull/1958#discussion_r594451925
##########
File path:
core/src/main/java/org/apache/accumulo/fate/zookeeper/ZooQueueLock.java
##########
@@ -111,4 +115,50 @@ public void removeEntry(long entry) {
throw new RuntimeException(ex);
}
}
+
+ public static List<String> validateAndSortChildrenByLockPrefix(String path,
+ List<String> children) {
+ log.trace("validating and sorting children at path {}", path);
+ List<String> validChildren = new ArrayList<>();
+ if (children == null || children.isEmpty()) {
+ return validChildren;
+ }
+ children.forEach(c -> {
+ log.trace("Validating {}", c);
+ if (c.startsWith(PREFIX)) {
+ int idx = c.indexOf('#');
+ String sequenceNum = c.substring(idx + 1);
+ if (sequenceNum.length() == 10) {
+ try {
+ log.trace("Testing number format of {}", sequenceNum);
+ Integer.parseInt(sequenceNum);
+ validChildren.add(c);
+ } catch (NumberFormatException e) {
+ log.warn("Child found with invalid sequence format: {} (not a
number)", c);
Review comment:
I made some log changes in my latest commit
----------------------------------------------------------------
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:
[email protected]