PHP Класс Cassandra\Cluster\Builder

См. также: Cassandra::cluster()
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
build ( ) : Cassandra\Cluster Returns a Cluster Instance.
withConnectTimeout ( float $timeout ) : Builder Timeout used for establishing TCP connections.
withConnectionsPerHost ( integer $core = 1, integer $max = 2 ) : Builder 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 ) : Builder Configures the initial endpoints. Note that the driver will automatically discover and connect to the rest of the cluster.
withCredentials ( string $username, string $password ) : Builder Configures cassandra authentication.
withDatacenterAwareRoundRobinLoadBalancingPolicy ( string $localDatacenter, integer $hostPerRemoteDatacenter, boolean $useRemoteDatacenterForLocalConsistencies ) : Builder Configures this cluster to use a datacenter aware round robin load balancing policy.
withDefaultConsistency ( integer $consistency ) : Builder Configures default consistency for all requests.
withDefaultPageSize ( integer | null $pageSize ) : Builder Configures default page size for all results.
withDefaultTimeout ( float | null $timeout ) : Builder Configures default timeout for future resolution in blocking operations Set to null to disable (default).
withIOThreads ( integer $count ) : Builder Total number of IO threads to use for handling the requests.
withLatencyAwareRouting ( boolean $enabled = true ) : Builder Enables/disables latency-aware routing.
withPersistentSessions ( boolean $enabled = true ) : Builder Enable persistent sessions and clusters.
withPort ( integer $port ) : Builder Specify a different port to be used when connecting to the cluster.
withProtocolVersion ( integer $version ) : Builder Force the driver to use a specific binary protocol version.
withReconnectInterval ( float $interval ) : Builder Specify interval in seconds that the driver should wait before attempting to re-establish a closed connection.
withRequestTimeout ( float $timeout ) : Builder Timeout used for waiting for a response from a node.
withRetryPolicy ( RetryPolicy $policy ) : Builder Configures the retry policy.
withRoundRobinLoadBalancingPolicy ( ) : Builder Configures this cluster to use a round robin load balancing policy.
withSSL ( Cassandra\SSLOptions $options ) : Builder Set up ssl context.
withSchemaMetadata ( boolean $enable = true ) : Builder Enables/disables Schema Metadata.
withTCPKeepalive ( float | null $delay ) : Builder Enables/disables TCP keepalive.
withTCPNodelay ( boolean $enabled = true ) : Builder Disables nagle algorithm for lower latency.
withTimestampGenerator ( Cassandra\TimestampGenerator $generator ) : Builder Sets the timestamp generator.
withTokenAwareRouting ( boolean $enabled = true ) : Builder Enable token aware routing.

Описание методов

build() публичный метод

Returns a Cluster Instance.
public build ( ) : Cassandra\Cluster
Результат Cassandra\Cluster Cluster instance

withConnectTimeout() публичный метод

Timeout used for establishing TCP connections.
public withConnectTimeout ( float $timeout ) : Builder
$timeout float Timeout value in seconds, can be fractional
Результат Builder self

withConnectionsPerHost() публичный метод

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.
public withConnectionsPerHost ( integer $core = 1, integer $max = 2 ) : Builder
$core integer minimum connections to keep open to any given host
$max integer maximum connections to keep open to any given host
Результат Builder self

withContactPoints() публичный метод

Configures the initial endpoints. Note that the driver will automatically discover and connect to the rest of the cluster.
public withContactPoints ( $host ) : Builder
Результат Builder self

withCredentials() публичный метод

Configures cassandra authentication.
public withCredentials ( string $username, string $password ) : Builder
$username string Username
$password string Password
Результат Builder self

withDatacenterAwareRoundRobinLoadBalancingPolicy() публичный метод

Configures this cluster to use a datacenter aware round robin load balancing policy.
public withDatacenterAwareRoundRobinLoadBalancingPolicy ( string $localDatacenter, integer $hostPerRemoteDatacenter, boolean $useRemoteDatacenterForLocalConsistencies ) : Builder
$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
Результат Builder self

