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 2021/03/16 05:40:59 UTC

[GitHub] [kafka] wenbingshen opened a new pull request #10329: MINOR: remove some specifying types in tool command

wenbingshen opened a new pull request #10329:
URL: https://github.com/apache/kafka/pull/10329


   As the title.I checked some of the command-line tools and removed some of the specified types.
   
   ### 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.

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



[GitHub] [kafka] wenbingshen commented on pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#issuecomment-800824944


   > @wenbingshen I believe those failed tests are unrelated to you patch. However, could you merge trunk to trigger QA again? We all love green QA :)
   
   Thank you for your review, I am very happy to do this. :)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] chia7712 merged pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
chia7712 merged pull request #10329:
URL: https://github.com/apache/kafka/pull/10329


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#issuecomment-800821160


   @wenbingshen I believe those failed tests are unrelated to you patch. However, could you merge trunk to trigger QA again? We all love green QA :)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] wenbingshen commented on pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#issuecomment-799968752


   :) @dajac Can you help review this minor pr?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.

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



[GitHub] [kafka] wenbingshen commented on pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#issuecomment-800933272


   > LGTM, pending Jenkins. Thanks!
   
   Many thanks for your help!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] dajac commented on a change in pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
dajac commented on a change in pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#discussion_r595805567



##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -1215,10 +1214,9 @@ object ReassignPartitionsCommand extends Logging {
   def cancelPartitionReassignments(adminClient: Admin,
                                    reassignments: Set[TopicPartition])
   : Map[TopicPartition, Throwable] = {
-    val results: Map[TopicPartition, KafkaFuture[Void]] =
-      adminClient.alterPartitionReassignments(reassignments.map {
-          (_, (None: Option[NewPartitionReassignment]).asJava)
-        }.toMap.asJava).values().asScala
+    val results = adminClient.alterPartitionReassignments(reassignments.map {
+      (_, (None: Option[NewPartitionReassignment]).asJava)

Review comment:
       While we are here, could we replace `(None: Option[NewPartitionReassignment]).asJava` by `Optional.empty[NewPartitionReassignment]()` or `Option.empty[NewPartitionReassignment].asJava`? Personally, I prefer using `Optional` directly here as we use `Optional.of` above.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] wenbingshen commented on pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#issuecomment-800877844


   > Thanks for the patch. Left two minor stylistic comments.
   
   Thank you for your comments, I have modified it, can you see see it again? Thank you. :)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] wenbingshen commented on a change in pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on a change in pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#discussion_r595820217



##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -1215,10 +1214,9 @@ object ReassignPartitionsCommand extends Logging {
   def cancelPartitionReassignments(adminClient: Admin,
                                    reassignments: Set[TopicPartition])
   : Map[TopicPartition, Throwable] = {
-    val results: Map[TopicPartition, KafkaFuture[Void]] =
-      adminClient.alterPartitionReassignments(reassignments.map {
-          (_, (None: Option[NewPartitionReassignment]).asJava)
-        }.toMap.asJava).values().asScala
+    val results = adminClient.alterPartitionReassignments(reassignments.map {
+      (_, (None: Option[NewPartitionReassignment]).asJava)

Review comment:
       Good idea.I updated the code, please review it again, thank you.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] wenbingshen commented on pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
wenbingshen commented on pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#issuecomment-800449460


   > @wenbingshen thanks for your patch. As you are doing cleanup for `AclCommand`, could you remove all unnecessary type declaration from this class?
   
   Thanks for your comments.I rechecked and performed the relevant unit tests.Please review again.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [kafka] dajac commented on a change in pull request #10329: MINOR: remove some specifying types in tool command

Posted by GitBox <gi...@apache.org>.
dajac commented on a change in pull request #10329:
URL: https://github.com/apache/kafka/pull/10329#discussion_r595751198



##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -1189,8 +1189,7 @@ object ReassignPartitionsCommand extends Logging {
    */
   def alterPartitionReassignments(adminClient: Admin,
                                   reassignments: Map[TopicPartition, Seq[Int]]): Map[TopicPartition, Throwable] = {
-    val results: Map[TopicPartition, KafkaFuture[Void]] =
-      adminClient.alterPartitionReassignments(reassignments.map { case (part, replicas) =>
+    val results = adminClient.alterPartitionReassignments(reassignments.map { case (part, replicas) =>

Review comment:
       nit: The indentation of the two lines below could be corrected now.

##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -1215,8 +1214,7 @@ object ReassignPartitionsCommand extends Logging {
   def cancelPartitionReassignments(adminClient: Admin,
                                    reassignments: Set[TopicPartition])
   : Map[TopicPartition, Throwable] = {
-    val results: Map[TopicPartition, KafkaFuture[Void]] =
-      adminClient.alterPartitionReassignments(reassignments.map {
+    val results = adminClient.alterPartitionReassignments(reassignments.map {

Review comment:
       ditto




----------------------------------------------------------------
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:
users@infra.apache.org