Manno15 commented on a change in pull request #1958:
URL: https://github.com/apache/accumulo/pull/1958#discussion_r595093391
##########
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:
@EdColeman Thoughts on my recent log changes? Is that more descriptive
and do you think I should make those same log changes in the validation
function inside `ZooLock`? If you approve then I will get this merged in today.
----------------------------------------------------------------
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]