Skip to content

Commit a0c0bb7

Browse files
committed
fix some
1 parent 04313d7 commit a0c0bb7

File tree

3 files changed

+87
-91
lines changed

3 files changed

+87
-91
lines changed

storage/src/test/java/org/apache/kafka/storage/internals/log/LogTestUtils.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.apache.kafka.common.utils.Time;
2323
import org.apache.kafka.coordinator.transaction.TransactionLogConfig;
2424
import org.apache.kafka.server.config.ServerLogConfigs;
25-
import org.apache.kafka.server.log.remote.storage.RemoteLogManager;
2625
import org.apache.kafka.server.util.Scheduler;
2726
import org.apache.kafka.storage.log.metrics.BrokerTopicStats;
2827

@@ -64,11 +63,11 @@ public static UnifiedLog createLog(File dir,
6463
Optional.empty(), // topicId
6564
new ConcurrentHashMap<>(), // numRemainingSegments
6665
false, // remoteStorageSystemEnable
67-
Optional.empty(), // remoteLogManager
6866
LogOffsetsListener.NO_OP_OFFSETS_LISTENER
6967
);
7068
}
7169

70+
@SuppressWarnings("ParameterNumber")
7271
public static UnifiedLog createLog(File dir,
7372
LogConfig config,
7473
BrokerTopicStats brokerTopicStats,
@@ -83,7 +82,6 @@ public static UnifiedLog createLog(File dir,
8382
Optional<Uuid> topicId,
8483
ConcurrentMap<String, Integer> numRemainingSegments,
8584
boolean remoteStorageSystemEnable,
86-
Optional<RemoteLogManager> remoteLogManager,
8785
LogOffsetsListener logOffsetsListener) throws IOException {
8886
return UnifiedLog.create(
8987
dir,
@@ -98,7 +96,7 @@ public static UnifiedLog createLog(File dir,
9896
producerIdExpirationCheckIntervalMs,
9997
new LogDirFailureChannel(10),
10098
lastShutdownClean,
101-
topicId, // 直接傳入 Java Optional
99+
topicId,
102100
numRemainingSegments,
103101
remoteStorageSystemEnable,
104102
logOffsetsListener
@@ -119,10 +117,9 @@ public static class LogConfigBuilder {
119117
private int segmentIndexBytes = ServerLogConfigs.LOG_INDEX_SIZE_MAX_BYTES_DEFAULT;
120118
private long fileDeleteDelayMs = ServerLogConfigs.LOG_DELETE_DELAY_MS_DEFAULT;
121119
private boolean remoteLogStorageEnable = LogConfig.DEFAULT_REMOTE_STORAGE_ENABLE;
122-
private boolean remoteLogCopyDisable = false;
123-
private boolean remoteLogDeleteOnDisable = false;
120+
private boolean remoteLogCopyDisable = LogConfig.DEFAULT_REMOTE_LOG_COPY_DISABLE_CONFIG;
121+
private boolean remoteLogDeleteOnDisable = LogConfig.DEFAULT_REMOTE_LOG_DELETE_ON_DISABLE_CONFIG;
124122

125-
// 2. 為每個參數建立一個 "with" 方法,用於設定值並回傳 builder 本身 (fluent interface)
126123
public LogConfigBuilder withSegmentMs(long segmentMs) {
127124
this.segmentMs = segmentMs;
128125
return this;

0 commit comments

Comments
 (0)