Yunyung commented on code in PR #19579:
URL: https://github.com/apache/kafka/pull/19579#discussion_r2064009541
##########
clients/clients-integration-tests/src/test/java/org/apache/kafka/clients/admin/ListOffsetsIntegrationTest.java:
##########
@@ -243,8 +241,7 @@ private void verifyListOffsets(String topic, int
expectedMaxTimestampOffset) thr
// case 2: test the offsets from recovery path.
// server will rebuild offset index according to log files if the
index files are nonexistent
Set<String> indexFiles =
clusterInstance.brokers().values().stream().flatMap(broker ->
- CollectionConverters.asJava(broker.config().logDirs()).stream()
- ).collect(Collectors.toUnmodifiableSet());
+
broker.config().logDirs().stream()).collect(Collectors.toUnmodifiableSet());
Review Comment:
Done. Thanks.
##########
storage/src/test/java/org/apache/kafka/tiered/storage/integration/TransactionsWithTieredStoreTest.java:
##########
@@ -75,7 +76,7 @@ public Properties topicConfig() {
public void
maybeWaitForAtLeastOneSegmentUpload(scala.collection.Seq<TopicPartition>
topicPartitions) {
CollectionConverters.asJava(topicPartitions).forEach(topicPartition ->
{
List<BrokerLocalStorage> localStorages =
CollectionConverters.asJava(brokers()).stream()
- .map(b -> new BrokerLocalStorage(b.config().brokerId(),
CollectionConverters.asJava(b.config().logDirs().toSet()),
STORAGE_WAIT_TIMEOUT_SEC))
+ .map(b -> new BrokerLocalStorage(b.config().brokerId(),
new HashSet<>(b.config().logDirs()), STORAGE_WAIT_TIMEOUT_SEC))
Review Comment:
Done.
##########
server/src/main/java/org/apache/kafka/server/config/AbstractKafkaConfig.java:
##########
@@ -66,8 +68,16 @@ public abstract class AbstractKafkaConfig extends
AbstractConfig {
AddPartitionsToTxnConfig.CONFIG_DEF
));
+ public final List<String> logDirs;
+
+ @SuppressWarnings("this-escape")
public AbstractKafkaConfig(ConfigDef definition, Map<?, ?> originals,
Map<String, ?> configProviderProps, boolean doLog) {
super(definition, originals, configProviderProps, doLog);
+ this.logDirs =
Csv.parseCsvList(Optional.ofNullable(getString(ServerLogConfigs.LOG_DIRS_CONFIG)).orElse(getString(ServerLogConfigs.LOG_DIR_CONFIG)));
Review Comment:
Sounds fair. Simple, not hot path, low cost.
##########
storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestHarness.java:
##########
@@ -154,7 +155,7 @@ public static List<LocalTieredStorage>
remoteStorageManagers(Seq<KafkaBroker> br
public static List<BrokerLocalStorage> localStorages(Seq<KafkaBroker>
brokers) {
return CollectionConverters.asJava(brokers).stream()
- .map(b -> new BrokerLocalStorage(b.config().brokerId(),
CollectionConverters.asJava(b.config().logDirs().toSet()),
+ .map(b -> new BrokerLocalStorage(b.config().brokerId(), new
HashSet<>(b.config().logDirs()),
Review Comment:
Done.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]