Package org.elasticsearch.common.network
Class NetworkService
- java.lang.Object
-
- org.elasticsearch.common.network.NetworkService
-
public final class NetworkService extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNetworkService.CustomNameResolverA custom name resolver can support custom lookup keys (my_net_key:ipv4) and also change the default inet address used in case no settings is provided.
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_NETWORK_HOSTBy default, we bind to loopback interfacesstatic Setting<List<String>>GLOBAL_NETWORK_BIND_HOST_SETTINGstatic Setting<List<String>>GLOBAL_NETWORK_HOST_SETTINGstatic Setting<List<String>>GLOBAL_NETWORK_PUBLISH_HOST_SETTINGstatic Setting<Boolean>NETWORK_SERVERstatic Setting<TimeValue>TCP_CONNECT_TIMEOUTstatic Setting<Boolean>TCP_KEEP_ALIVEstatic Setting<Integer>TCP_KEEP_COUNTstatic Setting<Integer>TCP_KEEP_IDLEstatic Setting<Integer>TCP_KEEP_INTERVALstatic Setting<Boolean>TCP_NO_DELAYstatic Setting<ByteSizeValue>TCP_RECEIVE_BUFFER_SIZEstatic Setting<Boolean>TCP_REUSE_ADDRESSstatic Setting<ByteSizeValue>TCP_SEND_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description NetworkService(List<NetworkService.CustomNameResolver> customNameResolvers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InetAddress[]resolveBindHostAddresses(String[] bindHosts)ResolvesbindHoststo a list of internet addresses.InetAddressresolvePublishHostAddresses(String[] publishHosts)ResolvespublishHoststo a single publish address.
-
-
-
Field Detail
-
DEFAULT_NETWORK_HOST
public static final String DEFAULT_NETWORK_HOST
By default, we bind to loopback interfaces- See Also:
- Constant Field Values
-
GLOBAL_NETWORK_BIND_HOST_SETTING
public static final Setting<List<String>> GLOBAL_NETWORK_BIND_HOST_SETTING
-
GLOBAL_NETWORK_PUBLISH_HOST_SETTING
public static final Setting<List<String>> GLOBAL_NETWORK_PUBLISH_HOST_SETTING
-
TCP_SEND_BUFFER_SIZE
public static final Setting<ByteSizeValue> TCP_SEND_BUFFER_SIZE
-
TCP_RECEIVE_BUFFER_SIZE
public static final Setting<ByteSizeValue> TCP_RECEIVE_BUFFER_SIZE
-
-
Constructor Detail
-
NetworkService
public NetworkService(List<NetworkService.CustomNameResolver> customNameResolvers)
-
-
Method Detail
-
resolveBindHostAddresses
public InetAddress[] resolveBindHostAddresses(String[] bindHosts) throws IOException
ResolvesbindHoststo a list of internet addresses. The list will not contain duplicate addresses.- Parameters:
bindHosts- list of hosts to bind to. this may contain special pseudo-hostnames such as _local_ (see the documentation). if it is null, it will fall back to _local_- Returns:
- unique set of internet addresses
- Throws:
IOException
-
resolvePublishHostAddresses
public InetAddress resolvePublishHostAddresses(String[] publishHosts) throws IOException
ResolvespublishHoststo a single publish address. The fact that it returns only one address is just a current limitation.If
publishHostsresolves to more than one address, then one is selected with magic- Parameters:
publishHosts- list of hosts to publish as. this may contain special pseudo-hostnames such as _local_ (see the documentation). if it is null, it will fall back to _local_- Returns:
- single internet address
- Throws:
IOException
-
-