forked from opensearch-project/data-prepper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the review comments for the PR3037
Signed-off-by: Ajeesh Gopalakrishnakurup <[email protected]>
- Loading branch information
Showing
5 changed files
with
65 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...gins/src/main/java/org/opensearch/dataprepper/plugins/kafka/util/ClientDNSLookupType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.dataprepper.plugins.kafka.util; | ||
|
||
import java.util.Arrays; | ||
import java.util.Map; | ||
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
|
||
public enum ClientDNSLookupType { | ||
|
||
DEFAULT("default"), | ||
USE_ALL_DNS_IPS("use_all_dns_ips"), | ||
CANONICAL_BOOTSTRAP("resolve_canonical_bootstrap_servers_only"); | ||
private static final Map<String, ClientDNSLookupType> DNS_LOOKUP_TYPE_MAP = Arrays.stream(ClientDNSLookupType.values()) | ||
.collect(Collectors.toMap(ClientDNSLookupType::toString, Function.identity())); | ||
|
||
private final String dnsLookupType; | ||
|
||
ClientDNSLookupType(String dnsLookupType) { | ||
this.dnsLookupType = dnsLookupType; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return this.dnsLookupType; | ||
} | ||
|
||
public static ClientDNSLookupType getDnsLookupType(final String name) { | ||
return DNS_LOOKUP_TYPE_MAP.get(name.toLowerCase()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters