public final class ClientConfiguration extends Object implements Serializable
TcpIgniteClient
configuration.Constructor and Description |
---|
ClientConfiguration() |
public String[] getAddresses()
public ClientConfiguration setAddresses(String... addrs)
ClientConnectorConfiguration.DFLT_PORT
, ClientConnectorConfiguration.DFLT_PORT_RANGE
.addrs
- Host addresses.this
for chaining.public ClientAddressFinder getAddressesFinder()
public ClientConfiguration setAddressesFinder(ClientAddressFinder finder)
finder
- Finds server node addresses.this
for chaining.public boolean isTcpNoDelay()
public ClientConfiguration setTcpNoDelay(boolean tcpNoDelay)
tcpNoDelay
- whether Nagle's algorithm is enabled.this
for chaining.public int getTimeout()
public ClientConfiguration setTimeout(int timeout)
timeout
- Send/receive timeout in milliseconds.this
for chaining.public int getSendBufferSize()
public ClientConfiguration setSendBufferSize(int sndBufSize)
sndBufSize
- Send buffer size.this
for chaining.public int getReceiveBufferSize()
public ClientConfiguration setReceiveBufferSize(int rcvBufSize)
rcvBufSize
- Send buffer size.this
for chaining.public BinaryConfiguration getBinaryConfiguration()
public ClientConfiguration setBinaryConfiguration(BinaryConfiguration binaryCfg)
binaryCfg
- Configuration for Ignite Binary objects.this
for chaining.public SslMode getSslMode()
public ClientConfiguration setSslMode(SslMode sslMode)
sslMode
- SSL mode.this
for chaining.public String getSslClientCertificateKeyStorePath()
public ClientConfiguration setSslClientCertificateKeyStorePath(String newVal)
newVal
- Ssl client certificate key store path.this
for chaining.public String getSslClientCertificateKeyStorePassword()
public ClientConfiguration setSslClientCertificateKeyStorePassword(String newVal)
newVal
- Ssl client certificate key store password.this
for chaining.public String getSslClientCertificateKeyStoreType()
public ClientConfiguration setSslClientCertificateKeyStoreType(String newVal)
newVal
- Ssl client certificate key store type.this
for chaining.public String getSslTrustCertificateKeyStorePath()
public ClientConfiguration setSslTrustCertificateKeyStorePath(String newVal)
newVal
- Ssl trust certificate key store path.this
for chaining.public String getSslTrustCertificateKeyStorePassword()
public ClientConfiguration setSslTrustCertificateKeyStorePassword(String newVal)
newVal
- Ssl trust certificate key store password.this
for chaining.public String getSslTrustCertificateKeyStoreType()
public ClientConfiguration setSslTrustCertificateKeyStoreType(String newVal)
newVal
- Ssl trust certificate key store type.this
for chaining.public String getSslKeyAlgorithm()
public ClientConfiguration setSslKeyAlgorithm(String newVal)
newVal
- Ssl key algorithm.this
for chaining.public boolean isSslTrustAll()
public ClientConfiguration setSslTrustAll(boolean newVal)
newVal
- Flag indicating if certificate validation errors should be ignored.this
for chaining.public SslProtocol getSslProtocol()
public ClientConfiguration setSslProtocol(SslProtocol newVal)
newVal
- Ssl protocol.this
for chaining.public String getUserName()
public ClientConfiguration setUserName(String newVal)
newVal
- User name.this
for chaining.public String getUserPassword()
public ClientConfiguration setUserPassword(String newVal)
newVal
- User password.this
for chaining.public javax.cache.configuration.Factory<SSLContext> getSslContextFactory()
public ClientConfiguration setSslContextFactory(javax.cache.configuration.Factory<SSLContext> newVal)
newVal
- SSL Context Factory.this
for chaining.public ClientTransactionConfiguration getTransactionConfiguration()
public ClientConfiguration setTransactionConfiguration(ClientTransactionConfiguration txCfg)
txCfg
- Transactions configuration.this
for chaining.public boolean isPartitionAwarenessEnabled()
Default is true
: client sends requests directly to the primary node for the given cache key.
To do so, connection is established to every known server node.
false
, only one connection is established at a given moment to a random server node.
Partition awareness functionality helps to avoid an additional network hop in the following scenarios:
ClientTransactions.txStart()
.ScanQuery.setPartition(Integer)
and IndexQuery.setPartition(Integer)
accept a
partition number as a parameter with which the query is routed to a particular server node that stores
the requested data.public ClientConfiguration setPartitionAwarenessEnabled(boolean partitionAwarenessEnabled)
Default is true
: client sends requests directly to the primary node for the given cache key.
To do so, connection is established to every known server node.
false
, only one connection is established at a given moment to a random server node.
Partition awareness functionality helps to avoid an additional network hop in the following scenarios:
ClientTransactions.txStart()
.ScanQuery.setPartition(Integer)
and IndexQuery.setPartition(Integer)
accept
a partition number as a parameter with which the query is routed to a particular server node that stores
the requested data.partitionAwarenessEnabled
- Value indicating whether partition awareness should be enabled.this
for chaining.public boolean isClusterDiscoveryEnabled()
Default is true
: client get addresses of server nodes from the cluster and connects to all of them.
When false
, client only connects to the addresses provided in setAddresses(String...)
and
setAddressesFinder(ClientAddressFinder)
.
public ClientConfiguration setClusterDiscoveryEnabled(boolean clusterDiscoveryEnabled)
Default is true
: client get addresses of server nodes from the cluster and connects to all of them.
When false
, client only connects to the addresses provided in setAddresses(String...)
and
setAddressesFinder(ClientAddressFinder)
.
clusterDiscoveryEnabled
- Value indicating whether cluster discovery should be enabled.this
for chaining.public long getReconnectThrottlingPeriod()
public ClientConfiguration setReconnectThrottlingPeriod(long reconnectThrottlingPeriod)
reconnectThrottlingPeriod
- Reconnect throttling period.this
for chaining.public int getReconnectThrottlingRetries()
public ClientConfiguration setReconnectThrottlingRetries(int reconnectThrottlingRetries)
reconnectThrottlingRetries
- Reconnect throttling retries.this
for chaining.public int getRetryLimit()
public ClientConfiguration setRetryLimit(int retryLimit)
retryLimit
- Retry limit.this
for chaining.public ClientRetryPolicy getRetryPolicy()
public ClientConfiguration setRetryPolicy(ClientRetryPolicy retryPolicy)
retryLimit
is set, retry count will be limited even if the specified policy returns true
.
Default is ClientRetryAllPolicy
.retryPolicy
- Retry policy.this
for chaining.public Map<String,String> getUserAttributes()
public ClientConfiguration setUserAttributes(Map<String,String> userAttrs)
GridRestRequest
or
ClientListenerAbstractConnectionContext
(depends on client type).userAttrs
- User attributes.this
for chaining.public Executor getAsyncContinuationExecutor()
null
(default), ForkJoinPool.commonPool()
is used.
When async client operation completes, corresponding IgniteFuture
listeners
will be invoked using this executor. Thin client operation results are handled by a dedicated thread.
This thread should be free from any extra work, and should not be not be used to execute future listeners
directly.public ClientConfiguration setAsyncContinuationExecutor(Executor asyncContinuationExecutor)
null
(default), ForkJoinPool.commonPool()
is used.
When async client operation completes, corresponding IgniteFuture
listeners
will be invoked using this executor. Thin client operation results are handled by a dedicated thread.
This thread should be free from any extra work, and should not be not be used to execute future listeners
directly.asyncContinuationExecutor
- Executor for async continuations.this
for chaining.public boolean isHeartbeatEnabled()
heartbeatInterval
.public ClientConfiguration setHeartbeatEnabled(boolean heartbeatEnabled)
heartbeatInterval
.heartbeatEnabled
- Whether to enable heartbeats.this
for chaining.public long getHeartbeatInterval()
30_000
.
When server-side ClientConnectorConfiguration.getIdleTimeout()
is not zero, effective heartbeat
interval is set to min(heartbeatInterval, idleTimeout / 3)
.
When thin client connection is idle (no operations are performed), heartbeat messages are sent periodically
to keep the connection alive and detect potential half-open state. *public ClientConfiguration setHeartbeatInterval(long heartbeatInterval)
30_000
.
When server-side ClientConnectorConfiguration.getIdleTimeout()
is not zero, effective heartbeat
interval is set to min(heartbeatInterval, idleTimeout / 3)
.
When thin client connection is idle (no operations are performed), heartbeat messages are sent periodically
to keep the connection alive and detect potential half-open state. *heartbeatInterval
- Heartbeat interval, in milliseconds.this
for chaining.public boolean isAutoBinaryConfigurationEnabled()
BinaryConfiguration.isCompactFooter()
)
and name mapper (BinaryConfiguration.getNameMapper()
) settings will be retrieved from the server
to match the cluster configuration.
Default is true
.public ClientConfiguration setAutoBinaryConfigurationEnabled(boolean autoBinaryConfigurationEnabled)
BinaryConfiguration.isCompactFooter()
)
and name mapper (BinaryConfiguration.getNameMapper()
) settings will be retrieved from the server
to match the cluster configuration.
Default is true
.autoBinaryConfigurationEnabled
- Whether automatic binary configuration is enabled.this
for chaining.public ClientConfiguration setPartitionAwarenessMapperFactory(ClientPartitionAwarenessMapperFactory factory)
factory
- Factory that accepts as parameters a cache name and the number of cache partitions received from a server node
and produces key to partition mapping functions.this
for chaining.public ClientPartitionAwarenessMapperFactory getPartitionAwarenessMapperFactory()
public ClientConfiguration setLogger(IgniteLogger logger)
logger
- Logger.this
for chaining.public IgniteLogger getLogger()
public ClientConfiguration setEventListeners(EventListener... listeners)
listeners
- Clent event listeners.this
for chaining.public EventListener[] getEventListeners()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023