ShardChoser.php 519 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php

namespace Doctrine\DBAL\Sharding\ShardChoser;

use Doctrine\DBAL\Sharding\PoolingShardConnection;

/**
 * Given a distribution value this shard-choser strategy will pick the shard to
 * connect to for retrieving rows with the distribution value.
 */
interface ShardChoser
{
    /**
Benjamin Morel's avatar
Benjamin Morel committed
14
     * Picks a shard for the given distribution value.
15
     *
16
     * @param string|int $distributionValue
Benjamin Morel's avatar
Benjamin Morel committed
17
     *
18
     * @return string|int
19
     */
20
    public function pickShard($distributionValue, PoolingShardConnection $conn);
21
}