Skip to content

Commit 598c42d

Browse files
committed
remove and rename variable
1 parent 587f440 commit 598c42d

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

core/src/main/java/kafka/log/remote/RemoteLogManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
public class RemoteLogManager implements Closeable {
160160

161161
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteLogManager.class);
162-
private static final String REMOTE_LOG_READER_THREAD_NAME_PREFIX = "remote-log-reader-%d";
162+
private static final String REMOTE_LOG_READER_THREAD_NAME_PATTERN = "remote-log-reader-%d";
163163
private final RemoteLogManagerConfig rlmConfig;
164164
private final int brokerId;
165165
private final String logDir;
@@ -263,7 +263,7 @@ public RemoteLogManager(RemoteLogManagerConfig rlmConfig,
263263
TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
264264

265265
remoteStorageReaderThreadPool = new RemoteStorageThreadPool(
266-
REMOTE_LOG_READER_THREAD_NAME_PREFIX,
266+
REMOTE_LOG_READER_THREAD_NAME_PATTERN,
267267
rlmConfig.remoteLogReaderThreads(),
268268
rlmConfig.remoteLogReaderMaxPendingTasks()
269269
);
@@ -2168,12 +2168,12 @@ static class RLMScheduledThreadPool {
21682168

21692169
private static final Logger LOGGER = LoggerFactory.getLogger(RLMScheduledThreadPool.class);
21702170
private final String threadPoolName;
2171-
private final String threadNamePrefix;
2171+
private final String threadNamePattern;
21722172
private final ScheduledThreadPoolExecutor scheduledThreadPool;
21732173

2174-
public RLMScheduledThreadPool(int poolSize, String threadPoolName, String threadNamePrefix) {
2174+
public RLMScheduledThreadPool(int poolSize, String threadPoolName, String threadNamePattern) {
21752175
this.threadPoolName = threadPoolName;
2176-
this.threadNamePrefix = threadNamePrefix;
2176+
this.threadNamePattern = threadNamePattern;
21772177
scheduledThreadPool = createPool(poolSize);
21782178
}
21792179

@@ -2190,7 +2190,7 @@ private ScheduledThreadPoolExecutor createPool(int poolSize) {
21902190
threadPool.setRemoveOnCancelPolicy(true);
21912191
threadPool.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
21922192
threadPool.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
2193-
threadPool.setThreadFactory(ThreadUtils.createThreadFactory(threadNamePrefix, true));
2193+
threadPool.setThreadFactory(ThreadUtils.createThreadFactory(threadNamePattern, true));
21942194
return threadPool;
21952195
}
21962196

core/src/main/scala/kafka/server/DynamicBrokerConfig.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,9 +1192,8 @@ class DynamicRemoteLogConfig(server: KafkaBroker) extends BrokerReconfigurable w
11921192

11931193
def isChangedLongValue(k : String): Boolean = oldLongValue(k) != newLongValue(k)
11941194

1195-
val remoteLogManagerOpt = server.remoteLogManagerOpt
1196-
if (remoteLogManagerOpt.nonEmpty) {
1197-
val remoteLogManager = remoteLogManagerOpt.get
1195+
if (server.remoteLogManagerOpt.nonEmpty) {
1196+
val remoteLogManager = server.remoteLogManagerOpt.get
11981197
if (isChangedLongValue(RemoteLogManagerConfig.REMOTE_LOG_INDEX_FILE_CACHE_TOTAL_SIZE_BYTES_PROP)) {
11991198
val oldValue = oldLongValue(RemoteLogManagerConfig.REMOTE_LOG_INDEX_FILE_CACHE_TOTAL_SIZE_BYTES_PROP)
12001199
val newValue = newLongValue(RemoteLogManagerConfig.REMOTE_LOG_INDEX_FILE_CACHE_TOTAL_SIZE_BYTES_PROP)

storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteStorageThreadPool.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ public final class RemoteStorageThreadPool extends ThreadPoolExecutor {
3636
private static final Logger LOGGER = LoggerFactory.getLogger(RemoteStorageThreadPool.class);
3737
private final KafkaMetricsGroup metricsGroup = new KafkaMetricsGroup(this.getClass());
3838

39-
public RemoteStorageThreadPool(String threadNamePrefix,
39+
public RemoteStorageThreadPool(String threadNamePattern,
4040
int numThreads,
4141
int maxPendingTasks) {
4242
super(numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(maxPendingTasks),
43-
ThreadUtils.createThreadFactory(threadNamePrefix, false));
43+
ThreadUtils.createThreadFactory(threadNamePattern, false));
4444
metricsGroup.newGauge(REMOTE_LOG_READER_TASK_QUEUE_SIZE_METRIC.getName(),
4545
() -> getQueue().size());
4646
metricsGroup.newGauge(REMOTE_LOG_READER_AVG_IDLE_PERCENT_METRIC.getName(),

0 commit comments

Comments
 (0)