Interface PartitionUpdateCounter

    • Method Detail

      • init

        void init​(long initUpdCntr,
                  @Nullable
                  @org.jetbrains.annotations.Nullable byte[] cntrUpdData)
        Restores update counter state.
        Parameters:
        initUpdCntr - LWM.
        cntrUpdData - Counter updates raw data.
      • initial

        long initial()
        Deprecated.
        TODO LWM should be used as initial counter https://ggsystems.atlassian.net/browse/GG-17396
      • get

        long get()
        Get LWM.
        Returns:
        Current LWM.
      • next

        long next()
        Increment LWM by 1.
        Returns:
        New LWM.
      • next

        long next​(long delta)
        Increment LWM by delta.
        Parameters:
        delta - Delta.
        Returns:
        New LWM.
      • reserve

        long reserve​(long delta)
        Increment HWM by delta.
        Parameters:
        delta - Delta.
        Returns:
        New HWM.
      • reserved

        long reserved()
        Returns HWM.
        Returns:
        Current HWM.
      • highestAppliedCounter

        long highestAppliedCounter()
        Returns highest applied update counter.
        Returns:
        Highest applied counter.
      • update

        void update​(long val)
             throws IgniteCheckedException
        Sets update counter to absolute value. All missed updates will be discarded.
        Parameters:
        val - Absolute value.
        Throws:
        IgniteCheckedException - if counter cannot be set to passed value due to incompatibility with current state.
      • update

        boolean update​(long start,
                       long delta)
        Applies counter update out of range. Update ranges must not intersect.
        Parameters:
        start - Start (<= lwm).
        delta - Delta.
        Returns:
        True if update was actually applied.
      • reset

        void reset()
        Reset counter internal state to zero.
      • resetInitialCounter

        void resetInitialCounter()
        Reset the initial counter value to zero.
      • updateInitial

        void updateInitial​(long start,
                           long delta)
        Deprecated.
        TODO https://ggsystems.atlassian.net/browse/GG-17396
        Parameters:
        start - Counter.
        delta - Delta.
      • finalizeUpdateCounters

        GridLongList finalizeUpdateCounters()
        Flushes pending update counters closing all possible gaps.
        Returns:
        Even-length array of pairs [start, end] for each gap.
      • getBytes

        @Nullable
        @org.jetbrains.annotations.Nullable byte[] getBytes()
      • sequential

        boolean sequential()
        Returns:
        True if counter has no missed updates.
      • empty

        boolean empty()
        Returns:
        True if counter has not seen any update.
      • iterator

        Iterator<long[]> iterator()
        Specified by:
        iterator in interface Iterable<long[]>
        Returns:
        Iterator for pairs [start, range] for each out-of-order update in the update counter sequence.
      • comparableState

        Object comparableState()
        Returns:
        Comparable counter state.