Skip to content

Commit 66f8ece

Browse files
authored
minor bug fix in config parsing (#56)
1 parent 6f29133 commit 66f8ece

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

kafka-streams-partitioners/weighted-group-partitioner/src/main/java/org/hypertrace/core/kafkastreams/framework/partitioner/GroupPartitionerBuilder.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.hypertrace.core.kafkastreams.framework.partitioner;
22

3+
import com.google.common.base.Joiner;
34
import com.typesafe.config.Config;
4-
import com.typesafe.config.ConfigUtil;
55
import java.util.function.BiFunction;
66
import org.apache.kafka.streams.processor.StreamPartitioner;
77
import org.hypertrace.core.grpcutils.client.GrpcChannelRegistry;
@@ -22,12 +22,12 @@ public StreamPartitioner<K, V> buildPartitioner(
2222
StreamPartitioner<K, V> delegatePartitioner,
2323
GrpcChannelRegistry channelRegistry) {
2424
String enabledConfigPath =
25-
ConfigUtil.joinPath(GROUP_PARTITIONER_CONFIG_PREFIX, ENABLED_CONFIG_KEY);
25+
Joiner.on(".").join(GROUP_PARTITIONER_CONFIG_PREFIX, ENABLED_CONFIG_KEY);
2626
// Use group partitioner only when explicitly enabled.
2727
if (appConfig.hasPath(enabledConfigPath) && appConfig.getBoolean(enabledConfigPath)) {
2828
String serviceConfigPath =
29-
ConfigUtil.joinPath(
30-
GROUP_PARTITIONER_CONFIG_PREFIX, GROUP_PARTITIONER_CONFIG_SERVICE_PREFIX);
29+
Joiner.on(".")
30+
.join(GROUP_PARTITIONER_CONFIG_PREFIX, GROUP_PARTITIONER_CONFIG_SERVICE_PREFIX);
3131
PartitionerConfigServiceCachingClient configServiceClient =
3232
new PartitionerConfigServiceCachingClient(
3333
appConfig.getConfig(serviceConfigPath), channelRegistry);

kafka-streams-partitioners/weighted-group-partitioner/src/test/java/org/hypertrace/core/kafkastreams/framework/partitioner/GroupPartitionerBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import static org.hypertrace.core.kafkastreams.framework.partitioner.PartitionerConfigServiceClientConfig.PORT_KEY;
99
import static org.junit.jupiter.api.Assertions.*;
1010

11+
import com.google.common.base.Joiner;
1112
import com.google.common.collect.Maps;
1213
import com.typesafe.config.Config;
1314
import com.typesafe.config.ConfigFactory;
14-
import com.typesafe.config.ConfigUtil;
1515
import java.util.Map;
1616
import java.util.function.BiFunction;
1717
import org.apache.kafka.streams.processor.StreamPartitioner;
@@ -90,6 +90,6 @@ private Config toConfig(String host, String port, String cacheDuration, String e
9090
}
9191

9292
private void putIfNotNull(Map<String, String> configMap, String value, String... keyElements) {
93-
configMap.put(ConfigUtil.joinPath(keyElements), value);
93+
configMap.put(Joiner.on(".").join(keyElements), value);
9494
}
9595
}

0 commit comments

Comments
 (0)