From 6b77b022e4ad1f83edb5c028be503a8cb3158742 Mon Sep 17 00:00:00 2001 From: Alan Lee Date: Wed, 9 Jul 2014 22:50:20 +0900 Subject: [PATCH 1/2] fixed javadoc build warnings --- .../consumer/ConsumerRebalanceCallback.java | 4 +- .../apache/kafka/common/network/Selectable.java | 8 +-- .../src/main/java/kafka/etl/Props.java | 73 ++++++++++------------ .../kafka/javaapi/consumer/ConsumerConnector.java | 3 +- 4 files changed, 42 insertions(+), 46 deletions(-) diff --git a/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceCallback.java b/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceCallback.java index 05eb6ce..f026ae4 100644 --- a/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceCallback.java +++ b/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerRebalanceCallback.java @@ -21,8 +21,8 @@ import org.apache.kafka.common.TopicPartition; * every rebalance operation. This callback will execute in the user thread as part of the * {@link Consumer#poll(long) poll(long)} API on every rebalance attempt. * Default implementation of the callback will {@link Consumer#seek(java.util.Map) seek(offsets)} to the last committed offsets in the - * {@link #onPartitionsAssigned(Consumer, TopicPartition...) onPartitionsAssigned()} callback. And will commit offsets synchronously - * for the specified list of partitions to Kafka in the {@link #onPartitionsRevoked(Consumer, TopicPartition...) onPartitionsRevoked()} + * {@link #onPartitionsAssigned(Consumer, Collection) onPartitionsAssigned()} callback. And will commit offsets synchronously + * for the specified list of partitions to Kafka in the {@link #onPartitionsRevoked(Consumer, Collection) onPartitionsRevoked()} * callback. */ public interface ConsumerRebalanceCallback { diff --git a/clients/src/main/java/org/apache/kafka/common/network/Selectable.java b/clients/src/main/java/org/apache/kafka/common/network/Selectable.java index cef75d8..b68bbf0 100644 --- a/clients/src/main/java/org/apache/kafka/common/network/Selectable.java +++ b/clients/src/main/java/org/apache/kafka/common/network/Selectable.java @@ -60,23 +60,23 @@ public interface Selectable { public void poll(long timeout, List sends) throws IOException; /** - * The list of sends that completed on the last {@link #poll(long, List) poll()} call. + * The list of sends that completed on the last {@link #poll(long, List) poll()} call. */ public List completedSends(); /** - * The list of receives that completed on the last {@link #poll(long, List) poll()} call. + * The list of receives that completed on the last {@link #poll(long, List) poll()} call. */ public List completedReceives(); /** - * The list of connections that finished disconnecting on the last {@link #poll(long, List) poll()} + * The list of connections that finished disconnecting on the last {@link #poll(long, List) poll()} * call. */ public List disconnected(); /** - * The list of connections that completed their connection on the last {@link #poll(long, List) poll()} + * The list of connections that completed their connection on the last {@link #poll(long, List) poll()} * call. */ public List connected(); diff --git a/contrib/hadoop-consumer/src/main/java/kafka/etl/Props.java b/contrib/hadoop-consumer/src/main/java/kafka/etl/Props.java index 3514ec7..71eb80f 100644 --- a/contrib/hadoop-consumer/src/main/java/kafka/etl/Props.java +++ b/contrib/hadoop-consumer/src/main/java/kafka/etl/Props.java @@ -115,11 +115,11 @@ public class Props extends Properties { } /** - * build props from a list of strings and interprate them as + * build props from a list of strings and interpret them as * key, value, key, value,.... * * @param args - * @return + * @return props */ @SuppressWarnings("unchecked") public static Props of(String... args) { @@ -148,7 +148,7 @@ public class Props extends Properties { /** * get property of "key" and split the value by " ," * @param key - * @return + * @return list of values */ public List getStringList(String key) { return getStringList(key, "\\s*,\\s*"); @@ -158,7 +158,7 @@ public class Props extends Properties { * get property of "key" and split the value by "sep" * @param key * @param sep - * @return + * @return string list of values */ public List getStringList(String key, String sep) { String val = super.getProperty(key); @@ -176,7 +176,7 @@ public class Props extends Properties { * get string list with default value. default delimiter is "," * @param key * @param defaultValue - * @return + * @return string list of values */ public List getStringList(String key, List defaultValue) { if (containsKey(key)) @@ -189,7 +189,7 @@ public class Props extends Properties { * get string list with default value * @param key * @param defaultValue - * @return + * @return string list of values */ public List getStringList(String key, List defaultValue, String sep) { @@ -251,10 +251,10 @@ public class Props extends Properties { } /** - * get boolean value + * get boolean value with default value * @param key * @param defaultValue - * @return + * @return boolean value * @throws Exception if value is not of type boolean or string */ public Boolean getBoolean(String key, Boolean defaultValue) @@ -265,8 +265,7 @@ public class Props extends Properties { /** * get boolean value * @param key - * @param defaultValue - * @return + * @return boolean value * @throws Exception if value is not of type boolean or string or * if value doesn't exist */ @@ -275,10 +274,10 @@ public class Props extends Properties { } /** - * get long value - * @param key + * get long value with default value + * @param name * @param defaultValue - * @return + * @return long value * @throws Exception if value is not of type long or string */ public Long getLong(String name, Long defaultValue) @@ -288,9 +287,8 @@ public class Props extends Properties { /** * get long value - * @param key - * @param defaultValue - * @return + * @param name + * @return long value * @throws Exception if value is not of type long or string or * if value doesn't exist */ @@ -299,10 +297,10 @@ public class Props extends Properties { } /** - * get integer value - * @param key + * get integer value with default value + * @param name * @param defaultValue - * @return + * @return integer value * @throws Exception if value is not of type integer or string */ public Integer getInt(String name, Integer defaultValue) @@ -312,9 +310,8 @@ public class Props extends Properties { /** * get integer value - * @param key - * @param defaultValue - * @return + * @param name + * @return integer value * @throws Exception if value is not of type integer or string or * if value doesn't exist */ @@ -323,10 +320,10 @@ public class Props extends Properties { } /** - * get double value - * @param key + * get double value with default value + * @param name * @param defaultValue - * @return + * @return double value * @throws Exception if value is not of type double or string */ public Double getDouble(String name, double defaultValue) @@ -336,9 +333,8 @@ public class Props extends Properties { /** * get double value - * @param key - * @param defaultValue - * @return + * @param name + * @return double value * @throws Exception if value is not of type double or string or * if value doesn't exist */ @@ -347,10 +343,10 @@ public class Props extends Properties { } /** - * get URI value - * @param key + * get URI value with default value + * @param name * @param defaultValue - * @return + * @return URI value * @throws Exception if value is not of type URI or string */ public URI getUri(String name, URI defaultValue) throws Exception { @@ -359,9 +355,9 @@ public class Props extends Properties { /** * get URI value - * @param key + * @param name * @param defaultValue - * @return + * @return URI value * @throws Exception if value is not of type URI or string */ public URI getUri(String name, String defaultValue) @@ -372,9 +368,8 @@ public class Props extends Properties { /** * get URI value - * @param key - * @param defaultValue - * @return + * @param name + * @return URI value * @throws Exception if value is not of type URI or string or * if value doesn't exist */ @@ -385,7 +380,7 @@ public class Props extends Properties { /** * compare two props * @param p - * @return + * @return true or false */ public boolean equalsProps(Props p) { if (p == null) { @@ -432,7 +427,7 @@ public class Props extends Properties { /** * get all property names - * @return + * @return set of property names */ public Set getKeySet() { return super.stringPropertyNames(); @@ -453,7 +448,7 @@ public class Props extends Properties { /** * clone a Props * @param p - * @return + * @return props */ public static Props clone(Props p) { return new Props(p); diff --git a/core/src/main/scala/kafka/javaapi/consumer/ConsumerConnector.java b/core/src/main/scala/kafka/javaapi/consumer/ConsumerConnector.java index 44d3d35..cc3400f 100644 --- a/core/src/main/scala/kafka/javaapi/consumer/ConsumerConnector.java +++ b/core/src/main/scala/kafka/javaapi/consumer/ConsumerConnector.java @@ -29,7 +29,8 @@ public interface ConsumerConnector { * Create a list of MessageStreams of type T for each topic. * * @param topicCountMap a map of (topic, #streams) pair - * @param decoder a decoder that converts from Message to T + * @param keyDecoder a decoder that decodes the message key + * @param valueDecoder a decoder that decodes the message itself * @return a map of (topic, list of KafkaStream) pairs. * The number of items in the list is #streams. Each stream supports * an iterator over message/metadata pairs. -- 1.8.5.2 (Apple Git-48) From 693306dde1f3290c0f0a73b405bd2d495907bb25 Mon Sep 17 00:00:00 2001 From: Alan Lee Date: Wed, 9 Jul 2014 23:19:12 +0900 Subject: [PATCH 2/2] fixed scaladoc build warnings --- core/src/main/scala/kafka/log/OffsetIndex.scala | 2 +- core/src/main/scala/kafka/utils/Utils.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/kafka/log/OffsetIndex.scala b/core/src/main/scala/kafka/log/OffsetIndex.scala index 8a62dfa..1c4c7bd 100644 --- a/core/src/main/scala/kafka/log/OffsetIndex.scala +++ b/core/src/main/scala/kafka/log/OffsetIndex.scala @@ -346,7 +346,7 @@ class OffsetIndex(@volatile var file: File, val baseOffset: Long, val maxIndexSi /** * Do a basic sanity check on this index to detect obvious problems - * @throw IllegalArgumentException if any problems are found + * @throws IllegalArgumentException if any problems are found */ def sanityCheck() { require(entries == 0 || lastOffset > baseOffset, diff --git a/core/src/main/scala/kafka/utils/Utils.scala b/core/src/main/scala/kafka/utils/Utils.scala index b29981b..63d3dda 100644 --- a/core/src/main/scala/kafka/utils/Utils.scala +++ b/core/src/main/scala/kafka/utils/Utils.scala @@ -494,7 +494,7 @@ object Utils extends Logging { /** * Create a file with the given path * @param path The path to create - * @throw KafkaStorageException If the file create fails + * @throws KafkaStorageException If the file create fails * @return The created file */ def createFile(path: String): File = { -- 1.8.5.2 (Apple Git-48)