C0urante commented on code in PR #13658:
URL: https://github.com/apache/kafka/pull/13658#discussion_r1245804801


##########
docs/configuration.html:
##########
@@ -267,23 +267,31 @@ <h3 class="anchor-heading"><a id="adminclientconfigs" 
class="anchor-link"></a><a
   Below is the configuration of the Kafka Admin client library.
   <!--#include virtual="generated/admin_client_config.html" -->
 
-  <h3 class="anchor-heading"><a id="systemproperties" 
class="anchor-link"></a><a href="#systemproperties">3.8 System 
Properties</a></h3>
+
+  <h3 class="anchor-heading"><a id="mirrormakerconfigs" 
class="anchor-link"></a><a href="#mirrormakerconfigs">3.8 MirrorMaker 
Configs</a></h3>
+  Below is the configuration of MirrorMaker.

Review Comment:
   Nit:
   ```suggestion
     Below is the configuration of the connectors that make up MirrorMaker 2.
   ```



##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorHeartbeatConfig.java:
##########
@@ -57,7 +59,7 @@ short heartbeatsTopicReplicationFactor() {
         return getShort(HEARTBEATS_TOPIC_REPLICATION_FACTOR);
     }
 
-    protected static final ConfigDef CONNECTOR_CONFIG_DEF = new 
ConfigDef(BASE_CONNECTOR_CONFIG_DEF)
+    protected static final ConfigDef HEARTBEAT_CONFIG_DEF = new ConfigDef()

Review Comment:
   I think we can get away without introducing a utility method to merge 
`ConfigDefs` by replacing this constant (and others like it) with a method that 
adds the connector-specific configuration properties to an existing `ConfigDef`:
   
   ```java
       private static ConfigDef defineHeartbeatConfig(ConfigDef baseConfig) {
           return baseConfig
               .define(
                       EMIT_HEARTBEATS_ENABLED,
                       ConfigDef.Type.BOOLEAN,
                       EMIT_HEARTBEATS_ENABLED_DEFAULT,
                       ConfigDef.Importance.LOW,
                       EMIT_HEARTBEATS_ENABLED_DOC)
               // ...
   ```



##########
docs/configuration.html:
##########
@@ -267,23 +267,31 @@ <h3 class="anchor-heading"><a id="adminclientconfigs" 
class="anchor-link"></a><a
   Below is the configuration of the Kafka Admin client library.
   <!--#include virtual="generated/admin_client_config.html" -->
 
-  <h3 class="anchor-heading"><a id="systemproperties" 
class="anchor-link"></a><a href="#systemproperties">3.8 System 
Properties</a></h3>
+
+  <h3 class="anchor-heading"><a id="mirrormakerconfigs" 
class="anchor-link"></a><a href="#mirrormakerconfigs">3.8 MirrorMaker 
Configs</a></h3>
+  Below is the configuration of MirrorMaker.
+  <!--#include virtual="generated/mirror_connector_config.html" -->
+  <!--#include virtual="generated/mirror_source_config.html" -->

Review Comment:
   We should note the name of the connector here. It'd also be nice if we gave 
each section (common, source, checkpoint, heartbeat) a subheading, like we do 
for 
[source](https://github.com/apache/kafka/blob/3a246b1abab0cfa8050546f54c987af2ec6cdd4e/docs/configuration.html#L254C121-L254C145)
 and 
[sink](https://github.com/apache/kafka/blob/3a246b1abab0cfa8050546f54c987af2ec6cdd4e/docs/configuration.html#L258)
 connectors, and perhaps a brief (one sentence is fine) description of what 
each connector does and/or a link to other parts of our docs that already 
provide that info.



##########
docs/configuration.html:
##########
@@ -267,23 +267,31 @@ <h3 class="anchor-heading"><a id="adminclientconfigs" 
class="anchor-link"></a><a
   Below is the configuration of the Kafka Admin client library.
   <!--#include virtual="generated/admin_client_config.html" -->
 
-  <h3 class="anchor-heading"><a id="systemproperties" 
class="anchor-link"></a><a href="#systemproperties">3.8 System 
Properties</a></h3>
+

Review Comment:
   Nit: unnecessary extra line
   ```suggestion
   ```



##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorHeartbeatConfig.java:
##########
@@ -77,7 +79,9 @@ short heartbeatsTopicReplicationFactor() {
                     ConfigDef.Importance.LOW,
                     HEARTBEATS_TOPIC_REPLICATION_FACTOR_DOC);
 
+    protected final static ConfigDef CONNECTOR_CONFIG_DEF = new 
ConfigDef(mergeConnectorConfigDef(HEARTBEAT_CONFIG_DEF));

Review Comment:
   With the above suggestion, this can now become:
   ```java
   protected static final ConfigDef CONNECTOR_CONFIG_DEF = 
defineHeartbeatConfig(new ConfigDef(BASE_CONNECTOR_CONFIG_DEF));
   ```



##########
docs/configuration.html:
##########
@@ -267,23 +267,31 @@ <h3 class="anchor-heading"><a id="adminclientconfigs" 
class="anchor-link"></a><a
   Below is the configuration of the Kafka Admin client library.
   <!--#include virtual="generated/admin_client_config.html" -->
 
-  <h3 class="anchor-heading"><a id="systemproperties" 
class="anchor-link"></a><a href="#systemproperties">3.8 System 
Properties</a></h3>
+
+  <h3 class="anchor-heading"><a id="mirrormakerconfigs" 
class="anchor-link"></a><a href="#mirrormakerconfigs">3.8 MirrorMaker 
Configs</a></h3>
+  Below is the configuration of MirrorMaker.
+  <!--#include virtual="generated/mirror_connector_config.html" -->

Review Comment:
   We should note that these are common properties that apply to all three 
connectors, right?



##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorHeartbeatConfig.java:
##########
@@ -77,7 +79,9 @@ short heartbeatsTopicReplicationFactor() {
                     ConfigDef.Importance.LOW,
                     HEARTBEATS_TOPIC_REPLICATION_FACTOR_DOC);
 
+    protected final static ConfigDef CONNECTOR_CONFIG_DEF = new 
ConfigDef(mergeConnectorConfigDef(HEARTBEAT_CONFIG_DEF));
+
     public static void main(String[] args) {
-        System.out.println(CONNECTOR_CONFIG_DEF.toHtml(4, config -> 
"mirror_heartbeat_" + config));
+        System.out.println(HEARTBEAT_CONFIG_DEF.toHtml(4, config -> 
"mirror_heartbeat_" + config));

Review Comment:
   With the above suggestion, this can now become:
   ```java
           System.out.println(defineHeartbeatConfig(new ConfigDef()).toHtml(4, 
config -> "mirror_heartbeat_" + config));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to