noob-se7en commented on code in PR #16572:
URL: https://github.com/apache/pinot/pull/16572#discussion_r2287729767


##########
pinot-plugins/pinot-stream-ingestion/pinot-kafka-2.0/src/main/java/org/apache/pinot/plugin/stream/kafka20/KafkaPartitionLevelConsumer.java:
##########
@@ -82,6 +83,7 @@ public synchronized KafkaMessageBatch 
fetchMessages(StreamPartitionMsgOffset sta
           String key = record.key();
           byte[] keyBytes = key != null ? key.getBytes(StandardCharsets.UTF_8) 
: null;
           filteredRecords.add(new BytesStreamMessage(keyBytes, message.get(), 
messageMetadata));
+          batchSizeInBytes += messageMetadata.getRecordSerializedSize();

Review Comment:
   > is byte level rate limiting done based on serialized size of the message 
batch ?
   
   Yes. Libraries only expose the serialized record size. For example for Kafka 
org.apache.kafka.clients.consumer.ConsumerRecord there is only below method 
which is useful for recording the size:
   
      ```
    /**
        * The size of the serialized, uncompressed value in bytes. If value is 
null, the
        * returned size is -1.
        */
       public int serializedValueSize() {
           return this.serializedValueSize;
       }
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to