MINOR: Add connector configs to site-docs

In AK's documentation, the config props for connectors are not listed (https://kafka.apache.org/documentation/#connectconfigs). This PR adds these sink and source connector configs to the html site-docs.

Signed-off-by: Arjun Satish <arjunconfluent.io>

Author: Arjun Satish <arjun@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #5469 from wicknicks/add-connector-configs-to-docs
This commit is contained in:
Arjun Satish 2018-08-07 14:34:27 -07:00 committed by Ewen Cheslack-Postava
parent 36a8fec0ab
commit e876c921b0
6 changed files with 49 additions and 0 deletions

View File

@ -709,6 +709,7 @@ project(':core') {
'genAdminClientConfigDocs', 'genProducerConfigDocs', 'genConsumerConfigDocs',
'genKafkaConfigDocs', 'genTopicConfigDocs',
':connect:runtime:genConnectConfigDocs', ':connect:runtime:genConnectTransformationDocs',
':connect:runtime:genSinkConnectorConfigDocs', ':connect:runtime:genSourceConnectorConfigDocs',
':streams:genStreamsConfigDocs', 'genConsumerMetricsDocs', 'genProducerMetricsDocs',
':connect:runtime:genConnectMetricsDocs'], type: Tar) {
classifier = 'site-docs'
@ -1407,6 +1408,20 @@ project(':connect:runtime') {
standardOutput = new File(generatedDocsDir, "connect_config.html").newOutputStream()
}
task genSinkConnectorConfigDocs(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.apache.kafka.connect.runtime.SinkConnectorConfig'
if( !generatedDocsDir.exists() ) { generatedDocsDir.mkdirs() }
standardOutput = new File(generatedDocsDir, "sink_connector_config.html").newOutputStream()
}
task genSourceConnectorConfigDocs(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.apache.kafka.connect.runtime.SourceConnectorConfig'
if( !generatedDocsDir.exists() ) { generatedDocsDir.mkdirs() }
standardOutput = new File(generatedDocsDir, "source_connector_config.html").newOutputStream()
}
task genConnectTransformationDocs(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'org.apache.kafka.connect.tools.TransformationDoc'

View File

@ -973,6 +973,19 @@ public class ConfigDef {
validator.ensureValid(name, value);
}
}
@Override
public String toString() {
if (validators == null) return "";
StringBuilder desc = new StringBuilder();
for (Validator v: validators) {
if (desc.length() > 0) {
desc.append(',').append(' ');
}
desc.append(String.valueOf(v));
}
return desc.toString();
}
}
public static class NonEmptyString implements Validator {

View File

@ -169,6 +169,11 @@ public class ConnectorConfig extends AbstractConfig {
throw new ConfigException(name, value, "Duplicate alias provided.");
}
}
@Override
public String toString() {
return "unique transformation aliases";
}
}), Importance.LOW, TRANSFORMS_DOC, TRANSFORMS_GROUP, ++orderInGroup, Width.LONG, TRANSFORMS_DISPLAY)
.define(CONFIG_RELOAD_ACTION_CONFIG, Type.STRING, CONFIG_RELOAD_ACTION_RESTART,
in(CONFIG_RELOAD_ACTION_NONE, CONFIG_RELOAD_ACTION_RESTART), Importance.LOW,

View File

@ -119,4 +119,8 @@ public class SinkConnectorConfig extends ConnectorConfig {
public boolean isDlqContextHeadersEnabled() {
return getBoolean(DLQ_CONTEXT_HEADERS_ENABLE_CONFIG);
}
public static void main(String[] args) {
System.out.println(config.toHtmlTable());
}
}

View File

@ -32,4 +32,8 @@ public class SourceConnectorConfig extends ConnectorConfig {
public SourceConnectorConfig(Plugins plugins, Map<String, String> props) {
super(plugins, config, props);
}
public static void main(String[] args) {
System.out.println(config.toHtmlTable());
}
}

View File

@ -440,6 +440,14 @@
Below is the configuration of the Kafka Connect framework.
<!--#include virtual="generated/connect_config.html" -->
<h4><a id="sourceconnectconfigs" href="#sourceconnectconfigs">3.5.1 Source Connector Configs</a></h4>
Below is the configuration of a source connector.
<!--#include virtual="generated/source_connector_config.html" -->
<h4><a id="sinkconnectconfigs" href="#sinkconnectconfigs">3.5.2 Sink Connector Configs</a></h4>
Below is the configuration of a sink connector.
<!--#include virtual="generated/sink_connector_config.html" -->
<h3><a id="streamsconfigs" href="#streamsconfigs">3.6 Kafka Streams Configs</a></h3>
Below is the configuration of the Kafka Streams client library.
<!--#include virtual="generated/streams_config.html" -->