You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@samza.apache.org by GitBox <gi...@apache.org> on 2019/03/11 17:53:20 UTC

[GitHub] [samza] prateekm commented on a change in pull request #947: SAMZA-2120: Enable custom handling of ConsumerRecords consumed by Kafka

prateekm commented on a change in pull request #947: SAMZA-2120: Enable custom handling of ConsumerRecords consumed by Kafka
URL: https://github.com/apache/samza/pull/947#discussion_r264352847
 
 

 ##########
 File path: samza-kafka/src/main/scala/org/apache/samza/system/kafka/KafkaConsumerProxy.java
 ##########
 @@ -328,9 +326,21 @@ private void fetchMessages() {
     return results;
   }
 
-  private int getRecordSize(ConsumerRecord<K, V> r) {
-    int keySize = (r.key() == null) ? 0 : r.serializedKeySize();
-    return keySize + r.serializedValueSize();
+  /**
+   * Convert a {@link ConsumerRecord} to an {@link IncomingMessageEnvelope}.
+   *
+   * This has a protected visibility so that {@link KafkaConsumerProxy} can be extended to add special handling logic
+   * for custom Kafka systems.
+   *
+   * @param consumerRecord {@link ConsumerRecord} from Kafka that was consumed
+   * @param systemStreamPartition {@link SystemStreamPartition} corresponding to the record
+   * @return {@link IncomingMessageEnvelope} corresponding to the {@code consumerRecord}
+   */
+  protected IncomingMessageEnvelope handleNewRecord(ConsumerRecord<K, V> consumerRecord,
 
 Review comment:
   Maybe: 'toIME'?

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


With regards,
Apache Git Services