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
The abstract iterator access request for ForStDB.
-
Constructor Summary
ConstructorsConstructorDescriptionForStDBIterRequest(ContextKey<K, N> contextKey, ForStMapState<K, N, UK, UV> table, org.apache.flink.runtime.asyncprocessing.StateRequestHandler stateRequestHandler, org.forstdb.RocksIterator rocksIterator) -
Method Summary
Modifier and TypeMethodDescriptionabstract 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[]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 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
- Throws:
IOException
-
deserializeUserKey
- Throws:
IOException
-
getKeyPrefixBytes
- 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
- Throws:
IOException
-
completeStateFutureExceptionally
-
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
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-