meatballspaghetti commented on code in PR #5549:
URL: https://github.com/apache/accumulo/pull/5549#discussion_r2111941668


##########
server/manager/src/main/java/org/apache/accumulo/manager/TableStateWatcher.java:
##########
@@ -46,12 +46,14 @@ public void accept(WatchedEvent event) {
 
     TableId tableId = null;
 
-    if (zPath != null && zPath.startsWith(Constants.ZTABLES + "/")) {
-      String suffix = zPath.substring(Constants.ZTABLES.length() + 1);
-      if (suffix.contains("/")) {
-        String[] sa = suffix.split("/", 2);
-        if (Constants.ZTABLE_STATE.equals("/" + sa[1])) {
-          tableId = TableId.of(sa[0]);
+    if (zPath != null && zPath.startsWith(Constants.ZNAMESPACES + "/")) {
+      String[] parts = zPath.split("/");
+      if (parts.length >= 6 && Constants.ZNAMESPACES.equals(parts[1])
+          && Constants.ZTABLES.equals(parts[3])) {
+        String tableIdPart = parts[4];
+        String afterTableId = "/" + parts[5];
+        if (Constants.ZTABLE_STATE.equals(afterTableId)) {
+          tableId = TableId.of(tableIdPart);

Review Comment:
   Fixed.



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