Package org.apache.flink.state.forst
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 Summary
Constructors Constructor Description ForStDBIterRequest(ContextKey<K,N> contextKey, ForStMapState<K,N,UK,UV> table, org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.RocksIterator rocksIterator)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidbuildIteratorAndCompleteFuture(Collection<R> partialResult, boolean encounterEnd)voidclose()abstract voidcompleteStateFutureExceptionally(String message, Throwable ex)abstract Collection<R>deserializeElement(List<org.apache.flink.state.forst.ForStDBIterRequest.RawEntry> entries, int userKeyOffset)protected UKdeserializeUserKey(byte[] userKeyBytes, int userKeyOffset)protected UVdeserializeUserValue(byte[] valueBytes)protected byte[]getKeyPrefixBytes()voidprocess(org.forstdb.RocksDB db, int cacheSizeLimit)protected static booleanstartWithKeyPrefix(byte[] keyPrefixBytes, byte[] rawKeyBytes, int kgPrefixBytes)Check if the raw key bytes start with the key prefix bytes.
-
-
-
Constructor Detail
-
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 Detail
-
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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-