Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum ClientDnsLookup {
USE_ALL_DNS_IPS("use_all_dns_ips"),
RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY("resolve_canonical_bootstrap_servers_only");

private String clientDnsLookup;
private final String clientDnsLookup;

ClientDnsLookup(String clientDnsLookup) {
this.clientDnsLookup = clientDnsLookup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static List<InetSocketAddress> parseAndValidateAddresses(List<String> url
* some third-party applications still rely on this API to parse and validate addresses.
*/
public static List<InetSocketAddress> parseAndValidateAddresses(List<String> urls) {
return parseAndValidateAddresses(urls, ClientDnsLookup.DEFAULT);
return parseAndValidateAddresses(urls, ClientDnsLookup.USE_ALL_DNS_IPS);
}

public static List<InetSocketAddress> parseAndValidateAddresses(List<String> urls, ClientDnsLookup clientDnsLookup) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public class AdminClientConfig extends AbstractConfig {
METRICS_RECORDING_LEVEL_DOC)
.define(CLIENT_DNS_LOOKUP_CONFIG,
Type.STRING,
ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
in(ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
ClientDnsLookup.RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY.toString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public class ConsumerConfig extends AbstractConfig {
CommonClientConfigs.BOOTSTRAP_SERVERS_DOC)
.define(CLIENT_DNS_LOOKUP_CONFIG,
Type.STRING,
ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
in(ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
ClientDnsLookup.RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY.toString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public class ProducerConfig extends AbstractConfig {
CONFIG = new ConfigDef().define(BOOTSTRAP_SERVERS_CONFIG, Type.LIST, Collections.emptyList(), new ConfigDef.NonNullValidator(), Importance.HIGH, CommonClientConfigs.BOOTSTRAP_SERVERS_DOC)
.define(CLIENT_DNS_LOOKUP_CONFIG,
Type.STRING,
ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
in(ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
ClientDnsLookup.RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY.toString()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private static Cluster mockCluster(int controllerIndex) {

private static Cluster mockBootstrapCluster() {
return Cluster.bootstrap(ClientUtils.parseAndValidateAddresses(
singletonList("localhost:8121"), ClientDnsLookup.DEFAULT));
singletonList("localhost:8121"), ClientDnsLookup.USE_ALL_DNS_IPS));
}

private static AdminClientUnitTestEnv mockClientEnv(String... configVals) {
Expand Down Expand Up @@ -2281,7 +2281,7 @@ public void testGetSubLevelError() {
assertEquals(FencedInstanceIdException.class, KafkaAdminClient.getSubLevelError(
errorsMap, memberIdentities.get(1), "For unit test").getClass());
}

private ClientQuotaEntity newClientQuotaEntity(String... args) {
assertTrue(args.length % 2 == 0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ public void testQuotaMetrics() {
Cluster cluster = TestUtils.singletonCluster("test", 1);
Node node = cluster.nodes().get(0);
NetworkClient client = new NetworkClient(selector, metadata, "mock", Integer.MAX_VALUE,
1000, 1000, 64 * 1024, 64 * 1024, 1000, ClientDnsLookup.DEFAULT,
1000, 1000, 64 * 1024, 64 * 1024, 1000, ClientDnsLookup.USE_ALL_DNS_IPS,
time, true, new ApiVersions(), throttleTimeSensor, new LogContext());

ByteBuffer buffer = ApiVersionsResponse.
Expand Down Expand Up @@ -3539,7 +3539,7 @@ private void testGetOffsetsForTimesWithError(Errors errorForP0,
TopicPartition t2p0 = new TopicPartition(topicName2, 0);
// Expect a metadata refresh.
metadata.bootstrap(ClientUtils.parseAndValidateAddresses(Collections.singletonList("1.1.1.1:1111"),
ClientDnsLookup.DEFAULT));
ClientDnsLookup.USE_ALL_DNS_IPS));

Map<String, Integer> partitionNumByTopic = new HashMap<>();
partitionNumByTopic.put(topicName, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public void testQuotaMetrics() throws Exception {
Cluster cluster = TestUtils.singletonCluster("test", 1);
Node node = cluster.nodes().get(0);
NetworkClient client = new NetworkClient(selector, metadata, "mock", Integer.MAX_VALUE,
1000, 1000, 64 * 1024, 64 * 1024, 1000, ClientDnsLookup.DEFAULT,
1000, 1000, 64 * 1024, 64 * 1024, 1000, ClientDnsLookup.USE_ALL_DNS_IPS,
time, true, new ApiVersions(), throttleTimeSensor, logContext);

ByteBuffer buffer = ApiVersionsResponse.createApiVersionsResponse(400, RecordBatch.CURRENT_MAGIC_VALUE).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public class WorkerConfig extends AbstractConfig {
+ "plugins and their dependencies\n"
+ "Note: symlinks will be followed to discover dependencies or plugins.\n"
+ "Examples: plugin.path=/usr/local/share/java,/usr/local/share/kafka/plugins,"
+ "/opt/connectors\n"
+ "/opt/connectors\n"
+ "Do not use config provider variables in this property, since the raw path is used "
+ "by the worker's scanner before config providers are initialized and used to "
+ "replace variables.";
Expand Down Expand Up @@ -249,7 +249,7 @@ protected static ConfigDef baseConfigDef() {
Importance.HIGH, BOOTSTRAP_SERVERS_DOC)
.define(CLIENT_DNS_LOOKUP_CONFIG,
Type.STRING,
ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
in(ClientDnsLookup.DEFAULT.toString(),
ClientDnsLookup.USE_ALL_DNS_IPS.toString(),
ClientDnsLookup.RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY.toString()),
Expand Down Expand Up @@ -379,8 +379,8 @@ private void logPluginPathConfigProviderWarning(Map<String, String> rawOriginals
if (!Objects.equals(rawPluginPath, transformedPluginPath)) {
log.warn(
"Variables cannot be used in the 'plugin.path' property, since the property is "
+ "used by plugin scanning before the config providers that replace the "
+ "variables are initialized. The raw value '{}' was used for plugin scanning, as "
+ "used by plugin scanning before the config providers that replace the "
+ "variables are initialized. The raw value '{}' was used for plugin scanning, as "
+ "opposed to the transformed value '{}', and this may cause unexpected results.",
rawPluginPath,
transformedPluginPath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ object BrokerApiVersionsCommand {
CommonClientConfigs.BOOTSTRAP_SERVERS_DOC)
.define(CommonClientConfigs.CLIENT_DNS_LOOKUP_CONFIG,
Type.STRING,
ClientDnsLookup.DEFAULT.toString,
ClientDnsLookup.USE_ALL_DNS_IPS.toString,
in(ClientDnsLookup.DEFAULT.toString,
ClientDnsLookup.USE_ALL_DNS_IPS.toString,
ClientDnsLookup.RESOLVE_CANONICAL_BOOTSTRAP_SERVERS_ONLY.toString),
Expand Down Expand Up @@ -298,7 +298,7 @@ object BrokerApiVersionsCommand {
DefaultSendBufferBytes,
DefaultReceiveBufferBytes,
requestTimeoutMs,
ClientDnsLookup.DEFAULT,
ClientDnsLookup.USE_ALL_DNS_IPS,
time,
true,
new ApiVersions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class ControllerChannelManager(controllerContext: ControllerContext,
Selectable.USE_DEFAULT_BUFFER_SIZE,
Selectable.USE_DEFAULT_BUFFER_SIZE,
config.requestTimeoutMs,
ClientDnsLookup.DEFAULT,
ClientDnsLookup.USE_ALL_DNS_IPS,
time,
false,
new ApiVersions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object TransactionMarkerChannelManager {
Selectable.USE_DEFAULT_BUFFER_SIZE,
config.socketReceiveBufferBytes,
config.requestTimeoutMs,
ClientDnsLookup.DEFAULT,
ClientDnsLookup.USE_ALL_DNS_IPS,
time,
false,
new ApiVersions,
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/kafka/server/KafkaServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ class KafkaServer(val config: KafkaConfig, time: Time = Time.SYSTEM, threadNameP
Selectable.USE_DEFAULT_BUFFER_SIZE,
Selectable.USE_DEFAULT_BUFFER_SIZE,
config.requestTimeoutMs,
ClientDnsLookup.DEFAULT,
ClientDnsLookup.USE_ALL_DNS_IPS,
time,
false,
new ApiVersions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class ReplicaFetcherBlockingSend(sourceBroker: BrokerEndPoint,
Selectable.USE_DEFAULT_BUFFER_SIZE,
brokerConfig.replicaSocketReceiveBufferBytes,
brokerConfig.replicaRequestTimeoutMs,
ClientDnsLookup.DEFAULT,
ClientDnsLookup.USE_ALL_DNS_IPS,
time,
false,
new ApiVersions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ private class ReplicaFetcherBlockingSend(sourceNode: Node,
Selectable.USE_DEFAULT_BUFFER_SIZE,
consumerConfig.getInt(ConsumerConfig.RECEIVE_BUFFER_CONFIG),
consumerConfig.getInt(ConsumerConfig.REQUEST_TIMEOUT_MS_CONFIG),
ClientDnsLookup.DEFAULT,
ClientDnsLookup.USE_ALL_DNS_IPS,
time,
false,
new ApiVersions,
Expand Down