Class ContinuationImpl
java.lang.Object
com.apple.foundationdb.relational.recordlayer.ContinuationImpl
- All Implemented Interfaces:
com.apple.foundationdb.relational.api.Continuation
@API(EXPERIMENTAL)
public final class ContinuationImpl
extends Object
implements com.apple.foundationdb.relational.api.Continuation
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.apple.foundationdb.relational.api.Continuation
com.apple.foundationdb.relational.api.Continuation.Reason -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContinuationImplstatic final intstatic final ContinuationImpl -
Method Summary
Modifier and TypeMethodDescriptionCreate aContinuationBuilderinitialized to the state of this continuation.static ContinuationImplcopyOf(com.apple.foundationdb.relational.api.Continuation other) booleanstatic com.apple.foundationdb.relational.api.ContinuationfromInt(int offset) Create a new continuation from a given (inner) continuation Integer offset.static com.apple.foundationdb.relational.api.ContinuationfromRecordCursorContinuation(RecordCursorContinuation cursorContinuation) Create a new continuation from a given cursor continuation.static com.apple.foundationdb.relational.api.ContinuationfromUnderlyingBytes(byte[] bytes) Create a new continuation from a given (inner) continuation bytes.Hash code for the parameter binding for the continuation.Return the compiled statement proto if a package is contained inside the continuation.byte[]Hash code for the plan for the continuation.com.apple.foundationdb.relational.api.Continuation.ReasonintbooleaninthashCode()static ContinuationBuilderFactory method to create a newContinuationBuilder.static ContinuationImplparseContinuation(byte[] bytes) Deserialize and parse a continuation.byte[]Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.apple.foundationdb.relational.api.Continuation
atBeginning, atEnd
-
Field Details
-
CURRENT_VERSION
public static final int CURRENT_VERSION- See Also:
-
BEGIN
-
END
-
-
Method Details
-
getVersion
public int getVersion() -
serialize
public byte[] serialize()- Specified by:
serializein interfacecom.apple.foundationdb.relational.api.Continuation
-
getExecutionState
@Nullable public byte[] getExecutionState()- Specified by:
getExecutionStatein interfacecom.apple.foundationdb.relational.api.Continuation
-
getReason
public com.apple.foundationdb.relational.api.Continuation.Reason getReason()- Specified by:
getReasonin interfacecom.apple.foundationdb.relational.api.Continuation
-
hasCompiledStatement
public boolean hasCompiledStatement() -
getBindingHash
Hash code for the parameter binding for the continuation. Once the query gets a continuation, a stable hash of the parameter binding (both explicit - from the customer and implicit - added by the system) is stored in the continuation. Once another query request is attempted with the continuation, the binding hash can be compared to verify that the query matches the continuation. The request will be rejected if the hashes do not match.- Returns:
- a stable hash for the parameter bindings for the continuation
-
getPlanHash
Hash code for the plan for the continuation. The plan hash represents the plan that was used to execute the query. This would detect changes to the plan (either because the query changed or because the environment changed). Once a query is attempted with a continuation where the plan hash does not match that of the continuation, the query gets rejected.- Returns:
- the hash of the plan
-
getCompiledStatement
Return the compiled statement proto if a package is contained inside the continuation. import com.apple.foundationdb.annotation.API;- Returns:
- the
CompiledStatement.
-
fromUnderlyingBytes
public static com.apple.foundationdb.relational.api.Continuation fromUnderlyingBytes(@Nullable byte[] bytes) Create a new continuation from a given (inner) continuation bytes.- Parameters:
bytes- the inner (cursor continuation) to be placed inside the newly created continuation- Returns:
- a continuation that holds the given cursor continuation
-
fromInt
public static com.apple.foundationdb.relational.api.Continuation fromInt(int offset) Create a new continuation from a given (inner) continuation Integer offset.- Parameters:
offset- the offset to be placed inside the newly created continuation- Returns:
- a continuation that holds the given offset
-
fromRecordCursorContinuation
public static com.apple.foundationdb.relational.api.Continuation fromRecordCursorContinuation(RecordCursorContinuation cursorContinuation) Create a new continuation from a given cursor continuation.- Parameters:
cursorContinuation- the inner cursor continuation to be placed inside the newly created continuation- Returns:
- a continuation that holds the given cursor continuation
-
parseContinuation
public static ContinuationImpl parseContinuation(byte[] bytes) throws InvalidProtocolBufferException Deserialize and parse a continuation. This would create a continuation from a previously serialized byte array.- Parameters:
bytes- the serialized continuation- Returns:
- the deserialized continuation
- Throws:
InvalidProtocolBufferException- in case the continuation cannot be deserialized
-
copyOf
public static ContinuationImpl copyOf(@Nonnull com.apple.foundationdb.relational.api.Continuation other) throws com.apple.foundationdb.relational.api.exceptions.RelationalException - Throws:
com.apple.foundationdb.relational.api.exceptions.RelationalException
-
newBuilder
Factory method to create a newContinuationBuilder.- Returns:
- a newly created continuation builder
-
asBuilder
Create aContinuationBuilderinitialized to the state of this continuation. This can be used as a mutation method to modify an existing continuation.- Returns:
- a builder initialized to the state of this continuation
-
equals
-
hashCode
public int hashCode()
-