GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — KAFKA-21224: Add mirror-level configs (#23843) · coderbruis/kafka@d2e62a6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • build.gradle
  • checkstyle
    • import-control-mirror-coordinator.xml
    • import-control-server-common.xml
  • clients/src/main/java/org/apache/kafka/clients
    • CommonClientConfigs.java
  • core/src/test/scala/unit/kafka/server
    • KafkaConfigTest.scala
  • mirror-coordinator/src
    • main/java/org/apache/kafka/coordinator/mirror
      • ClusterMirrorBrokerConfig.java
      • ClusterMirrorConfig.java
    • test/java/org/apache/kafka/coordinator/mirror
      • ClusterMirrorBrokerConfigTest.java
      • ClusterMirrorConfigTest.java
  • server-common/src
    • main/java/org/apache/kafka/server/util
      • MirrorUtils.java
    • test/java/org/apache/kafka/server/util
      • MirrorUtilsTest.java
  • server/src
    • main/java/org/apache/kafka/server/config
      • AbstractKafkaConfig.java
      • DynamicBrokerConfig.java
    • test/java/org/apache/kafka/server/config
      • DynamicBrokerConfigTest.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎build.gradle‎

Copy file name to clipboardExpand all lines: build.gradle
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1985,8 +1985,10 @@ project(':mirror-coordinator') {
19851985
}
19861986

19871987
dependencies {
1988+
implementation libs.re2j
19881989
implementation libs.jacksonDatabind
19891990
implementation project(':clients')
1991+
implementation project(':server-common')
19901992
implementation project(':coordinator-common')
19911993

19921994
testImplementation project(':server-common')
@@ -2457,6 +2459,7 @@ project(':server-common') {
24572459
implementation libs.joptSimple
24582460
implementation libs.jacksonDatabind
24592461
implementation libs.pcollections
2462+
implementation libs.re2j
24602463
implementation libs.slf4jApi
24612464

24622465
testFixturesImplementation testFixtures(project(':clients'))
Collapse file

‎checkstyle/import-control-mirror-coordinator.xml‎

Copy file name to clipboardExpand all lines: checkstyle/import-control-mirror-coordinator.xml
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,17 @@
3636

3737
<subpackage name="coordinator">
3838
<subpackage name="mirror">
39-
<allow pkg="org.apache.kafka.coordinator.common.runtime" />
39+
<allow pkg="com.google.re2j"/>
40+
<allow pkg="org.apache.kafka.clients" />
41+
<allow pkg="org.apache.kafka.common.acl" />
42+
<allow pkg="org.apache.kafka.common.config" />
43+
<allow pkg="org.apache.kafka.common.resource" />
44+
<allow pkg="org.apache.kafka.common.security" />
4045
<allow pkg="org.apache.kafka.coordinator.mirror" />
46+
<allow pkg="org.apache.kafka.coordinator.common.runtime" />
4147
<allow pkg="org.apache.kafka.server.common" />
48+
<allow pkg="org.apache.kafka.server.util" />
49+
<allow pkg="org.junit.jupiter.api" />
4250
<allow pkg="org.junit.jupiter.api" />
4351
<allow pkg="org.junit.jupiter.params" />
4452
<subpackage name="generated">
Collapse file

‎checkstyle/import-control-server-common.xml‎

Copy file name to clipboardExpand all lines: checkstyle/import-control-server-common.xml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
<allow class="org.apache.kafka.clients.KafkaClient" />
128128
<allow class="org.apache.kafka.clients.RequestCompletionHandler" />
129129
<allow class="org.apache.kafka.clients.CommonClientConfigs" />
130+
<allow pkg="com.google.re2j"/>
130131
<allow pkg="com.fasterxml.jackson" />
131132
<allow pkg="org.apache.kafka.server.util.json" />
132133

Collapse file

‎clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java‎

Copy file name to clipboardExpand all lines: clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ public class CommonClientConfigs {
265265
"metadata for this interval, client repeats the bootstrap process using <code>bootstrap.servers</code> configuration.";
266266
public static final long DEFAULT_METADATA_RECOVERY_REBOOTSTRAP_TRIGGER_MS = 300 * 1000;
267267

268+
public static final String SOURCE_CLUSTER_ID_CONFIG = "source.cluster.id";
269+
public static final String SOURCE_CLUSTER_ID_DOC = "The source cluster ID. Automatically recovered from the source cluster if not present.";
270+
268271
public static final String METADATA_CLUSTER_CHECK_ENABLE_CONFIG = "metadata.cluster.check.enable";
269272
public static final String METADATA_CLUSTER_CHECK_ENABLE_DOC = "Whether the client should send cluster and node information " +
270273
"when connecting to a broker to enable it to check for a misrouted connection. This configuration is ignored if " +
Collapse file

‎core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala‎

Copy file name to clipboardExpand all lines: core/src/test/scala/unit/kafka/server/KafkaConfigTest.scala
+12-12Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ import org.apache.kafka.common.utils.LogCaptureAppender
3636
import org.apache.kafka.coordinator.group.{ConsumerGroupMigrationPolicy, GroupConfig, GroupCoordinatorConfig}
3737
import org.apache.kafka.coordinator.group.Group.GroupType
3838
import org.apache.kafka.coordinator.group.modern.share.ShareGroupConfig
39+
import org.apache.kafka.coordinator.mirror.ClusterMirrorBrokerConfig
3940
import org.apache.kafka.coordinator.share.ShareCoordinatorConfig
4041
import org.apache.kafka.coordinator.transaction.{TransactionLogConfig, TransactionStateManagerConfig}
4142
import org.apache.kafka.network.SocketServerConfigs
4243
import org.apache.kafka.raft.{KRaftConfigs, MetadataLogConfig, QuorumConfig}
43-
import org.apache.kafka.coordinator.mirror.ClusterMirrorConfigs
4444
import org.apache.kafka.server.config.{AbstractKafkaConfig, DelegationTokenManagerConfigs, QuotaConfig, ReplicationConfigs, ServerConfigs, ServerLogConfigs, ServerTopicConfigSynonyms}
4545
import org.apache.kafka.server.log.remote.storage.RemoteLogManagerConfig
4646
import org.apache.kafka.server.metrics.MetricConfigs
@@ -980,17 +980,17 @@ class KafkaConfigTest {
980980
case ReplicationConfigs.UNCLEAN_LEADER_ELECTION_ENABLE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_boolean", "0")
981981

982982
/** Cluster mirror configs */
983-
case ClusterMirrorConfigs.MIRROR_COORDINATOR_THREADS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
984-
case ClusterMirrorConfigs.MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
985-
case ClusterMirrorConfigs.MIRROR_COORDINATOR_APPEND_LINGER_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "-1")
986-
case ClusterMirrorConfigs.MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
987-
case ClusterMirrorConfigs.MIRROR_STATE_TOPIC_NUM_PARTITIONS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
988-
case ClusterMirrorConfigs.MIRROR_STATE_TOPIC_REPLICATION_FACTOR_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
989-
case ClusterMirrorConfigs.MIRROR_NUM_REPLICA_FETCHERS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
990-
case ClusterMirrorConfigs.MIRROR_METADATA_REFRESH_INTERVAL_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "-1")
991-
case ClusterMirrorConfigs.MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
992-
case ClusterMirrorConfigs.MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
993-
case ClusterMirrorConfigs.MIRROR_FAILED_RETRY_MAX_ATTEMPTS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "-1")
983+
case ClusterMirrorBrokerConfig.MIRROR_COORDINATOR_THREADS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
984+
case ClusterMirrorBrokerConfig.MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
985+
case ClusterMirrorBrokerConfig.MIRROR_COORDINATOR_APPEND_LINGER_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "-1")
986+
case ClusterMirrorBrokerConfig.MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
987+
case ClusterMirrorBrokerConfig.MIRROR_STATE_TOPIC_NUM_PARTITIONS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
988+
case ClusterMirrorBrokerConfig.MIRROR_STATE_TOPIC_REPLICATION_FACTOR_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
989+
case ClusterMirrorBrokerConfig.MIRROR_NUM_REPLICA_FETCHERS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
990+
case ClusterMirrorBrokerConfig.MIRROR_METADATA_REFRESH_INTERVAL_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "-1")
991+
case ClusterMirrorBrokerConfig.MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
992+
case ClusterMirrorBrokerConfig.MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "0")
993+
case ClusterMirrorBrokerConfig.MIRROR_FAILED_RETRY_MAX_ATTEMPTS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number", "-1")
994994

