PHP 클래스 Cassandra\Cluster\Builder

또한 보기: Cassandra::cluster()
파일 보기 프로젝트 열기: datastax/php-driver 1 사용 예제들

공개 메소드들

메소드 설명
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