You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/09/13 07:00:26 UTC

[GitHub] [kafka] showuon opened a new pull request, #12334: KAFKA-13981: Adding new record type handler in metadata shell

showuon opened a new pull request, #12334:
URL: https://github.com/apache/kafka/pull/12334

   New records handled in this PR:
   `FEATURE_LEVEL_RECORD`: featureLevels/FEATURE_NAME -> level
   `BROKER_REGISTRATION_CHANGE_RECORD`: 
      -> brokers/BROKER_ID/isFenced -> true/false
      -> brokers/BROKER_ID/registration -> json content
   `ACCESS_CONTROL_ENTRY_RECORD`: acls/ACL_UUID/data -> json content
   `REMOVE_ACCESS_CONTROL_ENTRY_RECORD`: remove acls/ACL_UUID
   `NO_OP_RECORD`: no op
   
   Tests added.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] dengziming commented on a diff in pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell

Posted by GitBox <gi...@apache.org>.
dengziming commented on code in PR #12334:
URL: https://github.com/apache/kafka/pull/12334#discussion_r904734070


##########
shell/src/main/java/org/apache/kafka/shell/MetadataNodeManager.java:
##########
@@ -333,6 +339,44 @@ private void handleCommitImpl(MetadataRecordType type, ApiMessage message)
                 producerIds.create("nextBlockStartId").setContents(record.nextProducerId() + "");
                 break;
             }
+            case FEATURE_LEVEL_RECORD: {
+                FeatureLevelRecord record = (FeatureLevelRecord) message;
+                DirectoryNode featureLevels = data.root.mkdirs("featureLevels");
+                featureLevels.create(record.name()).setContents(Short.toString(record.featureLevel()));
+                break;
+            }
+            case BROKER_REGISTRATION_CHANGE_RECORD: {
+                BrokerRegistrationChangeRecord record = (BrokerRegistrationChangeRecord) message;
+                DirectoryNode brokerNode = data.root.mkdirs("brokers", Integer.toString(record.brokerId()));
+                FileNode registrationNode = brokerNode.create("registration");
+                JsonNode node = BrokerRegistrationChangeRecordJsonConverter.
+                        write(record, BrokerRegistrationChangeRecord.HIGHEST_SUPPORTED_VERSION);
+                registrationNode.setContents(node.toPrettyString());
+                if (record.fenced() == Byte.parseByte("1")) {

Review Comment:
   We can use `BrokerRegistrationFencingChange.fromValue`



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] showuon commented on pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell

Posted by GitBox <gi...@apache.org>.
showuon commented on PR #12334:
URL: https://github.com/apache/kafka/pull/12334#issuecomment-1164402369

   Thanks @dengziming for the comments. Sorry that I didn't know you already have another PR addressing this issue. Let's waiting for the PR https://github.com/apache/kafka/pull/12236 merged. Thanks.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] showuon closed pull request #12334: MINOR: [WIP] build tests

Posted by GitBox <gi...@apache.org>.
showuon closed pull request #12334: MINOR: [WIP] build tests
URL: https://github.com/apache/kafka/pull/12334


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] showuon closed pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell

Posted by GitBox <gi...@apache.org>.
showuon closed pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell
URL: https://github.com/apache/kafka/pull/12334


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] showuon commented on pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell

Posted by GitBox <gi...@apache.org>.
showuon commented on PR #12334:
URL: https://github.com/apache/kafka/pull/12334#issuecomment-1164037066

   @cmccabe @hachikuji @dengziming , call for review. Thanks.


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] showuon commented on a diff in pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell

Posted by GitBox <gi...@apache.org>.
showuon commented on code in PR #12334:
URL: https://github.com/apache/kafka/pull/12334#discussion_r905014282


##########
shell/src/main/java/org/apache/kafka/shell/MetadataNodeManager.java:
##########
@@ -333,6 +339,44 @@ private void handleCommitImpl(MetadataRecordType type, ApiMessage message)
                 producerIds.create("nextBlockStartId").setContents(record.nextProducerId() + "");
                 break;
             }
+            case FEATURE_LEVEL_RECORD: {
+                FeatureLevelRecord record = (FeatureLevelRecord) message;
+                DirectoryNode featureLevels = data.root.mkdirs("featureLevels");
+                featureLevels.create(record.name()).setContents(Short.toString(record.featureLevel()));
+                break;
+            }
+            case BROKER_REGISTRATION_CHANGE_RECORD: {
+                BrokerRegistrationChangeRecord record = (BrokerRegistrationChangeRecord) message;
+                DirectoryNode brokerNode = data.root.mkdirs("brokers", Integer.toString(record.brokerId()));
+                FileNode registrationNode = brokerNode.create("registration");
+                JsonNode node = BrokerRegistrationChangeRecordJsonConverter.
+                        write(record, BrokerRegistrationChangeRecord.HIGHEST_SUPPORTED_VERSION);
+                registrationNode.setContents(node.toPrettyString());
+                if (record.fenced() == Byte.parseByte("1")) {

Review Comment:
   Nice suggestion. Thanks.



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] showuon closed pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell

Posted by GitBox <gi...@apache.org>.
showuon closed pull request #12334: KAFKA-13981: Adding new record type handler in metadata shell
URL: https://github.com/apache/kafka/pull/12334


-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org