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


##########
server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java:
##########
@@ -71,11 +72,11 @@ public static void prepareNewNamespaceState(ZooReaderWriter 
zoo, final PropStore
       InstanceId instanceId, NamespaceId namespaceId, String namespace,
       NodeExistsPolicy existsPolicy) throws KeeperException, 
InterruptedException {
     log.debug("Creating ZooKeeper entries for new namespace {} (ID: {})", 
namespace, namespaceId);
-    String zPath = Constants.ZROOT + "/" + instanceId + Constants.ZNAMESPACES 
+ "/" + namespaceId;
+    String zPath = Constants.ZROOT + "/" + instanceId + Constants.ZNAMESPACES;
 
-    zoo.putPersistentData(zPath, new byte[0], existsPolicy);
-    zoo.putPersistentData(zPath + Constants.ZNAMESPACE_NAME, 
namespace.getBytes(UTF_8),
-        existsPolicy);
+    zoo.putPersistentData(zPath + "/" + namespaceId, new byte[0], 
existsPolicy);
+    zoo.putPersistentData(zPath,
+        NamespaceMapping.writeNamespaceToMap(zoo, zPath, namespaceId, 
namespace), existsPolicy);

Review Comment:
   Updated to use mutateExisting, included TODO to check for already-existing 
namespace name in future commit (likely part of this PR still).



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