Package org.elasticsearch.common.network
Class NetworkService
- java.lang.Object
-
- org.elasticsearch.common.network.NetworkService
-
public final class NetworkService extends java.lang.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 java.lang.StringDEFAULT_NETWORK_HOSTBy default, we bind to loopback interfacesstatic Setting<java.util.List<java.lang.String>>GLOBAL_NETWORK_BIND_HOST_SETTINGstatic Setting<java.util.List<java.lang.String>>GLOBAL_NETWORK_HOST_SETTINGstatic Setting<java.util.List<java.lang.String>>GLOBAL_NETWORK_PUBLISH_HOST_SETTINGstatic Setting<java.lang.Boolean>NETWORK_SERVERstatic Setting<TimeValue>TCP_CONNECT_TIMEOUTstatic Setting<java.lang.Boolean>TCP_KEEP_ALIVEstatic Setting<java.lang.Integer>TCP_KEEP_COUNTstatic Setting<java.lang.Integer>TCP_KEEP_IDLEstatic Setting<java.lang.Integer>TCP_KEEP_INTERVALstatic Setting<java.lang.Boolean>TCP_NO_DELAYstatic Setting<ByteSizeValue>TCP_RECEIVE_BUFFER_SIZEstatic Setting<java.lang.Boolean>TCP_REUSE_ADDRESSstatic Setting<ByteSizeValue>TCP_SEND_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description NetworkService(java.util.List<NetworkService.CustomNameResolver> customNameResolvers)
-
Method Summary
Modifier and Type Method Description java.net.InetAddress[]resolveBindHostAddresses(java.lang.String[] bindHosts)ResolvesbindHoststo a list of internet addresses.java.net.InetAddressresolvePublishHostAddresses(java.lang.String[] publishHosts)ResolvespublishHoststo a single publish address.
-
-
-
Field Detail
-
DEFAULT_NETWORK_HOST
public static final java.lang.String DEFAULT_NETWORK_HOST
By default, we bind to loopback interfaces- See Also:
- Constant Field Values
-
NETWORK_SERVER
public static final Setting<java.lang.Boolean> NETWORK_SERVER
-
GLOBAL_NETWORK_HOST_SETTING
public static final Setting<java.util.List<java.lang.String>> GLOBAL_NETWORK_HOST_SETTING
-
GLOBAL_NETWORK_BIND_HOST_SETTING
public static final Setting<java.util.List<java.lang.String>> GLOBAL_NETWORK_BIND_HOST_SETTING
-
GLOBAL_NETWORK_PUBLISH_HOST_SETTING
public static final Setting<java.util.List<java.lang.String>> GLOBAL_NETWORK_PUBLISH_HOST_SETTING
-
TCP_NO_DELAY
public static final Setting<java.lang.Boolean> TCP_NO_DELAY
-
TCP_KEEP_ALIVE
public static final Setting<java.lang.Boolean> TCP_KEEP_ALIVE
-
TCP_KEEP_IDLE
public static final Setting<java.lang.Integer> TCP_KEEP_IDLE
-
TCP_KEEP_INTERVAL
public static final Setting<java.lang.Integer> TCP_KEEP_INTERVAL
-
TCP_KEEP_COUNT
public static final Setting<java.lang.Integer> TCP_KEEP_COUNT
-
TCP_REUSE_ADDRESS
public static final Setting<java.lang.Boolean> TCP_REUSE_ADDRESS
-
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(java.util.List<NetworkService.CustomNameResolver> customNameResolvers)
-
-
Method Detail
-
resolveBindHostAddresses
public java.net.InetAddress[] resolveBindHostAddresses(java.lang.String[] bindHosts) throws java.io.IOExceptionResolvesbindHoststo 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:
java.io.IOException
-
resolvePublishHostAddresses
public java.net.InetAddress resolvePublishHostAddresses(java.lang.String[] publishHosts) throws java.io.IOExceptionResolvespublishHoststo 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:
java.io.IOException
-
-