|
18 | 18 |
|
19 | 19 | import org.apache.kafka.common.config.AbstractConfig; |
20 | 20 | import org.apache.kafka.common.config.ConfigDef; |
21 | | -import org.apache.kafka.common.config.ConfigException; |
22 | 21 |
|
23 | 22 | import java.util.Collections; |
24 | 23 | import java.util.Map; |
@@ -96,26 +95,20 @@ public final class RemoteLogManagerConfig { |
96 | 95 | public static final String REMOTE_LOG_MANAGER_THREAD_POOL_SIZE_PROP = "remote.log.manager.thread.pool.size"; |
97 | 96 | public static final String REMOTE_LOG_MANAGER_THREAD_POOL_SIZE_DOC = "Deprecated. Size of the thread pool used in scheduling tasks to copy " + |
98 | 97 | "segments, fetch remote log indexes and clean up remote log segments."; |
99 | | - public static final int DEFAULT_REMOTE_LOG_MANAGER_THREAD_POOL_SIZE = 10; |
| 98 | + public static final int DEFAULT_REMOTE_LOG_MANAGER_THREAD_POOL_SIZE = 2; |
100 | 99 |
|
101 | 100 | private static final String REMOTE_LOG_MANAGER_THREAD_POOL_FALLBACK = "The default value of -1 means that this will be set to the configured value of " + |
102 | 101 | REMOTE_LOG_MANAGER_THREAD_POOL_SIZE_PROP + ", if available; otherwise, it defaults to " + DEFAULT_REMOTE_LOG_MANAGER_THREAD_POOL_SIZE + "."; |
103 | | - private static final ConfigDef.Validator REMOTE_LOG_MANAGER_THREAD_POOL_SIZE_VALIDATOR = ConfigDef.LambdaValidator.with( |
104 | | - (name, value) -> { |
105 | | - if ((int) value < -1 || (int) value == 0) throw new ConfigException(name, value, "Value can be -1 or greater than 0"); |
106 | | - }, |
107 | | - () -> "[-1,1,...]" |
108 | | - ); |
109 | 102 |
|
110 | 103 | public static final String REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE_PROP = "remote.log.manager.copier.thread.pool.size"; |
111 | 104 | public static final String REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE_DOC = "Size of the thread pool used in scheduling tasks " + |
112 | 105 | "to copy segments. " + REMOTE_LOG_MANAGER_THREAD_POOL_FALLBACK; |
113 | | - public static final int DEFAULT_REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE = -1; |
| 106 | + public static final int DEFAULT_REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE = 10; |
114 | 107 |
|
115 | 108 | public static final String REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE_PROP = "remote.log.manager.expiration.thread.pool.size"; |
116 | 109 | public static final String REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE_DOC = "Size of the thread pool used in scheduling tasks " + |
117 | 110 | "to clean up remote log segments. " + REMOTE_LOG_MANAGER_THREAD_POOL_FALLBACK; |
118 | | - public static final int DEFAULT_REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE = -1; |
| 111 | + public static final int DEFAULT_REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE = 10; |
119 | 112 |
|
120 | 113 | public static final String REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP = "remote.log.manager.task.interval.ms"; |
121 | 114 | public static final String REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_DOC = "Interval at which remote log manager runs the scheduled tasks like copy " + |
@@ -270,13 +263,13 @@ public static ConfigDef configDef() { |
270 | 263 | .define(REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE_PROP, |
271 | 264 | INT, |
272 | 265 | DEFAULT_REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE, |
273 | | - REMOTE_LOG_MANAGER_THREAD_POOL_SIZE_VALIDATOR, |
| 266 | + atLeast(1), |
274 | 267 | MEDIUM, |
275 | 268 | REMOTE_LOG_MANAGER_COPIER_THREAD_POOL_SIZE_DOC) |
276 | 269 | .define(REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE_PROP, |
277 | 270 | INT, |
278 | 271 | DEFAULT_REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE, |
279 | | - REMOTE_LOG_MANAGER_THREAD_POOL_SIZE_VALIDATOR, |
| 272 | + atLeast(1), |
280 | 273 | MEDIUM, |
281 | 274 | REMOTE_LOG_MANAGER_EXPIRATION_THREAD_POOL_SIZE_DOC) |
282 | 275 | .define(REMOTE_LOG_MANAGER_TASK_INTERVAL_MS_PROP, |
|
0 commit comments