Package org.apache.ignite.client
Class ClientCacheConfiguration
- java.lang.Object
-
- org.apache.ignite.client.ClientCacheConfiguration
-
- All Implemented Interfaces:
Serializable
public final class ClientCacheConfiguration extends Object implements Serializable
Cache configuration.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ClientCacheConfiguration()Default constructor.ClientCacheConfiguration(ClientCacheConfiguration ccfg)Creates client cache configuration by coping all configuration properties from the given one.
-
Method Summary
-
-
-
Constructor Detail
-
ClientCacheConfiguration
public ClientCacheConfiguration()
Default constructor.
-
ClientCacheConfiguration
public ClientCacheConfiguration(ClientCacheConfiguration ccfg)
Creates client cache configuration by coping all configuration properties from the given one.- Parameters:
ccfg- Client cache configuration to copy from.
-
-
Method Detail
-
getName
public String getName()
- Returns:
- Cache name.
-
setName
public ClientCacheConfiguration setName(String name)
- Parameters:
name- New cache name.- Returns:
thisfor chaining.
-
getAtomicityMode
public CacheAtomicityMode getAtomicityMode()
- Returns:
- Cache atomicity mode.
-
setAtomicityMode
public ClientCacheConfiguration setAtomicityMode(CacheAtomicityMode atomicityMode)
- Parameters:
atomicityMode- New Atomicity mode.- Returns:
thisfor chaining.
-
getBackups
public int getBackups()
- Returns:
- Number of backups.
-
setBackups
public ClientCacheConfiguration setBackups(int backups)
- Parameters:
backups- New number of backups.- Returns:
thisfor chaining.
-
getCacheMode
public CacheMode getCacheMode()
- Returns:
- Cache mode.
-
setCacheMode
public ClientCacheConfiguration setCacheMode(CacheMode cacheMode)
- Parameters:
cacheMode- New cache mode.- Returns:
thisfor chaining.
-
isEagerTtl
public boolean isEagerTtl()
Gets flag indicating whether expired cache entries will be eagerly removed from cache. If there is at least one cache configured with this flag set totrue, Ignite will create a single thread to clean up expired entries in background. When flag is set tofalse, expired entries will be removed on next entry access.- Returns:
- Flag indicating whether Ignite will eagerly remove expired entries.
-
setEagerTtl
public ClientCacheConfiguration setEagerTtl(boolean eagerTtl)
- Parameters:
eagerTtl-Trueif Ignite should eagerly remove expired cache entries.- Returns:
thisfor chaining.
-
getGroupName
public String getGroupName()
Gets the cache group name.Caches with the same group name share single underlying 'physical' cache (partition set), but are logically isolated. Grouping caches reduces overall overhead, since internal data structures are shared.
- Returns:
thisfor chaining.
-
setGroupName
public ClientCacheConfiguration setGroupName(String newVal)
- Parameters:
newVal- Group name.- Returns:
thisfor chaining.
-
getDefaultLockTimeout
@Deprecated public long getDefaultLockTimeout()
Deprecated.Default lock timeout configuration property has no effect.- Returns:
- Default lock acquisition timeout.
0and means that lock acquisition will never timeout.
-
setDefaultLockTimeout
@Deprecated public ClientCacheConfiguration setDefaultLockTimeout(long dfltLockTimeout)
Deprecated.Default lock timeout configuration property has no effect.- Parameters:
dfltLockTimeout- Default lock timeout.- Returns:
thisfor chaining.
-
getPartitionLossPolicy
public PartitionLossPolicy getPartitionLossPolicy()
- Returns:
- Partition loss policy. This policy defines how Ignite will react to a situation when all nodes for some partition leave the cluster.
-
setPartitionLossPolicy
public ClientCacheConfiguration setPartitionLossPolicy(PartitionLossPolicy newVal)
- Parameters:
newVal- Partition loss policy.- Returns:
thisfor chaining.
-
isReadFromBackup
public boolean isReadFromBackup()
- Returns:
- Flag indicating whether data can be read from backup.
If
falsealways get data from primary node (never from backup).
-
setReadFromBackup
public ClientCacheConfiguration setReadFromBackup(boolean readFromBackup)
- Parameters:
readFromBackup- Read from backup.- Returns:
thisfor chaining.
-
getRebalanceBatchSize
@Deprecated public int getRebalanceBatchSize()
Deprecated.UseIgniteConfiguration.getRebalanceBatchSize()instead.- Returns:
- Size (in number bytes) to be loaded within a single rebalance message. Rebalancing algorithm will split total data set on every node into multiple batches prior to sending data.
-
setRebalanceBatchSize
@Deprecated public ClientCacheConfiguration setRebalanceBatchSize(int rebalanceBatchSize)
Deprecated.UseIgniteConfiguration.setRebalanceBatchSize(int)instead.- Parameters:
rebalanceBatchSize- Rebalance batch size.- Returns:
thisfor chaining.
-
getRebalanceBatchesPrefetchCount
@Deprecated public long getRebalanceBatchesPrefetchCount()
Deprecated.To gain better rebalancing performance supplier node can provide more than one batch at rebalancing start and provide one new to each next demand request.- Returns:
- Number of batches generated by supply node at rebalancing start. Minimum is 1.
-
setRebalanceBatchesPrefetchCount
@Deprecated public ClientCacheConfiguration setRebalanceBatchesPrefetchCount(long rebalanceBatchesPrefetchCnt)
Deprecated.- Parameters:
rebalanceBatchesPrefetchCnt- Rebalance batches prefetch count.- Returns:
thisfor chaining.
-
getRebalanceDelay
@Deprecated public long getRebalanceDelay()
Deprecated.Use baseline topology feature instead. Please, be aware this API will be removed in the next releases.- Returns:
- Delay in milliseconds upon a node joining or leaving topology (or crash) after which rebalancing
should be started automatically. Rebalancing should be delayed if you plan to restart nodes
after they leave topology, or if you plan to start multiple nodes at once or one after another
and don't want to repartition and rebalance until all nodes are started.
Default value is
0which means that repartitioning and rebalancing will start immediately upon node leaving topology. If-1is returned, then rebalancing will only be started manually.
-
setRebalanceDelay
@Deprecated public ClientCacheConfiguration setRebalanceDelay(long rebalanceDelay)
Deprecated.Use baseline topology feature instead. Please, be aware this API will be removed in the next releases.- Parameters:
rebalanceDelay- Rebalance delay.- Returns:
thisfor chaining.
-
getRebalanceMode
public CacheRebalanceMode getRebalanceMode()
Gets rebalance mode.- Returns:
thisfor chaining.
-
setRebalanceMode
public ClientCacheConfiguration setRebalanceMode(CacheRebalanceMode rebalanceMode)
- Parameters:
rebalanceMode- Rebalance mode.- Returns:
thisfor chaining.
-
getRebalanceOrder
public int getRebalanceOrder()
- Returns:
- Cache rebalance order. Rebalance order can be set to non-zero value for caches with
SYNCorASYNCrebalance modes only. If cache rebalance order is positive, rebalancing for this cache will be started only when rebalancing for all caches with smaller rebalance order will be completed. Note that cache with order0does not participate in ordering. This means that cache with rebalance order0will never wait for any other caches. All caches with order0will be rebalanced right away concurrently with each other and ordered rebalance processes. If not set, cache order is 0, i.e. rebalancing is not ordered.
-
setRebalanceOrder
public ClientCacheConfiguration setRebalanceOrder(int rebalanceOrder)
- Parameters:
rebalanceOrder- Rebalance order.- Returns:
thisfor chaining.
-
getRebalanceThrottle
@Deprecated public long getRebalanceThrottle()
Deprecated.UseIgniteConfiguration.getRebalanceThrottle()instead.- Returns:
- Time in milliseconds to wait between rebalance messages to avoid overloading of CPU or network.
When rebalancing large data sets, the CPU or network can get over-consumed with rebalancing messages,
which consecutively may slow down the application performance. This parameter helps tune
the amount of time to wait between rebalance messages to make sure that rebalancing process
does not have any negative performance impact. Note that application will continue to work
properly while rebalancing is still in progress.
Default value of
0means that throttling is disabled.
-
setRebalanceThrottle
@Deprecated public ClientCacheConfiguration setRebalanceThrottle(long newVal)
Deprecated.UseIgniteConfiguration.setRebalanceThrottle(long)instead.- Parameters:
newVal- Rebalance throttle.- Returns:
thisfor chaining.
-
getRebalanceTimeout
@Deprecated public long getRebalanceTimeout()
Deprecated.UseIgniteConfiguration.getRebalanceTimeout()instead.- Returns:
- Rebalance timeout (ms).
-
setRebalanceTimeout
@Deprecated public ClientCacheConfiguration setRebalanceTimeout(long newVal)
Deprecated.UseIgniteConfiguration.getRebalanceTimeout()instead.- Parameters:
newVal- Rebalance timeout.- Returns:
thisfor chaining.
-
getWriteSynchronizationMode
public CacheWriteSynchronizationMode getWriteSynchronizationMode()
- Returns:
- Write synchronization mode. This mode controls whether the main caller should wait for update on other nodes to complete or not.
-
setWriteSynchronizationMode
public ClientCacheConfiguration setWriteSynchronizationMode(CacheWriteSynchronizationMode newVal)
- Parameters:
newVal- Write synchronization mode.- Returns:
thisfor chaining.
-
isCopyOnRead
public boolean isCopyOnRead()
- Returns:
- Copy on read.
-
setCopyOnRead
public ClientCacheConfiguration setCopyOnRead(boolean newVal)
- Parameters:
newVal- Copy on read.- Returns:
thisfor chaining.
-
getMaxConcurrentAsyncOperations
public int getMaxConcurrentAsyncOperations()
- Returns:
- Max concurrent async operations.
-
setMaxConcurrentAsyncOperations
public ClientCacheConfiguration setMaxConcurrentAsyncOperations(int newVal)
- Parameters:
newVal- Max concurrent async operations.- Returns:
thisfor chaining.
-
getDataRegionName
public String getDataRegionName()
- Returns:
- Data region name.
-
setDataRegionName
public ClientCacheConfiguration setDataRegionName(String newVal)
- Parameters:
newVal- Data region name.- Returns:
thisfor chaining.
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Returns:
- Statistics enabled.
-
setStatisticsEnabled
public ClientCacheConfiguration setStatisticsEnabled(boolean newVal)
- Parameters:
newVal- Statistics enabled.- Returns:
thisfor chaining.
-
getMaxQueryIteratorsCount
public int getMaxQueryIteratorsCount()
- Returns:
- Max query iterators count.
-
setMaxQueryIteratorsCount
public ClientCacheConfiguration setMaxQueryIteratorsCount(int newVal)
- Parameters:
newVal- Max query iterators count.- Returns:
thisfor chaining.
-
isOnheapCacheEnabled
public boolean isOnheapCacheEnabled()
- Returns:
- Onheap cache enabled.
-
setOnheapCacheEnabled
public ClientCacheConfiguration setOnheapCacheEnabled(boolean newVal)
- Parameters:
newVal- Onheap cache enabled.- Returns:
thisfor chaining.
-
getQueryDetailMetricsSize
public int getQueryDetailMetricsSize()
- Returns:
- Query detail metrics size.
-
setQueryDetailMetricsSize
public ClientCacheConfiguration setQueryDetailMetricsSize(int newVal)
- Parameters:
newVal- Query detail metrics size.- Returns:
thisfor chaining.
-
getQueryParallelism
public int getQueryParallelism()
- Returns:
- Query parallelism.
-
setQueryParallelism
public ClientCacheConfiguration setQueryParallelism(int newVal)
- Parameters:
newVal- Query parallelism.- Returns:
thisfor chaining.
-
isSqlEscapeAll
public boolean isSqlEscapeAll()
- Returns:
- Sql escape all.
-
setSqlEscapeAll
public ClientCacheConfiguration setSqlEscapeAll(boolean newVal)
- Parameters:
newVal- Sql escape all.- Returns:
thisfor chaining.
-
getSqlIndexMaxInlineSize
public int getSqlIndexMaxInlineSize()
- Returns:
- Sql index max inline size.
-
setSqlIndexMaxInlineSize
public ClientCacheConfiguration setSqlIndexMaxInlineSize(int newVal)
- Parameters:
newVal- Sql index max inline size.- Returns:
thisfor chaining.
-
getSqlSchema
public String getSqlSchema()
- Returns:
- Sql schema.
-
setSqlSchema
public ClientCacheConfiguration setSqlSchema(String newVal)
- Parameters:
newVal- Sql schema.- Returns:
thisfor chaining.
-
getKeyConfiguration
public CacheKeyConfiguration[] getKeyConfiguration()
- Returns:
- Cache key configuration.
-
setKeyConfiguration
public ClientCacheConfiguration setKeyConfiguration(CacheKeyConfiguration... newVal)
- Parameters:
newVal- Cache key configuration.- Returns:
thisfor chaining.
-
getQueryEntities
public QueryEntity[] getQueryEntities()
- Returns:
- Query entities configurations.
-
setQueryEntities
public ClientCacheConfiguration setQueryEntities(QueryEntity... newVal)
- Parameters:
newVal- Query entities configurations.- Returns:
thisfor chaining.
-
getExpiryPolicy
public javax.cache.expiry.ExpiryPolicy getExpiryPolicy()
- Returns:
- Expire policy.
-
setExpiryPolicy
public ClientCacheConfiguration setExpiryPolicy(javax.cache.expiry.ExpiryPolicy expiryPlc)
- Parameters:
expiryPlc- Expiry policy.- Returns:
thisfor chaining.
-
-