dengziming commented on code in PR #12103:
URL: https://github.com/apache/kafka/pull/12103#discussion_r953422085


##########
shell/src/test/java/org/apache/kafka/shell/MetadataNodeManagerTest.java:
##########
@@ -336,4 +403,43 @@ public void testProducerIdsRecord() {
             11000 + "",
             
metadataNodeManager.getData().root().directory("producerIds").file("nextBlockStartId").contents());
     }
+
+    @Test
+    public void 
testAccessControlEntryRecordAndRemoveAccessControlEntryRecord() {
+        AccessControlEntryRecord record1 = new AccessControlEntryRecord()
+            .setId(Uuid.fromString("GcaQDl2UTsCNs1p9s37XkQ"))

Review Comment:
   This is a little overkill here, we are using random strings in a lot of test 
cases and it won't reduce the code quality, and `Uuid.ZERO_UUID` may have some 
special meaning in different cases.



##########
shell/src/main/java/org/apache/kafka/shell/MetadataNodeManager.java:
##########
@@ -333,6 +357,36 @@ private void handleCommitImpl(MetadataRecordType type, 
ApiMessage message)
                 
producerIds.create("nextBlockStartId").setContents(record.nextProducerId() + 
"");
                 break;
             }
+            case ACCESS_CONTROL_ENTRY_RECORD: {
+                AccessControlEntryRecord record = (AccessControlEntryRecord) 
message;
+                DirectoryNode acls = data.root.mkdirs("acl").mkdirs("id");
+                FileNode file = acls.create(record.id().toString());
+                
file.setContents(AccessControlEntryRecordJsonConverter.write(record,
+                    
AccessControlEntryRecord.HIGHEST_SUPPORTED_VERSION).toPrettyString());
+                break;
+            }
+            case REMOVE_ACCESS_CONTROL_ENTRY_RECORD: {
+                RemoveAccessControlEntryRecord record = 
(RemoveAccessControlEntryRecord) message;
+                DirectoryNode acls = data.root.mkdirs("acl").mkdirs("id");
+                acls.rmrf(record.id().toString());
+                break;
+            }
+            case FEATURE_LEVEL_RECORD: {
+                FeatureLevelRecord record = (FeatureLevelRecord) message;
+                DirectoryNode features = data.root.mkdirs("features");
+                if (record.featureLevel() == 0) {
+                    features.rmrf(record.name());

Review Comment:
   Good suggestion.



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