Class BaseStateIterator<K,​V,​KENCODEDT,​VENCODEDT>

    • Constructor Detail

      • BaseStateIterator

        public BaseStateIterator​(Iterator<Map.Entry<KENCODEDT,​VENCODEDT>> pendingPrepareIterator,
                                 Iterator<Map.Entry<KENCODEDT,​VENCODEDT>> pendingCommitIterator,
                                 Set<KENCODEDT> initialProvidedKeys)
        Constructor.
        Parameters:
        pendingPrepareIterator - The iterator of pendingPrepare
        pendingCommitIterator - The iterator of pendingCommit
        initialProvidedKeys - The initial value of provided keys
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface Iterator<K>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<K>
      • loadChunkFromStateStorage

        protected abstract Iterator<Map.Entry<KENCODEDT,​VENCODEDT>> loadChunkFromStateStorage()
        Load some part of state KVs from storage and returns iterator of cached data from storage.
        Returns:
        Iterator of loaded state KVs
      • isEndOfDataFromStorage

        protected abstract boolean isEndOfDataFromStorage()
        Check whether end of data is reached from storage state KVs.
        Returns:
        whether end of data is reached from storage state KVs
      • decodeKey

        protected abstract K decodeKey​(KENCODEDT key)
        Decode key to convert encoded type of key to state key type.
        Parameters:
        key - raw type of encoded key
        Returns:
        Decoded value of key
      • decodeValue

        protected abstract V decodeValue​(VENCODEDT value)
        Decode value to convert encoded type of value to state value type.
        Parameters:
        value - raw type of encoded value
        Returns:
        Decoded value of value
      • isTombstoneValue

        protected abstract boolean isTombstoneValue​(VENCODEDT value)
        Check whether the value is tombstone (deletion mark) value.
        Parameters:
        value - the value to check
        Returns:
        true if the value is tombstone, false otherwise