org.apache.ignite.internal.processors.cache

## Class CachesRegistry

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

    public class CachesRegistry
    extends Object

Class is responsible to hold and persist cache and cache group descriptors.

### Constructor Summary

Constructors
Constructor and Description
`CachesRegistry(GridCacheSharedContext cctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`IgniteInternalFuture<?>` `addUnregistered(Collection<DynamicCacheDescriptor> descs)` Adds cache and caches groups that is not registered yet to registry.
`Map<Integer,DynamicCacheDescriptor>` `allCaches()`
`Map<Integer,CacheGroupDescriptor>` `allGroups()`
`DynamicCacheDescriptor` `cache(int cacheId)`
`CacheGroupDescriptor` `group(int grpId)`
`IgniteInternalFuture<?>` `init(Map<Integer,CacheGroupDescriptor> groupDescriptors, Map<String,DynamicCacheDescriptor> cacheDescriptors)` Removes currently registered cache groups and caches.
`void` `unregisterAll()`
`DynamicCacheDescriptor` `unregisterCache(int cacheId)` Removes cache from registry.
`CacheGroupDescriptor` `unregisterGroup(int grpId)` Removes cache group from registry.
`IgniteInternalFuture<?>` `update(ExchangeActions exchActions)` Adds caches and cache groups to start from `exchActions`.

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

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

### Constructor Detail

#### CachesRegistry

    public CachesRegistry(GridCacheSharedContext cctx)

Parameters:
  `cctx` - Cache shared context.

### Method Detail

#### init

    public IgniteInternalFuture<?> init(Map<Integer,CacheGroupDescriptor> groupDescriptors,
                                        Map<String,DynamicCacheDescriptor> cacheDescriptors)

Removes currently registered cache groups and caches. Adds given cache groups and caches to registry.

Parameters:
  `groupDescriptors` - Registered groups.
  `cacheDescriptors` - Registered caches.
Returns:
  Future that will be completed when all caches configurations will be persisted.

#### unregisterGroup

    public CacheGroupDescriptor unregisterGroup(int grpId)

Removes cache group from registry.

Parameters:
  `grpId` - Group id.
Returns:
  Unregistered cache group or `null` if group doesn't exist.

#### allGroups

    public Map<Integer,CacheGroupDescriptor> allGroups()

Returns:
  All registered cache groups.

#### group

    public CacheGroupDescriptor group(int grpId)

Parameters:
  `grpId` - Group ID.
Returns:
  Group descriptor.

#### cache

    @Nullable
    public DynamicCacheDescriptor cache(int cacheId)

Parameters:
  `cacheId` - Cache ID.
Returns:
  Cache descriptor if cache found.

#### unregisterCache

    @Nullable
    public DynamicCacheDescriptor unregisterCache(int cacheId)

Removes cache from registry.

Parameters:
  `cacheId` - Cache id.
Returns:
  Unregistered cache or `null` if cache doesn't exist.

#### allCaches

    public Map<Integer,DynamicCacheDescriptor> allCaches()

Returns:
  All registered cache groups.

#### addUnregistered

    public IgniteInternalFuture<?> addUnregistered(Collection<DynamicCacheDescriptor> descs)

Adds cache and caches groups that is not registered yet to registry.

Parameters:
  `descs` - Cache and cache group descriptors.
Returns:
  Future that will be completed when all unregistered cache configurations will be persisted.

#### update

    public IgniteInternalFuture<?> update(ExchangeActions exchActions)

Adds caches and cache groups to start from `exchActions`. Removes caches and caches groups to stop from `exchActions`.

Parameters:
  `exchActions` - Exchange actions.
Returns:
  Future that will be completed when all unregistered cache configurations will be persisted.

#### unregisterAll

    public void unregisterAll()

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

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