kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: MINOR: Fix typo in heartbeat request protocol definition (#6759)
Date Sat, 18 May 2019 23:20:12 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e00c0d3  MINOR: Fix typo in heartbeat request protocol definition (#6759)
e00c0d3 is described below

commit e00c0d316db01fbe5e57a4dfd54856c89e761b08
Author: Boyang Chen <boyang@confluent.io>
AuthorDate: Sat May 18 16:20:00 2019 -0700

    MINOR: Fix typo in heartbeat request protocol definition (#6759)
    
    This changes the field "generationid" to "generationId" to be consistent with other uses.
    
    Reviewers: Shaobo Liu <lambda.tencent@gmail.com>, Jason Gustafson <jason@confluent.io>
---
 .../clients/consumer/internals/AbstractCoordinator.java     |  4 ++--
 .../src/main/resources/common/message/HeartbeatRequest.json |  2 +-
 .../consumer/internals/ConsumerNetworkClientTest.java       |  2 +-
 .../apache/kafka/common/requests/RequestResponseTest.java   |  2 +-
 core/src/main/scala/kafka/server/KafkaApis.scala            |  2 +-
 .../integration/kafka/api/AuthorizerIntegrationTest.scala   | 13 ++++++++++---
 core/src/test/scala/unit/kafka/server/KafkaApisTest.scala   |  2 +-
 .../src/test/scala/unit/kafka/server/RequestQuotaTest.scala | 13 +++++++++++--
 8 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
index e08a818..3af6d05 100644
--- a/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
+++ b/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java
@@ -905,9 +905,9 @@ public abstract class AbstractCoordinator implements Closeable {
         HeartbeatRequest.Builder requestBuilder =
                 new HeartbeatRequest.Builder(new HeartbeatRequestData()
                         .setGroupId(groupId)
-                        .setGenerationid(this.generation.generationId)
+                        .setMemberId(this.generation.memberId)
                         .setGroupInstanceId(this.groupInstanceId.orElse(null))
-                        .setMemberId(this.generation.memberId));
+                        .setGenerationId(this.generation.generationId));
         return client.send(coordinator, requestBuilder)
                 .compose(new HeartbeatResponseHandler());
     }
diff --git a/clients/src/main/resources/common/message/HeartbeatRequest.json b/clients/src/main/resources/common/message/HeartbeatRequest.json
index 1b10a00..148e661 100644
--- a/clients/src/main/resources/common/message/HeartbeatRequest.json
+++ b/clients/src/main/resources/common/message/HeartbeatRequest.json
@@ -23,7 +23,7 @@
   "fields": [
     { "name": "GroupId", "type": "string", "versions": "0+", "entityType": "groupId",
       "about": "The group id." },
-    { "name": "Generationid", "type": "int32", "versions": "0+",
+    { "name": "GenerationId", "type": "int32", "versions": "0+",
       "about": "The generation of the group." },
     { "name": "MemberId", "type": "string", "versions": "0+",
       "about": "The member ID." },
diff --git a/clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClientTest.java
b/clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClientTest.java
index d6c5c2e..9c555e3 100644
--- a/clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClientTest.java
+++ b/clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkClientTest.java
@@ -417,7 +417,7 @@ public class ConsumerNetworkClientTest {
     private HeartbeatRequest.Builder heartbeat() {
         return new HeartbeatRequest.Builder(new HeartbeatRequestData()
                 .setGroupId("group")
-                .setGenerationid(1)
+                .setGenerationId(1)
                 .setMemberId("memberId"));
     }
 
diff --git a/clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java
b/clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java
index 5413b11..1cef864 100644
--- a/clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java
+++ b/clients/src/test/java/org/apache/kafka/common/requests/RequestResponseTest.java
@@ -776,7 +776,7 @@ public class RequestResponseTest {
     private HeartbeatRequest createHeartBeatRequest() {
         return new HeartbeatRequest.Builder(new HeartbeatRequestData()
                 .setGroupId("group1")
-                .setGenerationid(1)
+                .setGenerationId(1)
                 .setMemberId("consumer1")).build();
     }
 
diff --git a/core/src/main/scala/kafka/server/KafkaApis.scala b/core/src/main/scala/kafka/server/KafkaApis.scala
index 44642e0..d362d64 100644
--- a/core/src/main/scala/kafka/server/KafkaApis.scala
+++ b/core/src/main/scala/kafka/server/KafkaApis.scala
@@ -1476,7 +1476,7 @@ class KafkaApis(val requestChannel: RequestChannel,
         heartbeatRequest.data.groupId,
         heartbeatRequest.data.memberId,
         Option(heartbeatRequest.data.groupInstanceId),
-        heartbeatRequest.data.generationid,
+        heartbeatRequest.data.generationId,
         sendResponseCallback)
     }
   }
diff --git a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala
index fa5e91a..b465773 100644
--- a/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/AuthorizerIntegrationTest.scala
@@ -380,9 +380,16 @@ class AuthorizerIntegrationTest extends BaseRequestTest {
     ).build()
   }
 
-  private def heartbeatRequest = new HeartbeatRequest.Builder(new HeartbeatRequestData().setGroupId(group).setGenerationid(1).setMemberId("")).build()
-
-  private def leaveGroupRequest = new LeaveGroupRequest.Builder(new LeaveGroupRequestData().setGroupId(group).setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID)).build()
+  private def heartbeatRequest = new HeartbeatRequest.Builder(
+    new HeartbeatRequestData()
+      .setGroupId(group)
+      .setGenerationId(1)
+      .setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID)).build()
+
+  private def leaveGroupRequest = new LeaveGroupRequest.Builder(
+    new LeaveGroupRequestData()
+      .setGroupId(group)
+      .setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID)).build()
 
   private def deleteGroupsRequest = new DeleteGroupsRequest.Builder(Set(group).asJava).build()
 
diff --git a/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala b/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
index ce334ce..f2cdd42 100644
--- a/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
+++ b/core/src/test/scala/unit/kafka/server/KafkaApisTest.scala
@@ -593,7 +593,7 @@ class KafkaApisTest {
         .setGroupId("test")
         .setMemberId("test")
         .setGroupInstanceId("instanceId")
-        .setGenerationid(1)
+        .setGenerationId(1)
     ))
     createKafkaApis(KAFKA_2_2_IV1).handleHeartbeatRequest(requestChannelRequest)
 
diff --git a/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala b/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
index 782f873..ddcee12 100644
--- a/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
+++ b/core/src/test/scala/unit/kafka/server/RequestQuotaTest.scala
@@ -300,10 +300,19 @@ class RequestQuotaTest extends BaseRequestTest {
           )
 
         case ApiKeys.HEARTBEAT =>
-          new HeartbeatRequest.Builder(new HeartbeatRequestData().setGroupId("test-group").setGenerationid(1).setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID))
+          new HeartbeatRequest.Builder(
+            new HeartbeatRequestData()
+              .setGroupId("test-group")
+              .setGenerationId(1)
+              .setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID)
+          )
 
         case ApiKeys.LEAVE_GROUP =>
-          new LeaveGroupRequest.Builder(new LeaveGroupRequestData().setGroupId("test-leave-group").setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID))
+          new LeaveGroupRequest.Builder(
+            new LeaveGroupRequestData()
+              .setGroupId("test-leave-group")
+              .setMemberId(JoinGroupRequest.UNKNOWN_MEMBER_ID)
+          )
 
         case ApiKeys.SYNC_GROUP =>
           new SyncGroupRequest.Builder(


Mime
View raw message