Show / Hide Table of Contents

# Interface ICluster

Represents whole cluster (group of all nodes in a cluster).

All members are thread-safe and may be used concurrently from multiple threads.

##### Inherited Members

IClusterGroup.Ignite
IClusterGroup.GetCompute()
IClusterGroup.ForNodes(IEnumerable<IClusterNode>)
IClusterGroup.ForNodes(IClusterNode[])
IClusterGroup.ForNodeIds(IEnumerable<Guid>)
IClusterGroup.ForNodeIds(Guid[])
IClusterGroup.ForPredicate(Func<IClusterNode, Boolean>)
IClusterGroup.ForAttribute(String, String)
IClusterGroup.ForCacheNodes(String)
IClusterGroup.ForDataNodes(String)
IClusterGroup.ForClientNodes(String)
IClusterGroup.ForRemotes()
IClusterGroup.ForDaemons()
IClusterGroup.ForHost(IClusterNode)
IClusterGroup.ForRandom()
IClusterGroup.ForOldest()
IClusterGroup.ForYoungest()
IClusterGroup.ForDotNet()
IClusterGroup.ForServers()
IClusterGroup.GetNodes()
IClusterGroup.GetNode(Guid)
IClusterGroup.GetNode()
IClusterGroup.GetMetrics()
IClusterGroup.GetMessaging()
IClusterGroup.GetEvents()
IClusterGroup.GetServices()
IClusterGroup.EnableStatistics(IEnumerable<String>, Boolean)
IClusterGroup.ClearStatistics(IEnumerable<String>)

###### Namespace: Apache.Ignite.Core.Cluster

###### Assembly: Apache.Ignite.Core.dll

##### Syntax

    public interface ICluster : IClusterGroup

### Properties

#### ClientReconnectTask

Gets the reconnect task, which will transition to Completed state when local client node reconnects to the cluster.

Result of the task indicates whether cluster has been restarted.

If local node is not in client mode or is not disconnected, returns completed task.

##### Declaration

    Task<bool> ClientReconnectTask { get; }

##### Property Value

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Boolean> | The reconnect task.

#### TopologyVersion

Gets current topology version. In case of TCP discovery topology versions are sequential

- they start from 1 and get incremented every time whenever a node joins or leaves. For other discovery SPIs topology versions may not be (and likely are not) sequential.

##### Declaration

    long TopologyVersion { get; }

##### Property Value

Type | Description
--- | ---
System.Int64 | Current topology version.

### Methods

#### DisableWal(String)

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.

##### Declaration

    void DisableWal(string cacheName)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | cacheName | Name of the cache.

#### EnableWal(String)

Enables write-ahead logging for specified cache. Restoring crash-recovery guarantees of a previous call to DisableWal(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.

##### Declaration

    void EnableWal(string cacheName)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | cacheName | Name of the cache.

#### ForLocal()

Gets monadic projection consisting from the local node.

##### Declaration

    IClusterGroup ForLocal()

##### Returns

Type | Description
--- | ---
IClusterGroup | Monadic projection consisting from the local node.

#### GetBaselineAutoAdjustTimeout()

Gets the value of time which we would wait before the actual topology change since last server topology change(node join/left/fail).

##### Declaration

    long GetBaselineAutoAdjustTimeout()

##### Returns

Type | Description
--- | ---
System.Int64 | Timeout value

#### GetBaselineTopology()

Gets the baseline topology. Returns null if SetBaselineTopology(Int64) has not been called.

##### Declaration

    ICollection<IBaselineNode> GetBaselineTopology()

##### Returns

Type | Description
--- | ---
System.Collections.Generic.ICollection<IBaselineNode> |

#### GetLocalNode()

Gets local Ignite node.

##### Declaration

    IClusterNode GetLocalNode()

##### Returns

Type | Description
--- | ---
IClusterNode | Local Ignite node.

#### GetTopology(Int64)

Gets a topology by version. Returns null if topology history storage doesn't contain specified topology version (history currently keeps the last 1000 snapshots).

##### Declaration

    ICollection<IClusterNode> GetTopology(long ver)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int64 | ver | Topology version.

##### Returns

Type | Description
--- | ---
System.Collections.Generic.ICollection<IClusterNode> | Collection of Ignite nodes which represented by specified topology version, if it is present in history storage, null otherwise.

##### Exceptions

Type | Condition
--- | ---
IgniteException | If underlying SPI implementation does not support topology history. Currently only `org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi` supports topology history.

#### IsActive()

Determines whether this grid is in active state.

##### Declaration

    bool IsActive()

##### Returns

Type | Description
--- | ---
System.Boolean | `true` if the grid is active; otherwise, `false`.

#### IsBaselineAutoAdjustEnabled()

Returns value of manual baseline control or auto adjusting baseline.

##### Declaration

    bool IsBaselineAutoAdjustEnabled()

##### Returns

Type | Description
--- | ---
System.Boolean | `true` If cluster in auto-adjust. `false` If cluster in manual.

#### IsWalEnabled(String)

Determines whether write-ahead logging is enabled for specified cache.

##### Declaration

    bool IsWalEnabled(string cacheName)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | cacheName | Name of the cache.

##### Returns

Type | Description
--- | ---
System.Boolean |

#### PingNode(Guid)

Pings a remote node.

##### Declaration

    bool PingNode(Guid nodeId)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Guid | nodeId | ID of a node to ping.

##### Returns

Type | Description
--- | ---
System.Boolean | True if node for a given ID is alive, false otherwise.

#### ResetMetrics()

Resets local I/O, job, and task execution metrics.

##### Declaration

    void ResetMetrics()

#### SetActive(Boolean)

Changes Ignite grid state to active or inactive.

##### Declaration

    void SetActive(bool isActive)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | isActive |

#### SetBaselineAutoAdjustEnabledFlag(Boolean)

Sets the value of manual baseline control or auto adjusting baseline.

##### Declaration

    void SetBaselineAutoAdjustEnabledFlag(bool isBaselineAutoAdjustEnabled)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | isBaselineAutoAdjustEnabled | `true` If cluster in auto-adjust. `false` If cluster in manual.

#### SetBaselineAutoAdjustTimeout(Int64)

Sets the value of time which we would wait before the actual topology change since last server topology change(node join/left/fail).

##### Declaration

    void SetBaselineAutoAdjustTimeout(long baselineAutoAdjustTimeout)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int64 | baselineAutoAdjustTimeout | Timeout value

#### SetBaselineTopology(IEnumerable<IBaselineNode>)

Sets the baseline topology nodes.

##### Declaration

    void SetBaselineTopology(IEnumerable<IBaselineNode> nodes)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Collections.Generic.IEnumerable<IBaselineNode> | nodes | The nodes.

#### SetBaselineTopology(Int64)

Sets the baseline topology from the cluster topology of the given version. This method requires active cluster (IsActive()).

##### Declaration

    void SetBaselineTopology(long topologyVersion)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int64 | topologyVersion | The topology version.

#### SetTxTimeoutOnPartitionMapExchange(TimeSpan)

Set transaction timeout on partition map exchange

##### Declaration

    void SetTxTimeoutOnPartitionMapExchange(TimeSpan timeout)

##### Parameters

Type | Name | Description
--- | --- | ---
System.TimeSpan | timeout |