mjsax commented on a change in pull request #10810:
URL: https://github.com/apache/kafka/pull/10810#discussion_r647122650



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/api/RecordMetadata.java
##########
@@ -16,19 +16,51 @@
  */
 package org.apache.kafka.streams.processor.api;
 
+import org.apache.kafka.streams.kstream.ValueTransformerWithKeySupplier;
+
 public interface RecordMetadata {
     /**
-     * @return  The topic of the original record received from Kafka
+     * Returns the topic name of the current input record; could be {@code 
null} if it is not
+     * available.

Review comment:
       @vvcephei Thinking about this more, could we guarantee that we never 
return `null` on those methods (and thus can keep the JavaDocs simple)? If we 
don't have metadata, `Optional<RecordMetadata>` should be empty to begin with 
(at least ideally)?
   
   But I was not sure given the current implementation. 
`AbstractProcessorContext` implement this method like
   ```
       @Override
       public Optional<RecordMetadata> recordMetadata() {
           return Optional.ofNullable(recordContext);
       }
   ``` 
   
   Or would `recordContext` be guaranteed to be `null` if the new API is used? 
(For this case, as `KTable#transformValues()` is using the "old" API, we might 
no need to document anything (or should we document it anyway, to be forward 
looking?




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


Reply via email to