final class Cassandra (View source)

The main entry point to the PHP Driver for Apache Cassandra.

Use Cassandra::cluster() to build a cluster instance. Use Cassandra::ssl() to build SSL options instance.

Constants

CONSISTENCY_ANY

Consistency level ANY means the request is fulfilled as soon as the data has been written on the Coordinator. Requests with this consistency level are not guaranteed to make it to Replica nodes.

CONSISTENCY_ONE

Consistency level ONE guarantees that data has been written to at least one Replica node.

CONSISTENCY_TWO

Consistency level TWO guarantees that data has been written to at least two Replica nodes.

CONSISTENCY_THREE

Consistency level THREE guarantees that data has been written to at least three Replica nodes.

CONSISTENCY_QUORUM

Consistency level QUORUM guarantees that data has been written to at least the majority of Replica nodes. How many nodes exactly are a majority depends on the replication factor of a given keyspace and is calculated using the formula ceil(RF / 2 + 1), where ceil is a mathematical ceiling function and RF is the replication factor used. For example, for a replication factor of 5, the majority is ceil(5 / 2 + 1) = 3.

CONSISTENCY_ALL

Consistency level ALL guarantees that data has been written to all Replica nodes.

CONSISTENCY_LOCAL_QUORUM

Same as CONSISTENCY_QUORUM, but confined to the local data center. This consistency level works only with NetworkTopologyStrategy replication.

CONSISTENCY_EACH_QUORUM

Consistency level EACH_QUORUM guarantees that data has been written to at least a majority Replica nodes in all datacenters. This consistency level works only with NetworkTopologyStrategy replication.

CONSISTENCY_SERIAL

This is a serial consistency level, it is used in conditional updates, e.g. (CREATE|INSERT ... IF NOT EXISTS), and should be specified as the serial_consistency execution option when invoking session.execute or session.execute_async.

Consistency level SERIAL, when set, ensures that a Paxos commit fails if any of the replicas is down.

CONSISTENCY_LOCAL_SERIAL

Same as CONSISTENCY_SERIAL, but confined to the local data center. This consistency level works only with NetworkTopologyStrategy replication.

CONSISTENCY_LOCAL_ONE

Same as CONSISTENCY_ONE, but confined to the local data center. This consistency level works only with NetworkTopologyStrategy replication.

VERIFY_NONE

Perform no verification of nodes when using SSL encryption.

VERIFY_PEER_CERT

Verify presence and validity of SSL certificates.

VERIFY_PEER_IDENTITY

Verify that the IP address matches the SSL certificate’s common name or one of its subject alternative names. This implies the certificate is also present.

BATCH_LOGGED

BATCH_UNLOGGED

BATCH_COUNTER

LOG_DISABLED

Used to disable logging.

LOG_CRITICAL

Allow critical level logging.

LOG_ERROR

Allow error level logging.

LOG_WARN

Allow warning level logging.

LOG_INFO

Allow info level logging.

LOG_DEBUG

Allow debug level logging.

LOG_TRACE

Allow trace level logging.

TYPE_TEXT

When using a map, collection or set of type text, all of its elements must be strings.

TYPE_ASCII

When using a map, collection or set of type ascii, all of its elements must be strings.

TYPE_VARCHAR

When using a map, collection or set of type varchar, all of its elements must be strings.

TYPE_BIGINT

When using a map, collection or set of type bigint, all of its elements must be instances of Bigint.

TYPE_SMALLINT

When using a map, collection or set of type smallint, all of its elements must be instances of Inet.

TYPE_TINYINT

When using a map, collection or set of type tinyint, all of its elements must be instances of Inet.

TYPE_BLOB

When using a map, collection or set of type blob, all of its elements must be instances of Blob.

TYPE_BOOLEAN

When using a map, collection or set of type bool, all of its elements must be boolean.

TYPE_COUNTER

When using a map, collection or set of type counter, all of its elements must be instances of Bigint.

TYPE_DECIMAL

When using a map, collection or set of type decimal, all of its elements must be instances of Decimal.

TYPE_DOUBLE

When using a map, collection or set of type double, all of its elements must be doubles.

TYPE_FLOAT

When using a map, collection or set of type float, all of its elements must be instances of Float.

TYPE_INT

When using a map, collection or set of type int, all of its elements must be ints.

TYPE_TIMESTAMP

When using a map, collection or set of type timestamp, all of its elements must be instances of Timestamp.

TYPE_UUID

When using a map, collection or set of type uuid, all of its elements must be instances of Uuid.

TYPE_VARINT

When using a map, collection or set of type varint, all of its elements must be instances of Varint.

TYPE_TIMEUUID

When using a map, collection or set of type timeuuid, all of its elements must be instances of Timeuuid.

TYPE_INET

When using a map, collection or set of type inet, all of its elements must be instances of Inet.

VERSION

The current version of the extension.

CPP_DRIVER_VERSION

The version of the cpp-driver the extension is compiled against.

Methods

static Builder
cluster()

Creates a new cluster builder for constructing a Cluster object.

static Builder
ssl()

Creates a new ssl builder for constructing a SSLOptions object.

Details

static Builder cluster()

Creates a new cluster builder for constructing a Cluster object.

Return Value

Builder

A cluster builder object with default settings

static Builder ssl()

Creates a new ssl builder for constructing a SSLOptions object.

Return Value

Builder

A SSL options builder with default settings