Interface IgniteClientConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault background reconnect interval, in milliseconds.static final intDefault socket connect timeout, in milliseconds.static final intDefault heartbeat interval, in milliseconds.static final intDefault heartbeat timeout, in milliseconds.static final intDefault operation timeout, in milliseconds.static final intDefault port.static final intDefault size for partition awareness metadata cache. -
Method Summary
Modifier and TypeMethodDescriptionString[]Gets the addresses of Ignite server nodes within a cluster.Gets the address finder.@Nullable ExecutorGets the async continuation executor.@Nullable IgniteClientAuthenticatorGets the authenticator.longGets the background reconnect interval, in milliseconds.@Nullable ClientCacheConfigurationReturns the client cache configuration.longGets the socket connect timeout, in milliseconds.longGets the heartbeat message interval, in milliseconds.longGets the heartbeat message timeout, in milliseconds.@Nullable LoggerFactoryReturns the logger factory.booleanGets a value indicating whether JMX metrics are enabled.@Nullable Stringname()Gets the client name.longGets the operation timeout, in milliseconds.@Nullable RetryPolicyGets the retry policy.intGets the size of cache to store partition awareness metadata of sql queries, in number of entries.@Nullable SslConfigurationssl()Returns the client SSL configuration.
-
Field Details
-
DFLT_PORT
static final int DFLT_PORTDefault port.- See Also:
-
DFLT_CONNECT_TIMEOUT
static final int DFLT_CONNECT_TIMEOUTDefault socket connect timeout, in milliseconds.- See Also:
-
DFLT_HEARTBEAT_TIMEOUT
static final int DFLT_HEARTBEAT_TIMEOUTDefault heartbeat timeout, in milliseconds.- See Also:
-
DFLT_HEARTBEAT_INTERVAL
static final int DFLT_HEARTBEAT_INTERVALDefault heartbeat interval, in milliseconds.- See Also:
-
DFLT_BACKGROUND_RECONNECT_INTERVAL
static final long DFLT_BACKGROUND_RECONNECT_INTERVALDefault background reconnect interval, in milliseconds.- See Also:
-
DFLT_OPERATION_TIMEOUT
static final int DFLT_OPERATION_TIMEOUTDefault operation timeout, in milliseconds.- See Also:
-
DFLT_SQL_PARTITION_AWARENESS_METADATA_CACHE_SIZE
static final int DFLT_SQL_PARTITION_AWARENESS_METADATA_CACHE_SIZEDefault size for partition awareness metadata cache.- See Also:
-
-
Method Details
-
addressesFinder
IgniteClientAddressFinder addressesFinder()Gets the address finder.- Returns:
- Address finder.
-
addresses
String[] addresses()Gets the addresses of Ignite server nodes within a cluster. An address can be an IP address or a hostname, with or without port. If port is not set then Ignite will useDFLT_PORT.Providing addresses of multiple nodes in the cluster will improve performance: Ignite will balance requests across all connections, and use partition awareness to send key-based requests directly to the primary node.
- Returns:
- Addresses.
-
retryPolicy
Gets the retry policy. When a request fails due to a connection error, and multiple server connections are available, Ignite will retry the request if the specified policy allows it.- Returns:
- Retry policy.
-
connectTimeout
long connectTimeout()Gets the socket connect timeout, in milliseconds.- Returns:
- Socket connect timeout, in milliseconds.
-
backgroundReconnectInterval
long backgroundReconnectInterval()Gets the background reconnect interval, in milliseconds. Set to0to disable background reconnect. Default isDFLT_BACKGROUND_RECONNECT_INTERVAL.Ignite balances requests across all healthy connections (when multiple endpoints are configured). Ignite also repairs connections on demand (when a request is made). However, "secondary" connections can be lost (due to network issues, or node restarts). This property controls how ofter Ignite client will check all configured endpoints and try to reconnect them in case of failure.
- Returns:
- Background reconnect interval, in milliseconds.
-
asyncContinuationExecutor
Gets the async continuation executor.When
null(default),ForkJoinPool.commonPool()is used.When async client operation completes, corresponding
CompletableFuturecontinuations (such asCompletableFuture.thenApply(Function)) will be invoked using this executor.Server responses are handled by a dedicated network thread. To ensure optimal performance, this thread should not perform any extra work, so user-defined continuations are offloaded to the specified executor.
- Returns:
- Executor for async continuations.
-
heartbeatInterval
long heartbeatInterval()Gets the heartbeat message interval, in milliseconds. Default isDFLT_HEARTBEAT_INTERVAL.When server-side idle timeout 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.
- Returns:
- Heartbeat interval.
-
heartbeatTimeout
long heartbeatTimeout()Gets the heartbeat message timeout, in milliseconds. Default isDFLT_HEARTBEAT_TIMEOUT.When a server does not respond to a heartbeat within the specified timeout, client will close the connection.
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.
- Returns:
- Heartbeat interval.
-
loggerFactory
Returns the logger factory. This factory will be used to create a logger instance when needed.When
null(default),System.getLogger(java.lang.String)is used.- Returns:
- Configured logger factory.
-
ssl
Returns the client SSL configuration. This configuration will be used to setup the SSL connection with the Ignite 3 nodes.When
nullthen no SSL is used.- Returns:
- Client SSL configuration.
-
metricsEnabled
boolean metricsEnabled()Gets a value indicating whether JMX metrics are enabled. SeeIgniteClient.Builder.metricsEnabled(boolean)for more details.- Returns:
trueif metrics are enabled.
-
authenticator
Gets the authenticator.See also:
BasicAuthenticator.- Returns:
- Authenticator.
-
operationTimeout
long operationTimeout()Gets the operation timeout, in milliseconds. Default is0(no timeout).An "operation" is a single client request to the server. Some public API calls may involve multiple operations, in which case the operation timeout is applied to each individual network call.
- Returns:
- Operation timeout, in milliseconds.
-
cacheConfiguration
Returns the client cache configuration.- Returns:
- Client cache configuration.
-
sqlPartitionAwarenessMetadataCacheSize
int sqlPartitionAwarenessMetadataCacheSize()Gets the size of cache to store partition awareness metadata of sql queries, in number of entries. Default is 1024.SQL partition awareness feature improves query performance by directing queries to the specific server nodes that hold the relevant data, minimizing network overhead. Ignite client builds the metadata cache during the initial query execution and leverages this cache to speed up subsequent queries.
Every instance of
IgniteSqlhas its own cache. Every unique pair of (defaultSchema, queryString) reserve its own place in metadata cache, if metadata is available for this particular query. In general, metadata is available for queries which have equality predicate over all colocation columns, or which inserts the whole tuple. Let's consider the following example:// Creates reservations table. Please mind theCOLOCATE BY (floor_no): all reservations are colocated by //floor_no. CREATE TABLE RoomsReservations (room_no INT, floor_no INT, PRIMARY_KEY (room_no, floor_no)) COLOCATE BY (floor_no); // Here, we are selecting all reserved rooms on a particular floor. All reservation are colocated byfloor_no, // therefore having predicate likefloor_no = ?make it possible to compute a partition which keeps the data of // interest. Which in turn makes it possible to send the query directly to the node that hold the relevant data. SELECT room_no FROM RoomsReservations WHERE floor_no = ?; // Similar with INSERT: since values of dynamic parameters are known on a client, it makes it possible to route the // query directly to the node that hold the relevant data. INSERT INTO RoomsReservations(room_no, floor_no) VALUES(?, ?);- Returns:
- Cache size, in number of entries.
-
name
Gets the client name. Default isnull, which means that Ignite will generate a unique name automatically.Client name is used for identifying clients in JMX metrics. The name is only used locally and is not sent to the server.
If multiple clients with the same exist in the same JVM, JMX metrics will be exposed only for one of them. Others will log an error.
- Returns:
- Client name.
-