You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2020/09/28 04:05:21 UTC

[kafka] branch trunk updated: MINOR: Update the javadoc in GroupMetadataManager.scala (#9241)

This is an automated email from the ASF dual-hosted git repository.

guozhang 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 4216123  MINOR: Update the javadoc in GroupMetadataManager.scala (#9241)
4216123 is described below

commit 42161236285865755f05ad698da28d3d22ff0697
Author: Luke Chen <43...@users.noreply.github.com>
AuthorDate: Mon Sep 28 12:04:31 2020 +0800

    MINOR: Update the javadoc in GroupMetadataManager.scala (#9241)
    
    Reviewers: Guozhang Wang <wa...@gmail.com>
---
 .../kafka/coordinator/group/GroupMetadataManager.scala     | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala b/core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala
index cd78d44..d733f34 100644
--- a/core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala
+++ b/core/src/main/scala/kafka/coordinator/group/GroupMetadataManager.scala
@@ -1169,11 +1169,13 @@ object GroupMetadataManager {
   /**
    * Generates the key for offset commit message for given (group, topic, partition)
    *
+   * @param groupId the ID of the group to generate the key
+   * @param topicPartition the TopicPartition to generate the key
    * @return key for offset commit message
    */
-  def offsetCommitKey(group: String, topicPartition: TopicPartition): Array[Byte] = {
+  def offsetCommitKey(groupId: String, topicPartition: TopicPartition): Array[Byte] = {
     val key = new Struct(CURRENT_OFFSET_KEY_SCHEMA)
-    key.set(OFFSET_KEY_GROUP_FIELD, group)
+    key.set(OFFSET_KEY_GROUP_FIELD, groupId)
     key.set(OFFSET_KEY_TOPIC_FIELD, topicPartition.topic)
     key.set(OFFSET_KEY_PARTITION_FIELD, topicPartition.partition)
 
@@ -1186,11 +1188,12 @@ object GroupMetadataManager {
   /**
    * Generates the key for group metadata message for given group
    *
+   * @param groupId the ID of the group to generate the key
    * @return key bytes for group metadata message
    */
-  def groupMetadataKey(group: String): Array[Byte] = {
+  def groupMetadataKey(groupId: String): Array[Byte] = {
     val key = new Struct(CURRENT_GROUP_KEY_SCHEMA)
-    key.set(GROUP_KEY_GROUP_FIELD, group)
+    key.set(GROUP_KEY_GROUP_FIELD, groupId)
 
     val byteBuffer = ByteBuffer.allocate(2 /* version */ + key.sizeOf)
     byteBuffer.putShort(CURRENT_GROUP_KEY_SCHEMA_VERSION)
@@ -1314,7 +1317,7 @@ object GroupMetadataManager {
    * Decodes the offset messages' key
    *
    * @param buffer input byte-buffer
-   * @return an GroupTopicPartition object
+   * @return an OffsetKey or GroupMetadataKey object from the message
    */
   def readMessageKey(buffer: ByteBuffer): BaseKey = {
     val version = buffer.getShort
@@ -1392,6 +1395,7 @@ object GroupMetadataManager {
   /**
    * Decodes the group metadata messages' payload and retrieves its member metadata from it
    *
+   * @param groupId The ID of the group to be read
    * @param buffer input byte-buffer
    * @param time the time instance to use
    * @return a group metadata object from the message