PoolingShardManager
in package
implements
ShardManager
Shard Manager for the Connection Pooling Shard Strategy
Tags
Interfaces, Classes and Traits
- ShardManager
- Sharding Manager gives access to APIs to implementing sharding on top of Doctrine\DBAL\Connection instances.
Table of Contents
- $choser : ShardChoser
- $conn : PoolingShardConnection
- $currentDistributionValue : string|null
- __construct() : mixed
- getCurrentDistributionValue() : string|null
- Gets the distribution value currently used for sharding.
- getShards() : array<string|int, mixed>
- Gets information about the amount of shards and other details.
- queryAll() : array<string|int, mixed>
- Queries all shards in undefined order and return the results appended to each other. Restore the previous distribution value after execution.
- selectGlobal() : void
- Selects global database with global data.
- selectShard() : void
- Selects the shard against which the queries after this statement will be issued.
Properties
$choser
private
ShardChoser
$choser
$conn
private
PoolingShardConnection
$conn
$currentDistributionValue
private
string|null
$currentDistributionValue
Methods
__construct()
public
__construct(PoolingShardConnection $conn) : mixed
Parameters
- $conn : PoolingShardConnection
Return values
mixed —getCurrentDistributionValue()
Gets the distribution value currently used for sharding.
public
getCurrentDistributionValue() : string|null
Return values
string|null —getShards()
Gets information about the amount of shards and other details.
public
getShards() : array<string|int, mixed>
Return values
array<string|int, mixed> —queryAll()
Queries all shards in undefined order and return the results appended to each other. Restore the previous distribution value after execution.
public
queryAll(string $sql, array<string|int, mixed> $params, array<string|int, mixed> $types) : array<string|int, mixed>
Parameters
- $sql : string
- $params : array<string|int, mixed>
- $types : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —selectGlobal()
Selects global database with global data.
public
selectGlobal() : void
Return values
void —selectShard()
Selects the shard against which the queries after this statement will be issued.
public
selectShard(string $distributionValue) : void
Parameters
- $distributionValue : string