withDefaultConsistency() публичный метод

Configures default consistency for all requests.
public withDefaultConsistency ( integer $consistency ) : Builder
$consistency integer A consistency level, must be one of Cassandra::CONSISTENCY_* values
Результат Builder self

withDefaultPageSize() публичный метод

Set to null to disable paging altogether.
public withDefaultPageSize ( integer | null $pageSize ) : Builder
$pageSize integer | null default page size
Результат Builder self

withDefaultTimeout() публичный метод

Configures default timeout for future resolution in blocking operations Set to null to disable (default).
public withDefaultTimeout ( float | null $timeout ) : Builder
$timeout float | null Timeout value in seconds, can be fractional
Результат Builder self

withIOThreads() публичный метод

Note: number of io threads * core connections per host <= total number of connections <= number of io threads * max connections per host
public withIOThreads ( integer $count ) : Builder
$count integer total number of threads.
Результат Builder self

withLatencyAwareRouting() публичный метод

Enables/disables latency-aware routing.
public withLatencyAwareRouting ( boolean $enabled = true ) : Builder
$enabled boolean whether to actually enable or disable the routing.
Результат Builder self

withPersistentSessions() публичный метод

Enable persistent sessions and clusters.
public withPersistentSessions ( boolean $enabled = true ) : Builder
$enabled boolean whether to enable persistent sessions and clusters (optional)
Результат Builder self

withPort() публичный метод

Specify a different port to be used when connecting to the cluster.
public withPort ( integer $port ) : Builder
$port integer a number between 1 and 65535
Результат Builder self

withProtocolVersion() публичный метод

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
public withProtocolVersion ( integer $version ) : Builder
$version integer the actual protocol version, only `1`, `2`, `3`, or `4` are supported
Результат Builder self

withReconnectInterval() публичный метод

Specify interval in seconds that the driver should wait before attempting to re-establish a closed connection.
public withReconnectInterval ( float $interval ) : Builder
$interval float interval in seconds
Результат Builder self

withRequestTimeout() публичный метод

Timeout used for waiting for a response from a node.
public withRequestTimeout ( float $timeout ) : Builder
$timeout float Timeout value in seconds, can be fractional
Результат Builder self

withRetryPolicy() публичный метод

Configures the retry policy.
public withRetryPolicy ( RetryPolicy $policy ) : Builder
$policy RetryPolicy the retry policy to use.
Результат Builder self

withRoundRobinLoadBalancingPolicy() публичный метод

Configures this cluster to use a round robin load balancing policy.
public withRoundRobinLoadBalancingPolicy ( ) : Builder
Результат Builder self

withSSL() публичный метод

Set up ssl context.
public withSSL ( Cassandra\SSLOptions $options ) : Builder
$options Cassandra\SSLOptions a preconfigured ssl context
Результат Builder self

withSchemaMetadata() публичный метод

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.
public withSchemaMetadata ( boolean $enable = true ) : Builder
$enable boolean whether the driver fetches and maintains schema metadata.
Результат Builder self

withTCPKeepalive() публичный метод

Enables/disables TCP keepalive.
public withTCPKeepalive ( float | null $delay ) : Builder
$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.
Результат Builder self

withTCPNodelay() публичный метод

Disables nagle algorithm for lower latency.
public withTCPNodelay ( boolean $enabled = true ) : Builder
$enabled boolean whether to actually enable or disable nodelay.
Результат Builder self

withTimestampGenerator() публичный метод

Sets the timestamp generator.
public withTimestampGenerator ( Cassandra\TimestampGenerator $generator ) : Builder
$generator Cassandra\TimestampGenerator A timestamp generator that will be used to generate timestamps for statements.
Результат Builder self

withTokenAwareRouting() публичный метод

Enable token aware routing.
public withTokenAwareRouting ( boolean $enabled = true ) : Builder
$enabled boolean Whether to enable token aware routing (optional)
Результат Builder self