boyuanzz commented on a change in pull request #11749:
URL: https://github.com/apache/beam/pull/11749#discussion_r467317077



##########
File path: 
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java
##########
@@ -1306,112 +1315,206 @@ public void populateDisplayData(DisplayData.Builder 
builder) {
       return 
toBuilder().setValueDeserializerProvider(deserializerProvider).build();
     }
 
+    /**
+     * Sets a Kafka {@link Deserializer} to interpret key bytes read from 
Kafka.
+     *
+     * <p>In addition, Beam also needs a {@link Coder} to serialize and 
deserialize key objects at
+     * runtime. KafkaIO tries to infer a coder for the key based on the {@link 
Deserializer} class,
+     * however in case that fails, you can use {@link 
#withKeyDeserializerAndCoder(Class, Coder)} to
+     * provide the key coder explicitly.
+     */
     public ReadSourceDescriptors<K, V> withKeyDeserializer(
         Class<? extends Deserializer<K>> keyDeserializer) {
       return 
withKeyDeserializerProvider(LocalDeserializerProvider.of(keyDeserializer));
     }
 
+    /**
+     * Sets a Kafka {@link Deserializer} for interpreting key bytes read from 
Kafka along with a

Review comment:
       Done, thanks!




----------------------------------------------------------------
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:
[email protected]


Reply via email to