Class BackendConnection (0.7.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicclass BackendConnectionThis class emulates a backend PostgreSQL connection. Statements are buffered in memory until a flush/sync is received. This makes it possible to batch multiple statements together before sending these to Cloud Spanner. This class also keeps track of the transaction status of the connection.
Inherited Members
Static Fields
TRANSACTION_ABORTED_ERROR
publicstaticfinalStringTRANSACTION_ABORTED_ERRORMethods
execute(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement)
publicFuture<StatementResult>execute(AbstractStatementParser.ParsedStatementparsedStatement,Statementstatement)Buffers the given statement for execution on the backend connection when the next flush/sync message is received. The returned future will contain the result of the statement when execution has finished.
com.google.cloud.spanner.StatementexecuteCopy(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement, CopyDataReceiver copyDataReceiver, MutationWriter mutationWriter, ExecutorService executor)
publicFuture<StatementResult>executeCopy(AbstractStatementParser.ParsedStatementparsedStatement,Statementstatement,CopyDataReceivercopyDataReceiver,MutationWritermutationWriter,ExecutorServiceexecutor)Buffers the given COPY operation for execution on the backend connection when the next flush/sync message is received. The returned future will contain the result of the COPY operation when execution has finished.
com.google.cloud.spanner.StatementexecuteCopyOut(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement)
publicFuture<StatementResult>executeCopyOut(AbstractStatementParser.ParsedStatementparsedStatement,Statementstatement)com.google.cloud.spanner.StatementgetConnectionState()
publicBackendConnection.ConnectionStategetConnectionState()Returns the current connection state.
getCurrentDatabase()
publicStringgetCurrentDatabase()Returns the id of the database that this connection uses.
getCurrentSchema()
publicStringgetCurrentSchema()Returns the current schema that is used by this BackendConnection.
getSessionState()
publicSessionStategetSessionState()Returns the session state of this connection.
getSpannerConnection()
publicConnectiongetSpannerConnection()Returns the Spanner connection used by this BackendConnection.
initSessionSetting(String name, String value)
publicvoidinitSessionSetting(Stringname,Stringvalue)Sets the initial value of a pg_settings setting for this connection. This method should only be called during startup with values that come from the connection request.