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
  • Field Details

  • Method Details

    • getVersion

      public int getVersion()
    • serialize

      public byte[] serialize()
      Specified by:
      serialize in interface com.apple.foundationdb.relational.api.Continuation
    • getExecutionState

      @Nullable public byte[] getExecutionState()
      Specified by:
      getExecutionState in interface com.apple.foundationdb.relational.api.Continuation
    • getReason

      public com.apple.foundationdb.relational.api.Continuation.Reason getReason()
      Specified by:
      getReason in interface com.apple.foundationdb.relational.api.Continuation
    • hasCompiledStatement

      public boolean hasCompiledStatement()
    • getBindingHash

      @Nullable public Integer 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

      @Nullable public Integer 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

      @Nullable public CompiledStatement 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

      public static ContinuationBuilder newBuilder()
      Factory method to create a new ContinuationBuilder.
      Returns:
      a newly created continuation builder
    • asBuilder

      public ContinuationBuilder asBuilder()
      Create a ContinuationBuilder initialized 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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object