Actual session implementation.

See Also:

Implements

Methods

Cassandra\Schema

schema

( )

Returns current schema.

NOTE: the returned Cassandra\Schema instance will not be updated as the actual schema changes, instead an updated instance should be requested by calling Session::schema() again.

Returns:
Type Details
Cassandra\Schema

current schema.

Cassandra\Rows

execute

( Cassandra\Statement $statement, Cassandra\ExecutionOptions $options = null )

Executes a given statement and returns a result.

Parameters:
Name Type Details
$statement Cassandra\Statement

statement to be executed

$options Cassandra\ExecutionOptions

execution options (optional)

Throws:
Type Details
Cassandra\Exception
Returns:
Type Details
Cassandra\Rows

execution result

Cassandra\Future

executeAsync

( Cassandra\Statement $statement, Cassandra\ExecutionOptions $options = null )

Executes a given statement and returns a future result.

Note that this method ignores timeout specified in the Cassandra\ExecutionOptions, you can provide one to Future::get() instead.

Parameters:
Name Type Details
$statement Cassandra\Statement

statement to be executed

$options Cassandra\ExecutionOptions

execution options (optional)

Returns:
Type Details
Cassandra\Future

future result

Cassandra\PreparedStatement

prepare

( string $cql, Cassandra\ExecutionOptions $options = null )

Creates a prepared statement from a given CQL string.

Note that this method only uses the ExecutionOptions::$timeout option, all other options will be ignored.

Parameters:
Name Type Details
$cql string

CQL statement string

$options Cassandra\ExecutionOptions

execution options (optional)

Throws:
Type Details
Cassandra\Exception
Returns:
Type Details
Cassandra\PreparedStatement

prepared statement

Cassandra\Future

prepareAsync

( string $cql, Cassandra\ExecutionOptions $options = null )

Asynchronously prepares a statement and returns a future prepared statement.

Note that all options passed to this method will be ignored.

Parameters:
Name Type Details
$cql string

CQL string to be prepared

$options Cassandra\ExecutionOptions

preparation options

Returns:
Type Details
Cassandra\Future

statement

void

close

( float $timeout = null )

Closes current session and all of its connections.

Parameters:
Name Type Details
$timeout float

Timeout to wait for closure in seconds

Returns:
Type Details
void
Cassandra\Future

closeAsync

( )

Asynchronously closes current session once all pending requests have finished.

Returns:
Type Details
Cassandra\Future

future