You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ab...@apache.org on 2023/01/20 22:19:20 UTC

[kafka] branch trunk updated: MINOR: fix warnings in Streams javadocs (#13132)

This is an automated email from the ASF dual-hosted git repository.

ableegoldman pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 123e0e9ca9e MINOR: fix warnings in Streams javadocs (#13132)
123e0e9ca9e is described below

commit 123e0e9ca9e9e23709cf59b83b01c8ae885c5f43
Author: A. Sophie Blee-Goldman <so...@confluent.io>
AuthorDate: Fri Jan 20 14:19:11 2023 -0800

    MINOR: fix warnings in Streams javadocs (#13132)
    
    While working on the 3.4 release I noticed we've built up an embarrassingly long list of warnings within the Streams javadocs. It's unavoidable for some links to break as the source code changes, but let's reset back to a good state before the list gets even longer
    
    Reviewers: Matthias J. Sax <mj...@apache.org>, Walker Carlson <wc...@confluent.io>
---
 .../src/main/java/org/apache/kafka/streams/TopologyConfig.java    | 2 +-
 .../main/java/org/apache/kafka/streams/TopologyDescription.java   | 4 +++-
 .../src/main/java/org/apache/kafka/streams/kstream/KStream.java   | 8 ++++----
 .../src/main/java/org/apache/kafka/streams/kstream/Produced.java  | 7 ++++---
 .../main/java/org/apache/kafka/streams/kstream/Repartitioned.java | 5 +++--
 .../org/apache/kafka/streams/processor/StreamPartitioner.java     | 2 +-
 .../src/main/java/org/apache/kafka/streams/query/Position.java    | 2 +-
 .../src/main/java/org/apache/kafka/streams/query/QueryResult.java | 6 +++---
 8 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/streams/src/main/java/org/apache/kafka/streams/TopologyConfig.java b/streams/src/main/java/org/apache/kafka/streams/TopologyConfig.java
index 8979d704cfb..61c1b0bf7a1 100644
--- a/streams/src/main/java/org/apache/kafka/streams/TopologyConfig.java
+++ b/streams/src/main/java/org/apache/kafka/streams/TopologyConfig.java
@@ -56,7 +56,7 @@ import static org.apache.kafka.streams.internals.StreamsConfigUtils.getTotalCach
  * Streams configs that apply at the topology level. The values in the {@link StreamsConfig} parameter of the
  * {@link org.apache.kafka.streams.KafkaStreams} or {@link KafkaStreamsNamedTopologyWrapper} constructors will
  * determine the defaults, which can then be overridden for specific topologies by passing them in when creating the
- * topology builders via the {@link org.apache.kafka.streams.StreamsBuilder()} method.
+ * topology builders via the {@link org.apache.kafka.streams.StreamsBuilder#StreamsBuilder(TopologyConfig)} StreamsBuilder(TopologyConfig)} method.
  */
 @SuppressWarnings("deprecation")
 public class TopologyConfig extends AbstractConfig {
diff --git a/streams/src/main/java/org/apache/kafka/streams/TopologyDescription.java b/streams/src/main/java/org/apache/kafka/streams/TopologyDescription.java
index deea3a465cd..242b9e3e009 100644
--- a/streams/src/main/java/org/apache/kafka/streams/TopologyDescription.java
+++ b/streams/src/main/java/org/apache/kafka/streams/TopologyDescription.java
@@ -17,7 +17,9 @@
 package org.apache.kafka.streams;
 
 import org.apache.kafka.streams.processor.TopicNameExtractor;
+import org.apache.kafka.streams.processor.api.ProcessorContext;
 import org.apache.kafka.streams.processor.api.ProcessorSupplier;
+import org.apache.kafka.streams.processor.api.Record;
 import org.apache.kafka.streams.processor.internals.StreamTask;
 
 import java.util.Set;
@@ -30,7 +32,7 @@ import java.util.regex.Pattern;
  * In contrast, two sub-topologies are not connected but can be linked to each other via topics, i.e., if one
  * sub-topology {@link Topology#addSink(String, String, String...) writes} into a topic and another sub-topology
  * {@link Topology#addSource(String, String...) reads} from the same topic.
- * Message {@link ProcessorContext#forward(Object, Object) forwards} using custom Processors and Transformers are not considered in the topology graph.
+ * Message {@link ProcessorContext#forward(Record, String)} forwards} using custom Processors and Transformers are not considered in the topology graph.
  * <p>
  * When {@link KafkaStreams#start()} is called, different sub-topologies will be constructed and executed as independent
  * {@link StreamTask tasks}.
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java b/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
index 33f0892a6f4..445e9a171bc 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java
@@ -836,7 +836,7 @@ public interface KStream<K, V> {
 
     /**
      * Materialize this stream to a topic and creates a new {@code KStream} from the topic using default serializers,
-     * deserializers, and producer's {@link DefaultPartitioner}.
+     * deserializers, and producer's default partitioning strategy.
      * The specified topic should be manually created before it is used (i.e., before the Kafka Streams application is
      * started).
      * <p>
@@ -876,7 +876,7 @@ public interface KStream<K, V> {
 
     /**
      * Materialize this stream to an auto-generated repartition topic and create a new {@code KStream}
-     * from the auto-generated topic using default serializers, deserializers, and producer's {@link DefaultPartitioner}.
+     * from the auto-generated topic using default serializers, deserializers, and producer's default partitioning strategy.
      * The number of partitions is determined based on the upstream topics partition numbers.
      * <p>
      * The created topic is considered as an internal topic and is meant to be used only by the current Kafka Streams instance.
@@ -910,7 +910,7 @@ public interface KStream<K, V> {
 
     /**
      * Materialize this stream to a topic using default serializers specified in the config and producer's
-     * {@link DefaultPartitioner}.
+     * default partitioning strategy.
      * The specified topic should be manually created before it is used (i.e., before the Kafka Streams application is
      * started).
      *
@@ -931,7 +931,7 @@ public interface KStream<K, V> {
 
     /**
      * Dynamically materialize this stream to topics using default serializers specified in the config and producer's
-     * {@link DefaultPartitioner}.
+     * default partitioning strategy.
      * The topic names for each record to send to is dynamically determined based on the {@link TopicNameExtractor}.
      *
      * @param topicExtractor    the extractor to determine the name of the Kafka topic to write to for each record
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/Produced.java b/streams/src/main/java/org/apache/kafka/streams/kstream/Produced.java
index 7848c2db874..1168daca78d 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/Produced.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/Produced.java
@@ -20,6 +20,7 @@ import org.apache.kafka.common.serialization.Serde;
 import org.apache.kafka.streams.kstream.internals.WindowedSerializer;
 import org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner;
 import org.apache.kafka.streams.processor.StreamPartitioner;
+import org.apache.kafka.streams.processor.internals.DefaultStreamPartitioner;
 
 import java.util.Objects;
 
@@ -74,7 +75,7 @@ public class Produced<K, V> implements NamedOperation<Produced<K, V>> {
      * @param valueSerde    Serde to use for serializing the value
      * @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 WindowedSerializer} for the key
-     *                      {@link WindowedStreamPartitioner} will be used&mdash;otherwise {@link DefaultPartitioner}
+     *                      {@link WindowedStreamPartitioner} will be used&mdash;otherwise {@link DefaultStreamPartitioner}
      *                      will be used
      * @param <K>           key type
      * @param <V>           value type
@@ -127,7 +128,7 @@ public class Produced<K, V> implements NamedOperation<Produced<K, V>> {
      * Create a Produced instance with provided partitioner.
      * @param partitioner   the function used to determine how records are distributed among partitions of the topic,
      *                      if not specified and the key serde provides a {@link WindowedSerializer} for the key
-     *                      {@link WindowedStreamPartitioner} will be used&mdash;otherwise {@link DefaultPartitioner} will be used
+     *                      {@link WindowedStreamPartitioner} will be used&mdash;otherwise {@link DefaultStreamPartitioner} will be used
      * @param <K>           key type
      * @param <V>           value type
      * @return  A new {@link Produced} instance configured with partitioner
@@ -141,7 +142,7 @@ public class Produced<K, V> implements NamedOperation<Produced<K, V>> {
      * Produce records using the provided partitioner.
      * @param partitioner   the function used to determine how records are distributed among partitions of the topic,
      *                      if not specified and the key serde provides a {@link WindowedSerializer} for the key
-     *                      {@link WindowedStreamPartitioner} will be used&mdash;otherwise {@link DefaultPartitioner} wil be used
+     *                      {@link WindowedStreamPartitioner} will be used&mdash;otherwise {@link DefaultStreamPartitioner} wil be used
      * @return this
      */
     public Produced<K, V> withStreamPartitioner(final StreamPartitioner<? super K, ? super V> partitioner) {
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/Repartitioned.java b/streams/src/main/java/org/apache/kafka/streams/kstream/Repartitioned.java
index 929b14ab290..2f8aab3d68b 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/Repartitioned.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/Repartitioned.java
@@ -20,6 +20,7 @@ import org.apache.kafka.common.serialization.Serde;
 import org.apache.kafka.streams.kstream.internals.WindowedSerializer;
 import org.apache.kafka.streams.kstream.internals.WindowedStreamPartitioner;
 import org.apache.kafka.streams.processor.StreamPartitioner;
+import org.apache.kafka.streams.processor.internals.DefaultStreamPartitioner;
 
 /**
  * This class is used to provide the optional parameters for internal repartition topics.
@@ -92,7 +93,7 @@ public class Repartitioned<K, V> implements NamedOperation<Repartitioned<K, V>>
      *
      * @param partitioner the function used to determine how records are distributed among partitions of the topic,
      *                    if not specified and the key serde provides a {@link WindowedSerializer} for the key
-     *                    {@link WindowedStreamPartitioner} will be used—otherwise {@link DefaultPartitioner} will be used
+     *                    {@link WindowedStreamPartitioner} will be used—otherwise {@link DefaultStreamPartitioner} will be used
      * @param <K>         key type
      * @param <V>         value type
      * @return A new {@code Repartitioned} instance configured with partitioner
@@ -161,7 +162,7 @@ public class Repartitioned<K, V> implements NamedOperation<Repartitioned<K, V>>
      *
      * @param partitioner the function used to determine how records are distributed among partitions of the topic,
      *                    if not specified and the key serde provides a {@link WindowedSerializer} for the key
-     *                    {@link WindowedStreamPartitioner} will be used—otherwise {@link DefaultPartitioner} wil be used
+     *                    {@link WindowedStreamPartitioner} will be used—otherwise {@link DefaultStreamPartitioner} wil be used
      * @return a new {@code Repartitioned} instance configured with provided partitioner
      */
     public Repartitioned<K, V> withStreamPartitioner(final StreamPartitioner<K, V> partitioner) {
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 b4c2483db7d..cc2fe7a5874 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
@@ -24,7 +24,7 @@ import java.util.Set;
 
 /**
  * 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.
+ * default partitioning strategy will be used to determine the partition.
  * <p>
  * Kafka topics are divided into one or more <i>partitions</i>. 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
diff --git a/streams/src/main/java/org/apache/kafka/streams/query/Position.java b/streams/src/main/java/org/apache/kafka/streams/query/Position.java
index 52ceb23dc3e..c4814565110 100644
--- a/streams/src/main/java/org/apache/kafka/streams/query/Position.java
+++ b/streams/src/main/java/org/apache/kafka/streams/query/Position.java
@@ -36,7 +36,7 @@ import java.util.concurrent.ConcurrentHashMap;
  * This class is threadsafe, although it is mutable. Readers are recommended to use {@link
  * Position#copy()} to avoid seeing mutations to the Position after they get the reference. For
  * examples, when a store executes a {@link org.apache.kafka.streams.processor.StateStore#query(Query,
- * PositionBound, boolean)} request and returns its current position via {@link
+ * PositionBound, QueryConfig)} request and returns its current position via {@link
  * QueryResult#setPosition(Position)}, it should pass a copy of its position instead of the mutable
  * reference.
  */
diff --git a/streams/src/main/java/org/apache/kafka/streams/query/QueryResult.java b/streams/src/main/java/org/apache/kafka/streams/query/QueryResult.java
index 045077609d4..28871f81e4f 100644
--- a/streams/src/main/java/org/apache/kafka/streams/query/QueryResult.java
+++ b/streams/src/main/java/org/apache/kafka/streams/query/QueryResult.java
@@ -104,14 +104,14 @@ public interface QueryResult<R> {
 
     /**
      * True iff the query was successfully executed. The response is available in {@link
-     * this#getResult()}.
+     * #getResult()}.
      */
     boolean isSuccess();
 
 
     /**
      * True iff the query execution failed. More information about the failure is available in
-     * {@link this#getFailureReason()} and {@link this#getFailureMessage()}.
+     * {@link #getFailureReason()} and {@link #getFailureMessage()}.
      */
     boolean isFailure();
 
@@ -146,7 +146,7 @@ public interface QueryResult<R> {
     /**
      * Returns the result of executing the query on one partition. The result type is determined by
      * the query. Note: queries may choose to return {@code null} for a successful query, so {@link
-     * this#isSuccess()} and {@link this#isFailure()} must be used to determine whether the query
+     * #isSuccess()} and {@link #isFailure()} must be used to determine whether the query
      * was successful of failed on this partition.
      *
      * @throws IllegalArgumentException if this is not a successful query.