You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/05/11 17:26:00 UTC

[jira] [Commented] (KAFKA-4849) Bug in KafkaStreams documentation

    [ https://issues.apache.org/jira/browse/KAFKA-4849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16472322#comment-16472322 ] 

ASF GitHub Bot commented on KAFKA-4849:
---------------------------------------

mjsax closed pull request #2648: KAFKA-4849: Bug in KafkaStreams documentation
URL: https://github.com/apache/kafka/pull/2648
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java b/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
index 3396f6369b5..91b7faa622a 100644
--- a/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
+++ b/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java
@@ -128,14 +128,36 @@ public ConfigDef define(ConfigKey key) {
      * @param displayName   the name suitable for display
      * @param dependents    the configurations that are dependents of this configuration
      * @param recommender   the recommender provides valid values given the parent configuration values
+     * @param deprecated    the config is deprecated and should not be used any longer
      * @return This ConfigDef so you can chain calls
      */
     public ConfigDef define(String name, Type type, Object defaultValue, Validator validator, Importance importance, String documentation,
-                            String group, int orderInGroup, Width width, String displayName, List<String> dependents, Recommender recommender) {
-        return define(new ConfigKey(name, type, defaultValue, validator, importance, documentation, group, orderInGroup, width, displayName, dependents, recommender));
+                            String group, int orderInGroup, Width width, String displayName, List<String> dependents, Recommender recommender, boolean deprecated) {
+        return define(new ConfigKey(name, type, defaultValue, validator, importance, documentation, group, orderInGroup, width, displayName, dependents, recommender, deprecated));
     }
 
     /**
+     * Define a new configuration
+     * @param name          the name of the config parameter
+     * @param type          the type of the config
+     * @param defaultValue  the default value to use if this config isn't present
+     * @param validator     the validator to use in checking the correctness of the config
+     * @param importance    the importance of this config
+     * @param documentation the documentation string for the config
+     * @param group         the group this config belongs to
+     * @param orderInGroup  the order of this config in the group
+     * @param width         the width of the config
+     * @param displayName   the name suitable for display
+     * @param dependents    the configurations that are dependents of this configuration
+     * @param recommender   the recommender provides valid values given the parent configuration values
+     * @return This ConfigDef so you can chain calls
+     */
+    public ConfigDef define(String name, Type type, Object defaultValue, Validator validator, Importance importance, String documentation,
+                            String group, int orderInGroup, Width width, String displayName, List<String> dependents, Recommender recommender) {
+        return define(new ConfigKey(name, type, defaultValue, validator, importance, documentation, group, orderInGroup, width, displayName, dependents, recommender, false));
+    }
+    /**
+     *
      * Define a new configuration with no custom recommender
      * @param name          the name of the config parameter
      * @param type          the type of the config
@@ -900,11 +922,12 @@ public String toString() {
         public final String displayName;
         public final List<String> dependents;
         public final Recommender recommender;
+        public final boolean deprecated;
 
         public ConfigKey(String name, Type type, Object defaultValue, Validator validator,
                          Importance importance, String documentation, String group,
                          int orderInGroup, Width width, String displayName,
-                         List<String> dependents, Recommender recommender) {
+                         List<String> dependents, Recommender recommender, boolean deprecated) {
             this.name = name;
             this.type = type;
             this.defaultValue = defaultValue == NO_DEFAULT_VALUE ? NO_DEFAULT_VALUE : parseType(name, defaultValue, type);
@@ -919,6 +942,7 @@ public ConfigKey(String name, Type type, Object defaultValue, Validator validato
             this.width = width;
             this.displayName = displayName;
             this.recommender = recommender;
+            this.deprecated = deprecated;
         }
 
         public boolean hasDefault() {
@@ -971,6 +995,9 @@ public String toHtmlTable() {
         }
         b.append("</tr>\n");
         for (ConfigKey key : configs) {
+            if (key.deprecated) {
+                continue;
+            }
             b.append("<tr>\n");
             // print column values
             for (String headerName : headers()) {
@@ -991,6 +1018,9 @@ public String toHtmlTable() {
     public String toRst() {
         StringBuilder b = new StringBuilder();
         for (ConfigKey key : sortedConfigs()) {
+            if (key.deprecated) {
+                continue;
+            }
             getConfigKeyRst(key, b);
             b.append("\n");
         }
@@ -1006,6 +1036,9 @@ public String toEnrichedRst() {
 
         String lastKeyGroupName = "";
         for (ConfigKey key : sortedConfigs()) {
+            if (key.deprecated) {
+                continue;
+            }
             if (key.group != null) {
                 if (!lastKeyGroupName.equalsIgnoreCase(key.group)) {
                     b.append(key.group).append("\n");
@@ -1114,7 +1147,8 @@ public void embed(final String keyPrefix, final String groupPrefix, final int st
                     key.width,
                     key.displayName,
                     embeddedDependents(keyPrefix, key.dependents),
-                    embeddedRecommender(keyPrefix, key.recommender)
+                    embeddedRecommender(keyPrefix, key.recommender),
+                    key.deprecated
             ));
         }
     }
diff --git a/docs/streams.html b/docs/streams.html
index 6461f867ad7..c203b8e4647 100644
--- a/docs/streams.html
+++ b/docs/streams.html
@@ -678,7 +678,6 @@ <h3><a id="streams_execute" href="#streams_execute">Application Configuration an
 // Set a few key parameters
 settings.put(StreamsConfig.APPLICATION_ID_CONFIG, "my-first-streams-application");
 settings.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka-broker1:9092");
-settings.put(StreamsConfig.ZOOKEEPER_CONNECT_CONFIG, "zookeeper1:2181");
 // Any further settings
 settings.put(... , ...);
 
diff --git a/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java b/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
index 0eb3f7b2481..50c887732e5 100644
--- a/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
+++ b/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
@@ -231,8 +231,16 @@
             .define(ZOOKEEPER_CONNECT_CONFIG,
                     Type.STRING,
                     "",
+                    null,
                     Importance.HIGH,
-                    ZOOKEEPER_CONNECT_DOC)
+                    ZOOKEEPER_CONNECT_DOC,
+                    null,
+                    -1,
+                    ConfigDef.Width.NONE,
+                    ZOOKEEPER_CONNECT_CONFIG,
+                    Collections.<String>emptyList(),
+                    null,
+                    true)
             .define(STATE_DIR_CONFIG,
                     Type.STRING,
                     "/tmp/kafka-streams",
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java b/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java
index 427054e8a94..513e8cbd036 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/Transformer.java
@@ -30,7 +30,7 @@
  * each record of a stream and can access and modify a state that is available beyond a single call of
  * {@link #transform(Object, Object)} (cf. {@link KeyValueMapper} for stateless record transformation).
  * Additionally, the interface can be called in regular intervals based on the processing progress
- * (cf. {@link #punctuate(long)}.
+ * (cf. {@link #punctuate(long)}).
  * <p>
  * Use {@link TransformerSupplier} to provide new instances of {@code Transformer} to Kafka Stream's runtime.
  * <p>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Bug in KafkaStreams documentation
> ---------------------------------
>
>                 Key: KAFKA-4849
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4849
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 0.10.2.0
>            Reporter: Seweryn Habdank-Wojewodzki
>            Assignee: Matthias J. Sax
>            Priority: Minor
>
> At the page: https://kafka.apache.org/documentation/streams
>  
> In the chapter titled Application Configuration and Execution, in the example there is a line:
>  
> settings.put(StreamsConfig.ZOOKEEPER_CONNECT_CONFIG, "zookeeper1:2181");
>  
> but ZOOKEEPER_CONNECT_CONFIG is deprecated in the Kafka version 0.10.2.0.
>  
> Also the table on the page: https://kafka.apache.org/0102/documentation/#streamsconfigs is a bit misleading.
> 1.     Again zookeeper.connect is deprecated.
> 2.     The client.id and zookeeper.connect are marked by high importance, 
> but according to http://docs.confluent.io/3.2.0/streams/developer-guide.html none of them are important to initialize the stream.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)