Method | Description | |
---|---|---|
build ( ) : Cassandra\Cluster | Returns a Cluster Instance. | |
withConnectTimeout ( float $timeout ) : |
Timeout used for establishing TCP connections. | |
withConnectionsPerHost ( integer $core = 1, integer $max = 2 ) : |
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. | |
withContactPoints ( $host ) : |
Configures the initial endpoints. Note that the driver will automatically discover and connect to the rest of the cluster. | |
withCredentials ( string $username, string $password ) : |
Configures cassandra authentication. | |
withDatacenterAwareRoundRobinLoadBalancingPolicy ( string $localDatacenter, integer $hostPerRemoteDatacenter, boolean $useRemoteDatacenterForLocalConsistencies ) : |
Configures this cluster to use a datacenter aware round robin load balancing policy. | |
withDefaultConsistency ( integer $consistency ) : |
Configures default consistency for all requests. | |
withDefaultPageSize ( integer | null $pageSize ) : |
Configures default page size for all results. | |
withDefaultTimeout ( float | null $timeout ) : |
Configures default timeout for future resolution in blocking operations Set to null to disable (default). | |
withIOThreads ( integer $count ) : |
Total number of IO threads to use for handling the requests. | |
withLatencyAwareRouting ( boolean $enabled = true ) : |
Enables/disables latency-aware routing. | |
withPersistentSessions ( boolean $enabled = true ) : |
Enable persistent sessions and clusters. | |
withPort ( integer $port ) : |
Specify a different port to be used when connecting to the cluster. | |
withProtocolVersion ( integer $version ) : |
Force the driver to use a specific binary protocol version. | |
withReconnectInterval ( float $interval ) : |
Specify interval in seconds that the driver should wait before attempting to re-establish a closed connection. | |
withRequestTimeout ( float $timeout ) : |
Timeout used for waiting for a response from a node. | |
withRetryPolicy ( RetryPolicy $policy ) : |
Configures the retry policy. | |
withRoundRobinLoadBalancingPolicy ( ) : |
Configures this cluster to use a round robin load balancing policy. | |
withSSL ( Cassandra\SSLOptions $options ) : |
Set up ssl context. | |
withSchemaMetadata ( boolean $enable = true ) : |
Enables/disables Schema Metadata. | |
withTCPKeepalive ( float | null $delay ) : |
Enables/disables TCP keepalive. | |
withTCPNodelay ( boolean $enabled = true ) : |
Disables nagle algorithm for lower latency. | |
withTimestampGenerator ( Cassandra\TimestampGenerator $generator ) : |
Sets the timestamp generator. | |
withTokenAwareRouting ( boolean $enabled = true ) : |
Enable token aware routing. |
public build ( ) : Cassandra\Cluster | ||
return | Cassandra\Cluster | Cluster instance |
public withConnectTimeout ( float $timeout ) : |
||
$timeout | float | Timeout value in seconds, can be fractional |
return | self |
public withConnectionsPerHost ( integer $core = 1, integer $max = 2 ) : |
||
$core | integer | minimum connections to keep open to any given host |
$max | integer | maximum connections to keep open to any given host |
return | self |
public withContactPoints ( $host ) : |
||
return | self |
public withCredentials ( string $username, string $password ) : |
||
$username | string | Username |
$password | string | Password |
return | self |
public withDatacenterAwareRoundRobinLoadBalancingPolicy ( string $localDatacenter, integer $hostPerRemoteDatacenter, boolean $useRemoteDatacenterForLocalConsistencies ) : |
||
$localDatacenter | string | Name of the local datacenter |
$hostPerRemoteDatacenter | integer | Maximum number of hosts to try in remote datacenters |
$useRemoteDatacenterForLocalConsistencies | boolean | Allow using hosts from remote datacenters to execute statements with local consistencies |
return | self |
public withDefaultConsistency ( integer $consistency ) : |
||
$consistency | integer | A consistency level, must be one of Cassandra::CONSISTENCY_* values |
return | self |
public withDefaultPageSize ( integer | null $pageSize ) : |
||
$pageSize | integer | null | default page size |
return | self |
public withDefaultTimeout ( float | null $timeout ) : |
||
$timeout | float | null | Timeout value in seconds, can be fractional |
return | self |
public withIOThreads ( integer $count ) : |
||
$count | integer | total number of threads. |
return | self |
public withLatencyAwareRouting ( boolean $enabled = true ) : |
||
$enabled | boolean | whether to actually enable or disable the routing. |
return | self |
public withPersistentSessions ( boolean $enabled = true ) : |
||
$enabled | boolean | whether to enable persistent sessions and clusters (optional) |
return | self |
public withProtocolVersion ( integer $version ) : |
||
$version | integer | the actual protocol version, only `1`, `2`, `3`, or `4` are supported |
return | self |
public withReconnectInterval ( float $interval ) : |
||
$interval | float | interval in seconds |
return | self |
public withRequestTimeout ( float $timeout ) : |
||
$timeout | float | Timeout value in seconds, can be fractional |
return | self |
public withRetryPolicy ( RetryPolicy $policy ) : |
||
$policy | RetryPolicy | the retry policy to use. |
return | self |
public withRoundRobinLoadBalancingPolicy ( ) : |
||
return | self |
public withSSL ( Cassandra\SSLOptions $options ) : |
||
$options | Cassandra\SSLOptions | a preconfigured ssl context |
return | self |
public withSchemaMetadata ( boolean $enable = true ) : |
||
$enable | boolean | whether the driver fetches and maintains schema metadata. |
return | self |
public withTCPKeepalive ( float | null $delay ) : |
||
$delay | float | null | the period of inactivity in seconds, after which the keepalive probe should be sent over the connection. If set to `null`, disables keepalive probing. |
return | self |
public withTCPNodelay ( boolean $enabled = true ) : |
||
$enabled | boolean | whether to actually enable or disable nodelay. |
return | self |
public withTimestampGenerator ( Cassandra\TimestampGenerator $generator ) : |
||
$generator | Cassandra\TimestampGenerator | A timestamp generator that will be used to generate timestamps for statements. |
return | self |
public withTokenAwareRouting ( boolean $enabled = true ) : |
||
$enabled | boolean | Whether to enable token aware routing (optional) |
return | self |