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 Description CachesRegistry(GridCacheSharedContext cctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()@Nullable DynamicCacheDescriptorcache(int cacheId)CacheGroupDescriptorgroup(int grpId)IgniteInternalFuture<?>init(Map<Integer,CacheGroupDescriptor> groupDescriptors, Map<String,DynamicCacheDescriptor> cacheDescriptors)Removes currently registered cache groups and caches.voidunregisterAll()@Nullable DynamicCacheDescriptorunregisterCache(int cacheId)Removes cache from registry.CacheGroupDescriptorunregisterGroup(int grpId)Removes cache group from registry.IgniteInternalFuture<?>update(ExchangeActions exchActions)Adds caches and cache groups to start fromexchActions.
-
-
-
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
nullif 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 @Nullable DynamicCacheDescriptor cache(int cacheId)
- Parameters:
cacheId- Cache ID.- Returns:
- Cache descriptor if cache found.
-
unregisterCache
@Nullable public @Nullable DynamicCacheDescriptor unregisterCache(int cacheId)
Removes cache from registry.- Parameters:
cacheId- Cache id.- Returns:
- Unregistered cache or
nullif 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 fromexchActions. Removes caches and caches groups to stop fromexchActions.- Parameters:
exchActions- Exchange actions.- Returns:
- Future that will be completed when all unregistered cache configurations will be persisted.
-
unregisterAll
public void unregisterAll()
-
-