Show / Hide Table of Contents

# Class CacheClientConfiguration

Ignite client cache configuration. Same thing as CacheConfiguration, but with a subset of properties that can be accessed from Ignite thin client (see IIgniteClient).

Note that caches created from server nodes can be accessed from thin client, and vice versa. The only difference is that thin client can not read or write certain CacheConfiguration properties, so a separate class exists to make it clear which properties can be used.

##### Inheritance

System.Object
CacheClientConfiguration

##### Inherited Members

System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()

###### Namespace: Apache.Ignite.Core.Client.Cache

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

##### Syntax

    public class CacheClientConfiguration

### Constructors

#### CacheClientConfiguration()

Initializes a new instance of the CacheConfiguration class.

##### Declaration

    public CacheClientConfiguration()

#### CacheClientConfiguration(CacheConfiguration, Boolean)

Initializes a new instance of the CacheClientConfiguration class, copying properties from provided server cache configuration. See also ToCacheConfiguration().

##### Declaration

    public CacheClientConfiguration(CacheConfiguration cacheConfiguration, bool ignoreUnsupportedProperties)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheConfiguration | cacheConfiguration | Server cache configuration.
System.Boolean | ignoreUnsupportedProperties | If set to `true`, ignores unsupported properties instead of throwing an exception.

#### CacheClientConfiguration(CacheClientConfiguration)

Initializes a new instance of the CacheConfiguration class, performing a deep copy of specified cache configuration.

##### Declaration

    public CacheClientConfiguration(CacheClientConfiguration other)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheClientConfiguration | other | The other configuration to perfrom deep copy from.

#### CacheClientConfiguration(String)

Initializes a new instance of the CacheConfiguration class.

##### Declaration

    public CacheClientConfiguration(string name)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | Cache name.

#### CacheClientConfiguration(String, QueryEntity[])

Initializes a new instance of the CacheConfiguration class.

##### Declaration

    public CacheClientConfiguration(string name, params QueryEntity[] queryEntities)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | Cache name.
QueryEntity[] | queryEntities | Query entities.

#### CacheClientConfiguration(String, Type[])

Initializes a new instance of the CacheConfiguration class and populates QueryEntities according to provided query types.

##### Declaration

    public CacheClientConfiguration(string name, params Type[] queryTypes)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | name | Cache name.
System.Type[] | queryTypes | Collection of types to be registered as query entities. These types should use QuerySqlFieldAttribute to configure query fields and properties.

### Properties

#### AtomicityMode

Gets or sets cache atomicity mode.

##### Declaration

    public CacheAtomicityMode AtomicityMode { get; set; }

##### Property Value

Type | Description
--- | ---
CacheAtomicityMode |

#### Backups

Gets or sets number of nodes used to back up single partition for Partitioned cache.

