Package com.github.ambry.config
Class NetworkConfig
- java.lang.Object
-
- com.github.ambry.config.NetworkConfig
-
public class NetworkConfig extends java.lang.Object
The configs for network layer
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
HOST_NAME
java.lang.String
hostName
Hostname of server.static java.lang.String
NETWORK_CLIENT_ENABLE_CONNECTION_REPLENISHMENT
static java.lang.String
NETWORK_CLIENT_MAX_REPLENISHMENT_PER_HOST_PER_SECOND
boolean
networkClientEnableConnectionReplenishment
Whether the client should attempt to replenish connections when the number of connections to a host drops below a minimum number of active connections.int
networkClientMaxReplenishmentPerHostPerSecond
The max number of new connections to a remote host that should be created per second when replenishing connections.static java.lang.String
NUM_IO_THREADS
int
numIoThreads
The number of io threads that the server uses for carrying out network requestsint
port
The port to listen and accept connections onstatic java.lang.String
PORT
static java.lang.String
QUEUED_MAX_REQUESTS
int
queuedMaxRequests
The number of queued requests allowed before blocking the network threadsstatic java.lang.String
SELECTOR_EXECUTOR_POOL_SIZE
static java.lang.String
SELECTOR_MAX_KEY_TO_PROCESS
static java.lang.String
SELECTOR_USE_DIRECT_BUFFERS
int
selectorExecutorPoolSize
The size of the pool if selector executor pool is employed.int
selectorMaxKeyToProcess
The max number of ready keys can be processed in a selector.poll() call.boolean
selectorUseDirectBuffers
True to allocate direct buffers within the selector (for things like SSL work).static java.lang.String
SOCKET_RECEIVE_BUFFER_BYTES
static java.lang.String
SOCKET_REQUEST_MAX_BYTES
static java.lang.String
SOCKET_SEND_BUFFER_BYTES
int
socketReceiveBufferBytes
The SO_RCVBUFF buffer of the socket sever socketsint
socketRequestMaxBytes
The maximum number of bytes in a socket requestint
socketSendBufferBytes
The SO_SNDBUFF buffer of the socket sever sockets
-
Constructor Summary
Constructors Constructor Description NetworkConfig(VerifiableProperties verifiableProperties)
-
-
-
Field Detail
-
NUM_IO_THREADS
public static final java.lang.String NUM_IO_THREADS
- See Also:
- Constant Field Values
-
QUEUED_MAX_REQUESTS
public static final java.lang.String QUEUED_MAX_REQUESTS
- See Also:
- Constant Field Values
-
PORT
public static final java.lang.String PORT
- See Also:
- Constant Field Values
-
HOST_NAME
public static final java.lang.String HOST_NAME
- See Also:
- Constant Field Values
-
SOCKET_SEND_BUFFER_BYTES
public static final java.lang.String SOCKET_SEND_BUFFER_BYTES
- See Also:
- Constant Field Values
-
SOCKET_RECEIVE_BUFFER_BYTES
public static final java.lang.String SOCKET_RECEIVE_BUFFER_BYTES
- See Also:
- Constant Field Values
-
SOCKET_REQUEST_MAX_BYTES
public static final java.lang.String SOCKET_REQUEST_MAX_BYTES
- See Also:
- Constant Field Values
-
NETWORK_CLIENT_ENABLE_CONNECTION_REPLENISHMENT
public static final java.lang.String NETWORK_CLIENT_ENABLE_CONNECTION_REPLENISHMENT
- See Also:
- Constant Field Values
-
NETWORK_CLIENT_MAX_REPLENISHMENT_PER_HOST_PER_SECOND
public static final java.lang.String NETWORK_CLIENT_MAX_REPLENISHMENT_PER_HOST_PER_SECOND
- See Also:
- Constant Field Values
-
SELECTOR_EXECUTOR_POOL_SIZE
public static final java.lang.String SELECTOR_EXECUTOR_POOL_SIZE
- See Also:
- Constant Field Values
-
SELECTOR_MAX_KEY_TO_PROCESS
public static final java.lang.String SELECTOR_MAX_KEY_TO_PROCESS
- See Also:
- Constant Field Values
-
SELECTOR_USE_DIRECT_BUFFERS
public static final java.lang.String SELECTOR_USE_DIRECT_BUFFERS
- See Also:
- Constant Field Values
-
numIoThreads
@Config("num.io.threads") @Default("8") public final int numIoThreads
The number of io threads that the server uses for carrying out network requests
-
queuedMaxRequests
@Config("queued.max.requests") @Default("500") public final int queuedMaxRequests
The number of queued requests allowed before blocking the network threads
-
port
@Config("port") @Default("6667") public final int port
The port to listen and accept connections on
-
hostName
@Config("host.name") @Default("localhost") public final java.lang.String hostName
Hostname of server. If this is set, it will only bind to this address. If this is not set, it will bind to all interfaces, and publish one to ZK
-
socketSendBufferBytes
@Config("socket.send.buffer.bytes") @Default("1048576") public final int socketSendBufferBytes
The SO_SNDBUFF buffer of the socket sever sockets
-
socketReceiveBufferBytes
@Config("socket.receive.buffer.bytes") @Default("1048576") public final int socketReceiveBufferBytes
The SO_RCVBUFF buffer of the socket sever sockets
-
socketRequestMaxBytes
@Config("socket.request.max.bytes") @Default("104857600") public final int socketRequestMaxBytes
The maximum number of bytes in a socket request
-
networkClientEnableConnectionReplenishment
@Config("network.client.enable.connection.replenishment") @Default("false") public final boolean networkClientEnableConnectionReplenishment
Whether the client should attempt to replenish connections when the number of connections to a host drops below a minimum number of active connections.
-
networkClientMaxReplenishmentPerHostPerSecond
@Config("network.client.max.replenishment.per.host.per.second") @Default("1") public final int networkClientMaxReplenishmentPerHostPerSecond
The max number of new connections to a remote host that should be created per second when replenishing connections.
-
selectorExecutorPoolSize
@Config("selector.executor.pool.size") @Default("4") public final int selectorExecutorPoolSize
The size of the pool if selector executor pool is employed. When size is 0, executor pool won't be used.
-
selectorMaxKeyToProcess
@Config("selector.max.key.to.process") @Default("-1") public final int selectorMaxKeyToProcess
The max number of ready keys can be processed in a selector.poll() call. No limitation if -1 is used.
-
-
Constructor Detail
-
NetworkConfig
public NetworkConfig(VerifiableProperties verifiableProperties)
-
-