Class CachesRegistry


  • public class CachesRegistry
    extends Object
    Class is responsible to hold and persist cache and cache group descriptors.
    • 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.
      • 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 null if cache doesn't exist.
      • 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()