org.apache.ignite.internal.processors.cache

## Class DynamicCacheDescriptor

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor

    public class DynamicCacheDescriptor
    extends Object

Cache start descriptor.

### Constructor Summary

Constructors
Constructor and Description
`DynamicCacheDescriptor(GridKernalContext ctx, CacheConfiguration cacheCfg, CacheType cacheType, CacheGroupDescriptor grpDesc, boolean template, UUID rcvdFrom, boolean staticCfg, boolean sql, IgniteUuid deploymentId, QuerySchema schema)`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `applySchemaPatch(QuerySchemaPatch patch)` Apply query schema patch for changing current schema.
`CacheConfiguration` `cacheConfiguration()`
`Integer` `cacheId()`
`String` `cacheName()`
`CacheObjectContext` `cacheObjectContext(IgniteCacheObjectProcessor proc)` Creates and caches cache object context if needed.
`CacheType` `cacheType()`
`IgniteUuid` `deploymentId()`
`CacheGroupDescriptor` `groupDescriptor()`
`int` `groupId()`
`QuerySchemaPatch` `makeSchemaPatch(Collection<QueryEntity> target)` Make schema patch for this cache.
`UUID` `receivedFrom()`
`QuerySchema` `schema()`
`void` `schema(QuerySchema schema)` Set schema
`void` `schemaChangeFinish(SchemaFinishDiscoveryMessage msg)` Try applying finish message.
`boolean` `sql()`
`AffinityTopologyVersion` `startTopologyVersion()`
`void` `startTopologyVersion(AffinityTopologyVersion startTopVer)`
`boolean` `staticallyConfigured()`
`boolean` `template()`
`StoredCacheData` `toStoredData()` Form a `StoredCacheData` with all data to correctly restore cache params when its configuration is read from page store.
`String` `toString()`
`boolean` `updatesAllowed()`
`void` `updatesAllowed(boolean updatesAllowed)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### DynamicCacheDescriptor

    public DynamicCacheDescriptor(GridKernalContext ctx,
                                  CacheConfiguration cacheCfg,
                                  CacheType cacheType,
                                  CacheGroupDescriptor grpDesc,
                                  boolean template,
                                  UUID rcvdFrom,
                                  boolean staticCfg,
                                  boolean sql,
                                  IgniteUuid deploymentId,
                                  QuerySchema schema)

Parameters:
  `ctx` - Context.
  `cacheCfg` - Cache configuration.
  `cacheType` - Cache type.
  `grpDesc` - Group descriptor.
  `template` - `True` if this is template configuration.
  `rcvdFrom` - ID of node provided cache configuration
  `staticCfg` - `True` if cache statically configured.
  `sql` - SQL flag - whether the cache is created by an SQL command such as `CREATE TABLE`.
  `deploymentId` - Deployment ID.
  `schema` - Query schema.

### Method Detail

#### groupId

    public int groupId()

Returns:
  Cache group ID.

#### groupDescriptor

    public CacheGroupDescriptor groupDescriptor()

Returns:
  Cache group descriptor.

#### cacheId

    public Integer cacheId()

Returns:
  Cache ID.

#### template

    public boolean template()

Returns:
  `True` if this is template configuration.

#### cacheType

    public CacheType cacheType()

Returns:
  Cache type.

#### deploymentId

    public IgniteUuid deploymentId()

Returns:
  Start ID.

#### staticallyConfigured

    public boolean staticallyConfigured()

Returns:
  `True` if statically configured.

#### sql

    public boolean sql()

Returns:
  SQL flag.

#### cacheName

    public String cacheName()

Returns:
  Cache name.

#### cacheConfiguration

    public CacheConfiguration cacheConfiguration()

Returns:
  Cache configuration.

#### cacheObjectContext

    public CacheObjectContext cacheObjectContext(IgniteCacheObjectProcessor proc)
                                          throws IgniteCheckedException

Creates and caches cache object context if needed.

Parameters:
  `proc` - Object processor.
Returns:
  Cache object context.
Throws:
  `IgniteCheckedException` - If failed.

#### updatesAllowed

    public boolean updatesAllowed()

Returns:
  Updates allowed flag.

#### updatesAllowed

    public void updatesAllowed(boolean updatesAllowed)

Parameters:
  `updatesAllowed` - Updates allowed flag.

#### receivedFrom

    @Nullable
    public UUID receivedFrom()

Returns:
  ID of node provided cache configuration in discovery data.

#### startTopologyVersion

    @Nullable
    public AffinityTopologyVersion startTopologyVersion()

Returns:
  Start topology version or `null` if cache configured statically.

#### startTopologyVersion

    public void startTopologyVersion(AffinityTopologyVersion startTopVer)

Parameters:
  `startTopVer` - Start topology version.

#### schema

    public QuerySchema schema()

Returns:
  Schema.

#### schema

    public void schema(QuerySchema schema)

Set schema

Parameters:
  `schema` - Schema.

#### schemaChangeFinish

    public void schemaChangeFinish(SchemaFinishDiscoveryMessage msg)

Try applying finish message.

Parameters:
  `msg` - Message.

#### makeSchemaPatch

    public QuerySchemaPatch makeSchemaPatch(Collection<QueryEntity> target)

Make schema patch for this cache.

Parameters:
  `target` - Query entity list which current schema should be expanded to.
Returns:
  Patch which contains operations for expanding schema of this cache.
See Also:
  `QuerySchemaPatch`

#### applySchemaPatch

    public boolean applySchemaPatch(QuerySchemaPatch patch)

Apply query schema patch for changing current schema.

Parameters:
  `patch` - patch to apply.
Returns:
  `true` if applying was success and `false` otherwise.

#### toStoredData

    public StoredCacheData toStoredData()

Form a `StoredCacheData` with all data to correctly restore cache params when its configuration is read from page store. Essentially, this method takes from `DynamicCacheDescriptor` all that's needed to start cache correctly, leaving out everything else.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019