995995
case ServerConfigs.CONTROLLED_SHUTDOWN_ENABLE_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_boolean", "0")
996996
case GroupCoordinatorConfig.GROUP_MIN_SESSION_TIMEOUT_MS_CONFIG => assertPropertyInvalid(baseProperties, name, "not_a_number")
Collapse file

‎…dinator/mirror/ClusterMirrorConfigs.java‎ ‎…or/mirror/ClusterMirrorBrokerConfig.java‎mirror-coordinator/src/main/java/org/apache/kafka/coordinator/mirror/ClusterMirrorConfigs.java renamed to mirror-coordinator/src/main/java/org/apache/kafka/coordinator/mirror/ClusterMirrorBrokerConfig.java mirror-coordinator/src/main/java/org/apache/kafka/coordinator/mirror/ClusterMirrorConfigs.java renamed to mirror-coordinator/src/main/java/org/apache/kafka/coordinator/mirror/ClusterMirrorBrokerConfig.java

Copy file name to clipboardExpand all lines: mirror-coordinator/src/main/java/org/apache/kafka/coordinator/mirror/ClusterMirrorBrokerConfig.java
+82-24Lines changed: 82 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
*/
1717
package org.apache.kafka.coordinator.mirror;
1818

19+
import org.apache.kafka.common.config.AbstractConfig;
1920
import org.apache.kafka.common.config.ConfigDef;
2021

