Class DataStructuresProcessor

    • Field Detail

      • VOLATILE_DATA_REGION_NAME

        public static final String VOLATILE_DATA_REGION_NAME
        DataRegionConfiguration name reserved for volatile caches.
        See Also:
        Constant Field Values
      • QUEUES_VIEW

        public static final String QUEUES_VIEW
      • SETS_VIEW

        public static final String SETS_VIEW
      • LOCKS_VIEW

        public static final String LOCKS_VIEW
      • SEMAPHORES_VIEW

        public static final String SEMAPHORES_VIEW
      • LATCHES_VIEW

        public static final String LATCHES_VIEW
      • STAMPED_VIEW

        public static final String STAMPED_VIEW
      • REFERENCES_VIEW

        public static final String REFERENCES_VIEW
      • LONGS_VIEW

        public static final String LONGS_VIEW
      • SEQUENCES_VIEW

        public static final String SEQUENCES_VIEW
    • Constructor Detail

      • DataStructuresProcessor

        public DataStructuresProcessor​(GridKernalContext ctx)
        Parameters:
        ctx - Context.
    • Method Detail

      • onKernalStart

        public void onKernalStart​(boolean active)
        Callback that notifies that kernal has successfully started, including all managers and processors.
        Specified by:
        onKernalStart in interface GridComponent
        Overrides:
        onKernalStart in class GridProcessorAdapter
        Parameters:
        active - Cluster active flag (note: should be used carefully since state can change concurrently).
      • onBeforeActivate

        public void onBeforeActivate()
      • onKernalStop

        public void onKernalStop​(boolean cancel)
        Callback to notify that kernal is about to stop.
        Specified by:
        onKernalStop in interface GridComponent
        Overrides:
        onKernalStop in class GridProcessorAdapter
        Parameters:
        cancel - Flag indicating whether jobs should be canceled.
      • restoreStructuresState

        public void restoreStructuresState​(GridKernalContext ctx)
        Parameters:
        ctx - Context.
      • isDataStructureCache

        public static boolean isDataStructureCache​(String cacheName)
        Parameters:
        cacheName - Cache name.
        Returns:
        True if cache with such name is used to store data structures.
      • isReservedGroup

        public static boolean isReservedGroup​(@Nullable
                                              @Nullable String grpName)
        Parameters:
        grpName - Group name.
        Returns:
        True if group name is reserved to store data structures.
      • sequence

        public final IgniteAtomicSequence sequence​(String name,
                                                   @Nullable
                                                   @Nullable AtomicConfiguration cfg,
                                                   long initVal,
                                                   boolean create)
                                            throws IgniteCheckedException
        Gets a sequence from cache or creates one if it's not cached.
        Parameters:
        name - Sequence name.
        cfg - Configuration.
        initVal - Initial value for sequence. If sequence already cached, initVal will be ignored.
        create - If true sequence will be created in case it is not in cache.
        Returns:
        Sequence.
        Throws:
        IgniteCheckedException - If loading failed.
      • atomicLong

        public final IgniteAtomicLong atomicLong​(String name,
                                                 @Nullable
                                                 @Nullable AtomicConfiguration cfg,
                                                 long initVal,
                                                 boolean create)
                                          throws IgniteCheckedException
        Gets an atomic long from cache or creates one if it's not cached.
        Parameters:
        name - Name of atomic long.
        cfg - Configuration.
        initVal - Initial value for atomic long. If atomic long already cached, initVal will be ignored.
        create - If true atomic long will be created in case it is not in cache.
        Returns:
        Atomic long.
        Throws:
        IgniteCheckedException - If loading failed.
      • suspend

        public void suspend​(String cacheName)
        Would suspend calls for this cache if it is atomics cache.
        Parameters:
        cacheName - To suspend.
      • restart

        public void restart​(String cacheName,
                            IgniteInternalCache cache)
        Would return this cache to normal work if it was suspened (and if it is atomics cache).
        Parameters:
        cacheName - To restart.
      • atomicReference

        public final <T> IgniteAtomicReference<T> atomicReference​(String name,
                                                                  @Nullable
                                                                  @Nullable AtomicConfiguration cfg,
                                                                  T initVal,
                                                                  boolean create)
                                                           throws IgniteCheckedException
        Gets an atomic reference from cache or creates one if it's not cached.
        Parameters:
        name - Name of atomic reference.
        cfg - Configuration.
        initVal - Initial value for atomic reference. If atomic reference already cached, initVal will be ignored.
        create - If true atomic reference will be created in case it is not in cache.
        Returns:
        Atomic reference.
        Throws:
        IgniteCheckedException - If loading failed.
      • atomicStamped

        public final <T,​S> IgniteAtomicStamped<T,​S> atomicStamped​(String name,
                                                                              @Nullable
                                                                              @Nullable AtomicConfiguration cfg,
                                                                              T initVal,
                                                                              S initStamp,
                                                                              boolean create)
                                                                       throws IgniteCheckedException
        Gets an atomic stamped from cache or creates one if it's not cached.
        Parameters:
        name - Name of atomic stamped.
        cfg - Configuration.
        initVal - Initial value for atomic stamped. If atomic stamped already cached, initVal will be ignored.
        initStamp - Initial stamp for atomic stamped. If atomic stamped already cached, initStamp will be ignored.
        create - If true atomic stamped will be created in case it is not in cache.
        Returns:
        Atomic stamped.
        Throws:
        IgniteCheckedException - If loading failed.
      • queue

        public final <T> IgniteQueue<T> queue​(String name,
                                              @Nullable
                                              @Nullable String grpName,
                                              int cap,
                                              @Nullable
                                              @Nullable CollectionConfiguration cfg)
                                       throws IgniteCheckedException
        Gets a queue from cache or creates one if it's not cached.
        Parameters:
        name - Name of queue.
        grpName - Group name. If present, will override groupName from configuration.
        cap - Max size of queue.
        cfg - Non-null queue configuration if new queue should be created.
        Returns:
        Instance of queue.
        Throws:
        IgniteCheckedException - If failed.
      • countDownLatch

        public IgniteCountDownLatch countDownLatch​(String name,
                                                   @Nullable
                                                   @Nullable AtomicConfiguration cfg,
                                                   int cnt,
                                                   boolean autoDel,
                                                   boolean create)
                                            throws IgniteCheckedException
        Gets or creates count down latch. If count down latch is not found in cache, it is created using provided name and count parameter.
        Parameters:
        name - Name of the latch.
        cfg - Configuration.
        cnt - Initial count.
        autoDel - True to automatically delete latch from cache when its count reaches zero.
        create - If true latch will be created in case it is not in cache, if it is false all parameters except name are ignored.
        Returns:
        Count down latch for the given name or null if it is not found and create is false.
        Throws:
        IgniteCheckedException - If operation failed.
      • semaphore

        public IgniteSemaphore semaphore​(String name,
                                         @Nullable
                                         @Nullable AtomicConfiguration cfg,
                                         int cnt,
                                         boolean failoverSafe,
                                         boolean create)
                                  throws IgniteCheckedException
        Gets or creates semaphore. If semaphore is not found in cache, it is created using provided name and count parameter.
        Parameters:
        name - Name of the semaphore.
        cfg - Configuration.
        cnt - Initial count.
        failoverSafe - True FailoverSafe parameter.
        create - If true semaphore will be created in case it is not in cache, if it is false all parameters except name are ignored.
        Returns:
        Semaphore for the given name or null if it is not found and create is false.
        Throws:
        IgniteCheckedException - If operation failed.
      • reentrantLock

        public IgniteLock reentrantLock​(String name,
                                        @Nullable
                                        @Nullable AtomicConfiguration cfg,
                                        boolean failoverSafe,
                                        boolean fair,
                                        boolean create)
                                 throws IgniteCheckedException
        Gets or creates reentrant lock. If reentrant lock is not found in cache, it is created using provided name, failover mode, and fairness mode parameters.
        Parameters:
        name - Name of the reentrant lock.
        cfg - Configuration.
        failoverSafe - Flag indicating behaviour in case of failure.
        fair - Flag indicating fairness policy of this lock.
        create - If true reentrant lock will be created in case it is not in cache.
        Returns:
        ReentrantLock for the given name or null if it is not found and create is false.
        Throws:
        IgniteCheckedException - If operation failed.
      • removeReentrantLock

        public void removeReentrantLock​(String name,
                                        String grpName,
                                        boolean broken)
                                 throws IgniteCheckedException
        Removes reentrant lock from cache.
        Parameters:
        name - Name of the reentrant lock.
        grpName - Group name.
        broken - Flag indicating the reentrant lock is broken and should be removed unconditionally.
        Throws:
        IgniteCheckedException - If operation failed.
      • set

        @Nullable
        public <T> @Nullable IgniteSet<T> set​(String name,
                                              @Nullable
                                              @Nullable String grpName,
                                              @Nullable
                                              @Nullable CollectionConfiguration cfg)
                                       throws IgniteCheckedException
        Gets a set from cache or creates one if it's not cached.
        Parameters:
        name - Set name.
        grpName - Group name. If present, will override groupName from configuration.
        cfg - Set configuration if new set should be created.
        Returns:
        Set instance.
        Throws:
        IgniteCheckedException - If failed.
      • set

        @Nullable
        public <T> @Nullable IgniteSet<T> set​(String name,
                                              int cacheId,
                                              boolean collocated,
                                              boolean separated)
                                       throws IgniteCheckedException
        Gets a set from cache by known cache id. Does not create new sets.
        Parameters:
        name - Set name.
        cacheId - Cache id.
        collocated - Colocated mode flag.
        separated - Separated cache flag.
        Returns:
        Set instance.
        Throws:
        IgniteCheckedException - If failed.