class Builder
Cassandra\Cluster
builder allows fluent configuration of the cluster instance.
Methods
Cassandra\Cluster
build
( )Returns a Cassandra\Cluster
Instance.
Configures default consistency for all requests.
Configures default page size for all results. Cassandra\Set
to null
to disable paging altogether.
Configures default timeout for future resolution in blocking operations Cassandra\Set
to null to disable (default).
Configures the initial endpoints. Note that the driver will automatically discover and connect to the rest of the cluster.
Specify a different port to be used when connecting to the cluster.
Cluster\Builder
withRoundRobinLoadBalancingPolicy
( )Configures this cluster to use a round robin load balancing policy.
Cluster\Builder
withDatacenterAwareRoundRobinLoadBalancingPolicy
(string
$localDatacenter, int
$hostPerRemoteDatacenter, bool
$useRemoteDatacenterForLocalConsistencies )
Configures this cluster to use a datacenter aware round robin load balancing policy.
Enable token aware routing.
Configures cassandra authentication.
Timeout used for establishing TCP connections.
Timeout used for waiting for a response from a node.
Cassandra\Set
up ssl context.
Enable persistent sessions and clusters.
Force the driver to use a specific binary protocol version.
Apache Cassandra
1.2+ supports protocol version 1 Apache Cassandra
2.0+ supports protocol version 2 Apache Cassandra
2.1+ supports protocol version 3 Apache Cassandra
2.2+ supports protocol version 4
NOTE: Apache Cassandra
3.x supports protocol version 3 and 4 only
Total number of IO threads to use for handling the requests.
Note: number of io threads * core connections per host <= total number of connections <= number of io threads * max connections per host
Cassandra\Set
the size of connection pools used by the driver. Pools are fixed when only $core
is given, when a $max
is specified as well, additional connections will be created automatically based on current load until the maximum number of connection has been reached. When request load goes down, extra connections are automatically cleaned up until only the core number of connections is left.
Specify interval in seconds that the driver should wait before attempting to re-establish a closed connection.
Enables/disables latency-aware routing.
Disables nagle algorithm for lower latency.
Enables/disables TCP keepalive.
Configures the retry policy.
Sets the timestamp generator.
Enables/disables Cassandra\Schema
Metadata.
If disabled this allows the driver to skip over retrieving and updating schema metadata, but it also disables the usage of token-aware routing and $session->schema() will always return an empty object. This can be useful for reducing the startup overhead of short-lived sessions.