Interface ClientCluster
-
- All Superinterfaces:
ClientClusterGroup
public interface ClientCluster extends ClientClusterGroup
Thin client cluster facade. Represents whole cluster (all available nodes).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
disableWal(String cacheName)
Disables write-ahead logging for specified cache.boolean
enableWal(String cacheName)
Enables write-ahead logging for specified cache.boolean
isWalEnabled(String cacheName)
Checks if write-ahead logging is enabled for specified cache.ClusterState
state()
Gets current cluster state.void
state(ClusterState newState)
Changes current cluster state to givennewState
cluster state.-
Methods inherited from interface org.apache.ignite.client.ClientClusterGroup
forAttribute, forClients, forHost, forHost, forNode, forNodeId, forNodeIds, forNodes, forOldest, forOthers, forOthers, forPredicate, forRandom, forServers, forYoungest, node, node, nodes
-
-
-
-
Method Detail
-
state
ClusterState state()
Gets current cluster state.- Returns:
- Current cluster state.
-
state
void state(ClusterState newState) throws ClientException
Changes current cluster state to givennewState
cluster state.NOTE: Deactivation clears in-memory caches (without persistence) including the system caches.
- Parameters:
newState
- New cluster state.- Throws:
ClientException
- If change state operation failed.
-
disableWal
boolean disableWal(String cacheName) throws ClientException
Disables write-ahead logging for specified cache. When WAL is disabled, changes are not logged to disk. This significantly improves cache update speed. The drawback is absence of local crash-recovery guarantees. If node is crashed, local content of WAL-disabled cache will be cleared on restart to avoid data corruption.Internally this method will wait for all current cache operations to finish and prevent new cache operations from being executed. Then checkpoint is initiated to flush all data to disk. Control is returned to the callee when all dirty pages are prepared for checkpoint, but not necessarily flushed to disk.
WAL state can be changed only for persistent caches.
- Parameters:
cacheName
- Cache name.- Returns:
- Whether WAL disabled by this call.
- Throws:
ClientException
- If error occurs.- See Also:
enableWal(String)
,isWalEnabled(String)
-
enableWal
boolean enableWal(String cacheName) throws ClientException
Enables write-ahead logging for specified cache. Restoring crash-recovery guarantees of a previous call todisableWal(String)
.Internally this method will wait for all current cache operations to finish and prevent new cache operations from being executed. Then checkpoint is initiated to flush all data to disk. Control is returned to the callee when all data is persisted to disk.
WAL state can be changed only for persistent caches.
- Parameters:
cacheName
- Cache name.- Returns:
- Whether WAL enabled by this call.
- Throws:
ClientException
- If error occurs.- See Also:
disableWal(String)
,isWalEnabled(String)
-
isWalEnabled
boolean isWalEnabled(String cacheName)
Checks if write-ahead logging is enabled for specified cache.- Parameters:
cacheName
- Cache name.- Returns:
True
if WAL is enabled for cache.- See Also:
disableWal(String)
,enableWal(String)
-
-