##### Declaration

    public int Backups { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### CacheMode

Gets or sets caching mode to use.

##### Declaration

    public CacheMode CacheMode { get; set; }

##### Property Value

Type | Description
--- | ---
CacheMode |

#### CopyOnRead

Gets or sets flag indicating whether copy of the value stored in cache should be created for cache operation implying return value.

##### Declaration

    public bool CopyOnRead { get; set; }

##### Property Value

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

#### DataRegionName

Gets or sets the name of the data region, see DataRegionConfiguration.

##### Declaration

    public string DataRegionName { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

#### EagerTtl

Gets or sets flag indicating whether expired cache entries will be eagerly removed from cache. When set to false, expired entries will be removed on next entry access.

##### Declaration

    public bool EagerTtl { get; set; }

##### Property Value

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

#### EnableStatistics

Gets or sets a value indicating whether statistics gathering is enabled on a cache. These statistics can be retrieved via GetMetrics().

##### Declaration

    public bool EnableStatistics { get; set; }

##### Property Value

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

#### ExpiryPolicyFactory

Gets or sets the factory for IExpiryPolicy to be used for all cache operations, unless WithExpiryPolicy(IExpiryPolicy) is called.

Default is null, which means no expiration.

##### Declaration

    public IFactory<IExpiryPolicy> ExpiryPolicyFactory { get; set; }

##### Property Value

Type | Description
--- | ---
IFactory<IExpiryPolicy> |

#### GroupName

Gets or sets the cache group name. Caches with the same group name share single underlying 'physical' cache (partition set), but are logically isolated.

Since underlying cache is shared, the following configuration properties should be the same within group: CacheMode, PartitionLossPolicy, DataRegionName.

Grouping caches reduces overall overhead, since internal data structures are shared.

##### Declaration

    public string GroupName { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

#### KeyConfiguration

Gets or sets the key configuration.

##### Declaration

    public ICollection<CacheKeyConfiguration> KeyConfiguration { get; set; }

##### Property Value

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

#### LockTimeout

Gets or sets default lock acquisition timeout.

##### Declaration

    public TimeSpan LockTimeout { get; set; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

#### MaxConcurrentAsyncOperations

Gets or sets maximum number of allowed concurrent asynchronous operations, 0 for unlimited.

##### Declaration

    public int MaxConcurrentAsyncOperations { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### MaxQueryIteratorsCount

Gets or sets the maximum number of active query iterators.

##### Declaration

    public int MaxQueryIteratorsCount { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### Name

Gets or sets the cache name.

##### Declaration

    public string Name { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

#### OnheapCacheEnabled

Gets or sets a value indicating whether on-heap cache is enabled for the off-heap based page memory.

##### Declaration

    public bool OnheapCacheEnabled { get; set; }

##### Property Value

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

#### PartitionLossPolicy

Gets or sets the partition loss policy. This policy defines how Ignite will react to a situation when all nodes for some partition leave the cluster.

##### Declaration

    public PartitionLossPolicy PartitionLossPolicy { get; set; }

##### Property Value

Type | Description
--- | ---
PartitionLossPolicy |

#### QueryDetailMetricsSize

Gets or sets the size of the query detail metrics to be stored in memory.

0 means disabled metrics.

##### Declaration

    public int QueryDetailMetricsSize { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### QueryEntities

Gets or sets the query entity configuration.

##### Declaration

    public ICollection<QueryEntity> QueryEntities { get; set; }

##### Property Value

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

#### QueryParallelism

Gets or sets the desired query parallelism within a single node. Query executor may or may not use this hint, depending on estimated query cost.

Default is DefaultQueryParallelism.

##### Declaration

    public int QueryParallelism { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### ReadFromBackup

Gets or sets flag indicating whether data can be read from backup.

##### Declaration

    public bool ReadFromBackup { get; set; }

##### Property Value

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

#### RebalanceBatchesPrefetchCount

Gets or sets the rebalance batches prefetch count.

Source node can provide more than one batch at rebalance start to improve performance. Default is DefaultRebalanceBatchesPrefetchCount, minimum is 2.

##### Declaration

    public long RebalanceBatchesPrefetchCount { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int64 |

#### RebalanceBatchSize

Gets or sets 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.

##### Declaration

    public int RebalanceBatchSize { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### RebalanceDelay

Gets or sets delay 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.

##### Declaration

    public TimeSpan RebalanceDelay { get; set; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

#### RebalanceMode

Gets or sets cache rebalance mode.

##### Declaration

    public CacheRebalanceMode RebalanceMode { get; set; }

##### Property Value

Type | Description
--- | ---
CacheRebalanceMode |

#### RebalanceOrder

Gets or sets the cache rebalance order. Caches with bigger RebalanceOrder are rebalanced later than caches with smaller RebalanceOrder.

Default is 0, which means unordered rebalance. All caches with RebalanceOrder=0 are rebalanced without any delay concurrently.

This parameter is applicable only for caches with RebalanceMode of Sync and Async.

##### Declaration

    public int RebalanceOrder { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### RebalanceThrottle

Time 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.

Value of 0 means that throttling is disabled.

##### Declaration

    public TimeSpan RebalanceThrottle { get; set; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

#### RebalanceTimeout

Gets or sets rebalance timeout.

##### Declaration

    public TimeSpan RebalanceTimeout { get; set; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

#### SqlEscapeAll

If true all the SQL table and field names will be escaped with double quotes like ({ "tableName"."fieldsName"}). This enforces case sensitivity for field names and also allows having special characters in table and field names.

##### Declaration

    public bool SqlEscapeAll { get; set; }

##### Property Value

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

#### SqlIndexMaxInlineSize

Gets or sets maximum inline size in bytes for sql indexes. See also InlineSize. -1 for automatic.

##### Declaration

    public int SqlIndexMaxInlineSize { get; set; }

##### Property Value

Type | Description
--- | ---
System.Int32 |

#### SqlSchema

Gets or sets the SQL schema. Non-quoted identifiers are not case sensitive. Quoted identifiers are case sensitive.

Quoted Name is used by default.

##### Declaration

    public string SqlSchema { get; set; }

##### Property Value

Type | Description
--- | ---
System.String |

#### WriteSynchronizationMode

Gets or sets write synchronization mode. This mode controls whether the main
caller should wait for update on other nodes to complete or not.

##### Declaration

    public CacheWriteSynchronizationMode WriteSynchronizationMode { get; set; }

##### Property Value

Type | Description
--- | ---
CacheWriteSynchronizationMode |

### Methods

#### ToCacheConfiguration()

Converts this instance to full CacheConfiguration.

##### Declaration

    public CacheConfiguration ToCacheConfiguration()

##### Returns

Type | Description
--- | ---
CacheConfiguration |