public class ConnectorConfiguration extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_IDLE_TIMEOUT
Default REST idle timeout.
|
static long |
DFLT_KEEP_ALIVE_TIME
Default keep alive time for REST thread pool.
|
static int |
DFLT_PORT_RANGE
Default rest port range.
|
static int |
DFLT_REST_CORE_THREAD_CNT
Default size of REST thread pool.
|
static int |
DFLT_REST_MAX_THREAD_CNT
Default max size of REST thread pool.
|
static int |
DFLT_SOCK_BUF_SIZE
Default socket send and receive buffer size.
|
static boolean |
DFLT_TCP_DIRECT_BUF
Default TCP direct buffer flag.
|
static boolean |
DFLT_TCP_NODELAY
Default TCP_NODELAY flag.
|
static int |
DFLT_TCP_PORT
Default TCP server port.
|
static int |
DFLT_THREADPOOL_QUEUE_CAP
Default max queue capacity of REST thread pool.
|
| Constructor and Description |
|---|
ConnectorConfiguration()
Creates client connection configuration with all default values.
|
ConnectorConfiguration(ConnectorConfiguration cfg)
Creates client connection configuration by copying all properties from
given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getHost()
Gets host for TCP binary protocol server.
|
long |
getIdleQueryCursorCheckFrequency()
Gets idle query cursors check frequency.
|
long |
getIdleQueryCursorTimeout()
Gets idle query cursors timeout in milliseconds.
|
long |
getIdleTimeout()
Gets idle timeout for REST server.
|
String |
getJettyPath()
Gets path, either absolute or relative to
IGNITE_HOME, to Jetty
XML configuration file. |
ConnectorMessageInterceptor |
getMessageInterceptor()
Gets interceptor for objects, moving to and from remote clients.
|
int |
getPort()
Gets port for TCP binary protocol server.
|
int |
getPortRange()
Gets number of ports to try if configured port is already in use.
|
int |
getReceiveBufferSize()
Gets REST TCP server receive buffer size.
|
String |
getSecretKey()
Gets secret key to authenticate REST requests.
|
int |
getSelectorCount()
Gets number of selector threads in REST TCP server.
|
int |
getSendBufferSize()
Gets REST TCP server send buffer size.
|
int |
getSendQueueLimit()
Gets REST TCP server send queue limit.
|
org.apache.ignite.internal.client.ssl.GridSslContextFactory |
getSslContextFactory()
Deprecated.
Use
getSslFactory() instead. |
javax.cache.configuration.Factory<SSLContext> |
getSslFactory()
Gets context factory that will be used for creating a secure socket layer of rest binary server.
|
int |
getThreadPoolSize()
Should return a thread pool size to be used for
processing of client messages (REST requests).
|
boolean |
isDirectBuffer()
Gets flag indicating whether REST TCP server should use direct buffers.
|
boolean |
isNoDelay()
Gets flag indicating whether
TCP_NODELAY option should be set for accepted client connections. |
boolean |
isSslClientAuth()
Gets a flag indicating whether or not remote clients will be required to have a valid SSL certificate which
validity will be verified with trust manager.
|
boolean |
isSslEnabled()
Whether secure socket layer should be enabled on binary rest server.
|
void |
setDirectBuffer(boolean directBuf)
Sets whether to use direct buffer for REST TCP server.
|
void |
setHost(String host)
Sets host for TCP binary protocol server.
|
void |
setIdleQueryCursorCheckFrequency(long idleQryCurCheckFreq)
Sets idle query cursor check frequency.
|
void |
setIdleQueryCursorTimeout(long idleQryCurTimeout)
Sets idle query cursors timeout.
|
void |
setIdleTimeout(long idleTimeout)
Sets idle timeout for REST server.
|
void |
setJettyPath(String jettyPath)
Sets path, either absolute or relative to
IGNITE_HOME, to JETTY
XML configuration file. |
void |
setMessageInterceptor(ConnectorMessageInterceptor interceptor)
Sets client message interceptor.
|
void |
setNoDelay(boolean noDelay)
Sets whether
TCP_NODELAY option should be set for all accepted client connections. |
void |
setPort(int port)
Sets port for TCP binary protocol server.
|
void |
setPortRange(int portRange)
Sets number of ports to try if configured one is in use.
|
void |
setReceiveBufferSize(int rcvBufSize)
Sets REST TCP server receive buffer size.
|
void |
setSecretKey(String secretKey)
Sets secret key to authenticate REST requests.
|
void |
setSelectorCount(int selectorCnt)
Sets number of selector threads for REST TCP server.
|
void |
setSendBufferSize(int sndBufSize)
Sets REST TCP server send buffer size.
|
void |
setSendQueueLimit(int sndQueueLimit)
Sets REST TCP server send queue limit.
|
void |
setSslClientAuth(boolean sslClientAuth)
Sets flag indicating whether or not SSL client authentication is required.
|
void |
setSslContextFactory(org.apache.ignite.internal.client.ssl.GridSslContextFactory sslCtxFactory)
Deprecated.
Use
setSslFactory(Factory) instead. |
void |
setSslEnabled(boolean sslEnabled)
Sets whether Secure Socket Layer should be enabled for REST TCP binary protocol.
|
void |
setSslFactory(javax.cache.configuration.Factory<SSLContext> sslFactory)
Sets instance of
Factory that will be used to create an instance of SSLContext
for Secure Socket Layer on TCP binary protocol. |
void |
setThreadPoolSize(int threadPoolSize)
Sets thread pool size to use for processing of client messages (REST requests).
|
public static final int DFLT_TCP_PORT
public static final boolean DFLT_TCP_NODELAY
public static final boolean DFLT_TCP_DIRECT_BUF
public static final int DFLT_IDLE_TIMEOUT
public static final int DFLT_PORT_RANGE
public static final int DFLT_REST_CORE_THREAD_CNT
public static final int DFLT_REST_MAX_THREAD_CNT
public static final long DFLT_KEEP_ALIVE_TIME
public static final int DFLT_THREADPOOL_QUEUE_CAP
public static final int DFLT_SOCK_BUF_SIZE
public ConnectorConfiguration()
public ConnectorConfiguration(ConnectorConfiguration cfg)
cfg - Client configuration.public void setJettyPath(String jettyPath)
IGNITE_HOME, to JETTY
XML configuration file. JETTY is used to support REST over HTTP protocol for
accessing Ignite APIs remotely.jettyPath - Path to JETTY XML configuration file.public String getJettyPath()
IGNITE_HOME, to Jetty
XML configuration file. Jetty is used to support REST over HTTP protocol for
accessing Ignite APIs remotely.
If not provided, Jetty instance with default configuration will be started picking
IgniteSystemProperties.IGNITE_JETTY_HOST and IgniteSystemProperties.IGNITE_JETTY_PORT
as host and port respectively.
JETTY XML configuration file.IgniteSystemProperties.IGNITE_JETTY_HOST,
IgniteSystemProperties.IGNITE_JETTY_PORTpublic void setSecretKey(@Nullable
String secretKey)
null or empty authentication is disabled.secretKey - REST secret key.@Nullable public String getSecretKey()
null or empty authentication is disabled.IgniteSystemProperties.IGNITE_JETTY_HOST,
IgniteSystemProperties.IGNITE_JETTY_PORTpublic String getHost()
If not defined, system-wide local address will be used
(see IgniteConfiguration.getLocalHost().
You can also use 0.0.0.0 value to bind to all
locally-available IP addresses.
public void setHost(String host)
host - TCP host.public int getPort()
Default is DFLT_TCP_PORT.
public void setPort(int port)
port - TCP port.public boolean isNoDelay()
TCP_NODELAY option should be set for accepted client connections.
Setting this option reduces network latency and should be set to true in majority of cases.
For more information, see Socket.setTcpNoDelay(boolean)
If not specified, default value is DFLT_TCP_NODELAY.TCP_NODELAY option should be enabled.public void setNoDelay(boolean noDelay)
TCP_NODELAY option should be set for all accepted client connections.noDelay - True if option should be enabled.isNoDelay()public boolean isDirectBuffer()
public void setDirectBuffer(boolean directBuf)
directBuf - True if option should be enabled.isDirectBuffer()public int getSendBufferSize()
public void setSendBufferSize(int sndBufSize)
sndBufSize - Send buffer size.getSendBufferSize()public int getReceiveBufferSize()
public void setReceiveBufferSize(int rcvBufSize)
rcvBufSize - Receive buffer size.getReceiveBufferSize()public int getSendQueueLimit()
public void setSendQueueLimit(int sndQueueLimit)
sndQueueLimit - REST TCP server send queue limit (0 for unlimited).getSendQueueLimit()public int getSelectorCount()
public void setSelectorCount(int selectorCnt)
selectorCnt - Number of selector threads for REST TCP server.getSelectorCount()public long getIdleTimeout()
This setting is used to reject half-opened sockets. If no packets come within idle timeout, the connection is closed.
public void setIdleTimeout(long idleTimeout)
idleTimeout - Idle timeout in milliseconds.getIdleTimeout()public boolean isSslEnabled()
Note that if this flag is set to true, an instance of GridSslContextFactory
should be provided, otherwise binary rest protocol will fail to start.
True if SSL should be enabled.public void setSslEnabled(boolean sslEnabled)
true, then a valid instance of GridSslContextFactory
should be provided in IgniteConfiguration. Otherwise, TCP binary protocol will fail to start.sslEnabled - True if SSL should be enabled.public boolean isSslClientAuth()
public void setSslClientAuth(boolean sslClientAuth)
sslClientAuth - Whether or not client authentication is required.@Deprecated public org.apache.ignite.internal.client.ssl.GridSslContextFactory getSslContextFactory()
getSslFactory() instead.GridSslContextFactory@Deprecated public void setSslContextFactory(org.apache.ignite.internal.client.ssl.GridSslContextFactory sslCtxFactory)
setSslFactory(Factory) instead.GridSslContextFactory that will be used to create an instance of SSLContext
for Secure Socket Layer on TCP binary protocol. This factory will only be used if
setSslEnabled(boolean) is set to true.sslCtxFactory - Instance of GridSslContextFactorypublic javax.cache.configuration.Factory<SSLContext> getSslFactory()
SslContextFactorypublic void setSslFactory(javax.cache.configuration.Factory<SSLContext> sslFactory)
Factory that will be used to create an instance of SSLContext
for Secure Socket Layer on TCP binary protocol. This factory will only be used if
setSslEnabled(boolean) is set to true.sslFactory - Instance of Factorypublic int getPortRange()
public void setPortRange(int portRange)
portRange - Port range.public int getThreadPoolSize()
public void setThreadPoolSize(int threadPoolSize)
threadPoolSize - Thread pool size to use for processing of client messages.getThreadPoolSize()@Nullable public ConnectorMessageInterceptor getMessageInterceptor()
null then no interception will be applied.
Setting interceptor allows to transform all objects exchanged via REST protocol. For example if you use custom serialisation on client you can write interceptor to transform binary representations received from client to Java objects and later access them from java code directly.
Default value is null.
ConnectorMessageInterceptorpublic void setMessageInterceptor(ConnectorMessageInterceptor interceptor)
Setting interceptor allows to transform all objects exchanged via REST protocol. For example if you use custom serialisation on client you can write interceptor to transform binary representations received from client to Java objects and later access them from java code directly.
interceptor - Interceptor.public void setIdleQueryCursorTimeout(long idleQryCurTimeout)
idleQryCurTimeout - Idle query cursors timeout in milliseconds.getIdleQueryCursorTimeout()public long getIdleQueryCursorTimeout()
This setting is used to reject open query cursors that is not used. If no fetch query request
come within idle timeout, it will be removed on next check for old query cursors
(see getIdleQueryCursorCheckFrequency()).
public void setIdleQueryCursorCheckFrequency(long idleQryCurCheckFreq)
idleQryCurCheckFreq - Idle query check frequency in milliseconds.getIdleQueryCursorCheckFrequency()public long getIdleQueryCursorCheckFrequency()
Scheduler tries with specified period to close queries' cursors that are overtime.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016