diff --git a/checkstyle/checkstyle.xml b/checkstyle/checkstyle.xml index 3adc446d207..25d6f2fd078 100644 --- a/checkstyle/checkstyle.xml +++ b/checkstyle/checkstyle.xml @@ -31,7 +31,9 @@ - + + + diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/KTable.java b/streams/src/main/java/org/apache/kafka/streams/kstream/KTable.java index cc5a52180ab..50d0595aed9 100644 --- a/streams/src/main/java/org/apache/kafka/streams/kstream/KTable.java +++ b/streams/src/main/java/org/apache/kafka/streams/kstream/KTable.java @@ -21,6 +21,7 @@ import org.apache.kafka.common.annotation.InterfaceStability; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.streams.KeyValue; import org.apache.kafka.streams.processor.StreamPartitioner; +import org.apache.kafka.clients.producer.internals.DefaultPartitioner; /** * {@link KTable} is an abstraction of a changelog stream from a primary-keyed table. @@ -114,7 +115,7 @@ public interface KTable { /** * Materialize this stream to a topic, also creates a new instance of {@link KTable} from the topic - * using default serializers and deserializers and producer's {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner}. + * using default serializers and deserializers and producer's {@link DefaultPartitioner}. * This is equivalent to calling {@link #to(String)} and {@link org.apache.kafka.streams.kstream.KStreamBuilder#table(String)}. * * @param topic the topic name @@ -129,7 +130,7 @@ public interface KTable { * This is equivalent to calling {@link #to(String)} and {@link org.apache.kafka.streams.kstream.KStreamBuilder#table(String)}. * * @param partitioner the function used to determine how records are distributed among partitions of the topic, - * if not specified producer's {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} will be used + * if not specified producer's {@link DefaultPartitioner} will be used * @param topic the topic name * * @return a new {@link KTable} that contains the exact same records as this {@link KTable} @@ -140,7 +141,7 @@ public interface KTable { * Materialize this stream to a topic, also creates a new instance of {@link KTable} from the topic. * If {@code keySerde} provides a {@link org.apache.kafka.streams.kstream.internals.WindowedSerializer} * for the key {@link org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner} is used - * — otherwise producer's {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} is used. + * — otherwise producer's {@link DefaultPartitioner} is used. * This is equivalent to calling {@link #to(Serde, Serde, String)} and * {@link org.apache.kafka.streams.kstream.KStreamBuilder#table(Serde, Serde, String)}. * @@ -167,7 +168,7 @@ public interface KTable { * @param partitioner the function used to determine how records are distributed among partitions of the topic, * if not specified and {@code keySerde} provides a {@link org.apache.kafka.streams.kstream.internals.WindowedSerializer} for the key * {@link org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner} will be used - * — otherwise {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} will be used + * — otherwise {@link DefaultPartitioner} will be used * @param topic the topic name * * @return a new {@link KTable} that contains the exact same records as this {@link KTable} @@ -176,7 +177,7 @@ public interface KTable { /** * Materialize this stream to a topic using default serializers specified in the config - * and producer's {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner}. + * and producer's {@link DefaultPartitioner}. * * @param topic the topic name */ @@ -187,7 +188,7 @@ public interface KTable { * and a customizable {@link StreamPartitioner} to determine the distribution of records to partitions. * * @param partitioner the function used to determine how records are distributed among partitions of the topic, - * if not specified producer's {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} will be used + * if not specified producer's {@link DefaultPartitioner} will be used * @param topic the topic name */ void to(StreamPartitioner partitioner, String topic); @@ -196,7 +197,7 @@ public interface KTable { * Materialize this stream to a topic. If {@code keySerde} provides a * {@link org.apache.kafka.streams.kstream.internals.WindowedSerializer} for the key * {@link org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner} is used - * — otherwise producer's {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} is used. + * — otherwise producer's {@link DefaultPartitioner} is used. * * @param keySerde key serde used to send key-value pairs, * if not specified the default serde defined in the configs will be used @@ -216,7 +217,7 @@ public interface KTable { * @param partitioner the function used to determine how records are distributed among partitions of the topic, * if not specified and {@code keySerde} provides a {@link org.apache.kafka.streams.kstream.internals.WindowedSerializer} for the key * {@link org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner} will be used - * — otherwise {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} will be used + * — otherwise {@link DefaultPartitioner} will be used * @param topic the topic name */ void to(Serde keySerde, Serde valSerde, StreamPartitioner partitioner, String topic); @@ -237,7 +238,6 @@ public interface KTable { * @param mapper @param mapper the instance of {@link KeyValueMapper} * @param the new key type * - * @return a {@link KStream} that contains records with new keys of different type for each update of this {@link KTable} * @return a {@link KStream} that contains the transformed records from this {@link KTable}; * the records are no longer treated as updates on a primary-keyed table, * but rather as normal key-value pairs in a record stream diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/StreamPartitioner.java b/streams/src/main/java/org/apache/kafka/streams/processor/StreamPartitioner.java index fbb037849bc..0c51c501187 100644 --- a/streams/src/main/java/org/apache/kafka/streams/processor/StreamPartitioner.java +++ b/streams/src/main/java/org/apache/kafka/streams/processor/StreamPartitioner.java @@ -16,9 +16,11 @@ */ package org.apache.kafka.streams.processor; +import org.apache.kafka.clients.producer.internals.DefaultPartitioner; + /** * Determine how records are distributed among the partitions in a Kafka topic. If not specified, the underlying producer's - * {@link org.apache.kafka.clients.producer.internals.DefaultPartitioner} will be used to determine the partition. + * {@link DefaultPartitioner} will be used to determine the partition. *

* Kafka topics are divided into one or more partitions. Since each partition must fit on the servers that host it, so * using multiple partitions allows the topic to scale beyond a size that will fit on a single machine. Partitions also enable you