22+
import java.util.Properties;
23+
2124
import static org.apache.kafka.common.config.ConfigDef.Importance.HIGH;
2225
import static org.apache.kafka.common.config.ConfigDef.Importance.LOW;
2326
import static org.apache.kafka.common.config.ConfigDef.Importance.MEDIUM;
@@ -28,38 +31,43 @@
2831
import static org.apache.kafka.common.config.ConfigDef.Type.SHORT;
2932

3033
/**
31-
* This class provides proper validation, defaults, and documentation
32-
* for all configurations supported by the Cluster Mirroring feature.
34+
* Broker-level configuration for Cluster Mirroring feature.
35+
* These configurations are set when starting/rebooting the broker
36+
* and stored in server.properties or dynamic broker config.
3337
*/
34-
public class ClusterMirrorConfigs {
35-
// ---------------------------------------------------------------
36-
// Broker level configs. Set when starting/rebooting the broker. Stored in server.properties or dynamic broker config.
37-
// ---------------------------------------------------------------
38-
38+
public final class ClusterMirrorBrokerConfig extends AbstractConfig {
3939
public static final String MIRROR_COORDINATOR_THREADS_CONFIG = "mirror.coordinator.threads";
40-
private static final int MIRROR_COORDINATOR_THREADS_DEFAULT = 1;
4140
private static final String MIRROR_COORDINATOR_THREADS_DOC = "The number of threads used to process coordinator events for cluster mirroring.";
41+
private static final int MIRROR_COORDINATOR_THREADS_DEFAULT = 1;
4242

4343
public static final String MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_CONFIG = "mirror.coordinator.write.timeout.ms";
44-
private static final long MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_DEFAULT = 5000L;
4544
private static final String MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_DOC = "The timeout in milliseconds for write operations on the mirror state coordinator.";
45+
private static final long MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_DEFAULT = 5000L;
4646

4747
public static final String MIRROR_COORDINATOR_APPEND_LINGER_MS_CONFIG = "mirror.coordinator.append.linger.ms";
48-
private static final int MIRROR_COORDINATOR_APPEND_LINGER_MS_DEFAULT = 10;
4948
private static final String MIRROR_COORDINATOR_APPEND_LINGER_MS_DOC = "The linger time in milliseconds for batching records before flushing to the mirror state topic.";
49+
private static final int MIRROR_COORDINATOR_APPEND_LINGER_MS_DEFAULT = 10;
5050

5151
public static final String MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_CONFIG = "mirror.coordinator.load.buffer.size";
52-
private static final int MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_DEFAULT = 5 * 1024 * 1024;
5352
private static final String MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_DOC = "The buffer size in bytes for loading mirror state records during coordinator startup.";
53+
private static final int MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_DEFAULT = 5 * 1024 * 1024;
5454

5555
public static final String MIRROR_STATE_TOPIC_NUM_PARTITIONS_CONFIG = "mirror.state.topic.num.partitions";
56-
private static final int MIRROR_STATE_TOPIC_NUM_PARTITIONS_DEFAULT = 50;
5756
private static final String MIRROR_STATE_TOPIC_NUM_PARTITIONS_DOC = "The number of partitions for the internal topic (should not change after deployment).";
57+
private static final int MIRROR_STATE_TOPIC_NUM_PARTITIONS_DEFAULT = 50;
5858

5959
public static final String MIRROR_STATE_TOPIC_REPLICATION_FACTOR_CONFIG = "mirror.state.topic.replication.factor";
60-
private static final short MIRROR_STATE_TOPIC_REPLICATION_FACTOR_DEFAULT = 3;
6160
private static final String MIRROR_STATE_TOPIC_REPLICATION_FACTOR_DOC = "The replication factor for the internal topic. " +
6261
"Topic creation will fail until the cluster size meets this replication factor requirement.";
62+
private static final short MIRROR_STATE_TOPIC_REPLICATION_FACTOR_DEFAULT = 3;
63+
64+
public static final String MIRROR_STATE_TOPIC_MIN_ISR_CONFIG = "mirror.state.topic.min.isr";
65+
private static final String MIRROR_STATE_TOPIC_MIN_ISR_DOC = "The minimum number of replicas that must acknowledge a write to mirror state topic in order to be considered successful.";
66+
private static final int MIRROR_STATE_TOPIC_MIN_ISR_DEFAULT = 2;
67+
68+
public static final String MIRROR_STATE_TOPIC_SEGMENT_BYTES_CONFIG = "mirror.state.topic.segment.bytes";
69+
private static final String MIRROR_STATE_TOPIC_SEGMENT_BYTES_DOC = "The mirror state topic segment bytes should be kept relatively small in order to facilitate faster log compaction and cache loads.";
70+
private static final int MIRROR_STATE_TOPIC_SEGMENT_BYTES_DEFAULT = 100 * 1024 * 1024;
6371

6472
public static final String MIRROR_NUM_REPLICA_FETCHERS_CONFIG = "mirror.num.replica.fetchers";
6573
private static final int MIRROR_NUM_REPLICA_FETCHERS_DEFAULT = 1;
@@ -68,43 +76,93 @@ public class ClusterMirrorConfigs {
6876
"A higher value increases I/O parallelism for cross cluster replication at the cost of higher CPU and memory utilization.";
6977

7078
public static final String MIRROR_METADATA_REFRESH_INTERVAL_MS_CONFIG = "mirror.metadata.refresh.interval.ms";
71-
private static final long MIRROR_METADATA_REFRESH_INTERVAL_MS_DEFAULT = 60000L;
7279
private static final String MIRROR_METADATA_REFRESH_INTERVAL_MS_DOC = "The interval in milliseconds at which the coordinator refreshes metadata from source clusters. " +
7380
"This controls how frequently the coordinator polls source clusters to detect new topics and metadata changes.";
81+
private static final long MIRROR_METADATA_REFRESH_INTERVAL_MS_DEFAULT = 60000L;
7482

7583
public static final String MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_CONFIG = "mirror.failed.retry.initial.backoff.ms";
76-
private static final long MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_DEFAULT = 100L;
7784
private static final String MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_DOC = "The initial backoff time in milliseconds before retrying a mirror partition " +
7885
"in FAILED state. The actual delay uses full jitter: a uniform random value in [0, backoff].";
86+
private static final long MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_DEFAULT = 100L;
7987

8088
public static final String MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_CONFIG = "mirror.failed.retry.max.backoff.ms";
81-
private static final long MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_DEFAULT = 300000L;
8289
private static final String MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_DOC = "The maximum backoff time in milliseconds for retrying a mirror partition in FAILED state.";
90+
private static final long MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_DEFAULT = 300000L;
8391

8492
public static final String MIRROR_FAILED_RETRY_MAX_ATTEMPTS_CONFIG = "mirror.failed.retry.max.attempts";
85-
private static final int MIRROR_FAILED_RETRY_MAX_ATTEMPTS_DEFAULT = 20;
8693
private static final String MIRROR_FAILED_RETRY_MAX_ATTEMPTS_DOC = "The maximum number of automatic retry attempts for a mirror partition in FAILED state. " +
8794
"After this limit is reached, manual intervention is required via the start-mirror-topics command. " +
8895
"Set to 0 to disable automatic retries.";
96+
private static final int MIRROR_FAILED_RETRY_MAX_ATTEMPTS_DEFAULT = 20;
8997

90-
private static final ConfigDef BROKER_CONFIG_DEF = new ConfigDef()
98+
public static final ConfigDef CONFIG_DEF = new ConfigDef()
9199
.defineInternal(MIRROR_COORDINATOR_THREADS_CONFIG, INT, MIRROR_COORDINATOR_THREADS_DEFAULT, atLeast(1), LOW, MIRROR_COORDINATOR_THREADS_DOC)
92100
.defineInternal(MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_CONFIG, LONG, MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_DEFAULT, atLeast(1L), LOW, MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_DOC)
93101
.defineInternal(MIRROR_COORDINATOR_APPEND_LINGER_MS_CONFIG, INT, MIRROR_COORDINATOR_APPEND_LINGER_MS_DEFAULT, atLeast(0), LOW, MIRROR_COORDINATOR_APPEND_LINGER_MS_DOC)
94102
.defineInternal(MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_CONFIG, INT, MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_DEFAULT, atLeast(1), LOW, MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_DOC)
95103
.defineInternal(MIRROR_STATE_TOPIC_NUM_PARTITIONS_CONFIG, INT, MIRROR_STATE_TOPIC_NUM_PARTITIONS_DEFAULT, atLeast(1), HIGH, MIRROR_STATE_TOPIC_NUM_PARTITIONS_DOC)
96104
.defineInternal(MIRROR_STATE_TOPIC_REPLICATION_FACTOR_CONFIG, SHORT, MIRROR_STATE_TOPIC_REPLICATION_FACTOR_DEFAULT, atLeast(1), HIGH, MIRROR_STATE_TOPIC_REPLICATION_FACTOR_DOC)
105+
.defineInternal(MIRROR_STATE_TOPIC_MIN_ISR_CONFIG, INT, MIRROR_STATE_TOPIC_MIN_ISR_DEFAULT, atLeast(1), HIGH, MIRROR_STATE_TOPIC_MIN_ISR_DOC)
106+
.defineInternal(MIRROR_STATE_TOPIC_SEGMENT_BYTES_CONFIG, INT, MIRROR_STATE_TOPIC_SEGMENT_BYTES_DEFAULT, atLeast(1), HIGH, MIRROR_STATE_TOPIC_SEGMENT_BYTES_DOC)
97107
.defineInternal(MIRROR_NUM_REPLICA_FETCHERS_CONFIG, INT, MIRROR_NUM_REPLICA_FETCHERS_DEFAULT, atLeast(1), HIGH, MIRROR_NUM_REPLICA_FETCHERS_DOC)
98108
.defineInternal(MIRROR_METADATA_REFRESH_INTERVAL_MS_CONFIG, LONG, MIRROR_METADATA_REFRESH_INTERVAL_MS_DEFAULT, atLeast(0L), MEDIUM, MIRROR_METADATA_REFRESH_INTERVAL_MS_DOC)
99109
.defineInternal(MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_CONFIG, LONG, MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_DEFAULT, atLeast(1L), MEDIUM, MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_DOC)
100110
.defineInternal(MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_CONFIG, LONG, MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_DEFAULT, atLeast(1L), MEDIUM, MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_DOC)
101111
.defineInternal(MIRROR_FAILED_RETRY_MAX_ATTEMPTS_CONFIG, INT, MIRROR_FAILED_RETRY_MAX_ATTEMPTS_DEFAULT, between(0, Short.MAX_VALUE), MEDIUM, MIRROR_FAILED_RETRY_MAX_ATTEMPTS_DOC);
102112

103-
/**
104-
* Broker-level mirror configurations.
105-
* This is merged into AbstractKafkaConfig for validation.
106-
*/
107-
public static ConfigDef brokerConfigDef() {
108-
return new ConfigDef(BROKER_CONFIG_DEF);
113+
public ClusterMirrorBrokerConfig(Properties properties) {
114+
super(CONFIG_DEF, properties, false);
115+
}
116+
117+
public int coordinatorNumThreads() {
118+
return getInt(MIRROR_COORDINATOR_THREADS_CONFIG);
119+
}
120+
121+
public long coordinatorWriteTimeoutMs() {
122+
return getLong(MIRROR_COORDINATOR_WRITE_TIMEOUT_MS_CONFIG);
123+
}
124+
125+
public int coordinatorAppendLingerMs() {
126+
return getInt(MIRROR_COORDINATOR_APPEND_LINGER_MS_CONFIG);
127+
}
128+
129+
public int coordinatorLoadBufferSize() {
130+
return getInt(MIRROR_COORDINATOR_LOAD_BUFFER_SIZE_CONFIG);
131+
}
132+
133+
public int stateTopicNumPartitions() {
134+
return getInt(MIRROR_STATE_TOPIC_NUM_PARTITIONS_CONFIG);
135+
}
136+
137+
public short stateTopicReplicationFactor() {
138+
return getShort(MIRROR_STATE_TOPIC_REPLICATION_FACTOR_CONFIG);
139+
}
140+
141+
public int stateTopicMinISR() {
142+
return getInt(MIRROR_STATE_TOPIC_MIN_ISR_CONFIG);
143+
}
144+
145+
public int stateTopicSegmentBytes() {
146+
return getInt(MIRROR_STATE_TOPIC_SEGMENT_BYTES_CONFIG);
147+
}
148+
149+
public int numReplicaFetchers() {
150+
return getInt(MIRROR_NUM_REPLICA_FETCHERS_CONFIG);
151+
}
152+
153+
public long metadataRefreshIntervalMs() {
154+
return getLong(MIRROR_METADATA_REFRESH_INTERVAL_MS_CONFIG);
155+
}
156+
157+
public long failedRetryInitialBackoffMs() {
158+
return getLong(MIRROR_FAILED_RETRY_INITIAL_BACKOFF_MS_CONFIG);
159+
}
160+
161+
public long failedRetryMaxBackoffMs() {
162+
return getLong(MIRROR_FAILED_RETRY_MAX_BACKOFF_MS_CONFIG);
163+
}
164+
165+
public int failedRetryMaxAttempts() {
166+
return getInt(MIRROR_FAILED_RETRY_MAX_ATTEMPTS_CONFIG);
109167
}
110168
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.