Class ForStDBIterRequest<K,N,UK,UV,R>

java.lang.Object
org.apache.flink.state.forst.ForStDBIterRequest<K,N,UK,UV,R>
Type Parameters:
K - The type of key in iterator.
N - The type of namespace in iterator.
UK - The type of user key in iterator.
UV - The type of user value in iterator.
R - The type of result.
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
ForStDBMapEntryIterRequest, ForStDBMapKeyIterRequest, ForStDBMapValueIterRequest

public abstract class ForStDBIterRequest<K,N,UK,UV,R> extends Object implements Closeable
The abstract iterator access request for ForStDB.
  • Constructor Details

    • ForStDBIterRequest

      public ForStDBIterRequest(ContextKey<K,N> contextKey, ForStMapState<K,N,UK,UV> table, org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.RocksIterator rocksIterator)
  • Method Details

    • deserializeUserValue

      protected UV deserializeUserValue(byte[] valueBytes) throws IOException
      Throws:
      IOException
    • deserializeUserKey

      protected UK deserializeUserKey(byte[] userKeyBytes, int userKeyOffset) throws IOException
      Throws:
      IOException
    • getKeyPrefixBytes

      protected byte[] getKeyPrefixBytes() throws IOException
      Throws:
      IOException
    • startWithKeyPrefix

      protected static boolean startWithKeyPrefix(byte[] keyPrefixBytes, byte[] rawKeyBytes, int kgPrefixBytes)
      Check if the raw key bytes start with the key prefix bytes.
      Parameters:
      keyPrefixBytes - the key prefix bytes.
      rawKeyBytes - the raw key bytes.
      kgPrefixBytes - the number of key group prefix bytes.
      Returns:
      true if the raw key bytes start with the key prefix bytes.
    • process

      public void process(org.forstdb.RocksDB db, int cacheSizeLimit) throws IOException
      Throws:
      IOException
    • completeStateFutureExceptionally

      public abstract void completeStateFutureExceptionally(String message, Throwable ex)
    • deserializeElement

      public abstract Collection<R> deserializeElement(List<org.apache.flink.state.forst.ForStDBIterRequest.RawEntry> entries, int userKeyOffset) throws IOException
      Throws:
      IOException
    • buildIteratorAndCompleteFuture

      public abstract void buildIteratorAndCompleteFuture(Collection<R> partialResult, boolean encounterEnd)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException