Predis\Connection\Cluster\RedisCluster::buildSlotMap PHP Метод

buildSlotMap() публичный Метод

Generation is based on the same algorithm used by Redis to generate the cluster, so it is most effective when all of the connections supplied on initialization have the "slots" parameter properly set accordingly to the current cluster configuration.
public buildSlotMap ( )
    public function buildSlotMap()
    {
        $this->slotmap->reset();
        foreach ($this->pool as $connectionID => $connection) {
            $parameters = $connection->getParameters();
            if (!isset($parameters->slots)) {
                continue;
            }
            foreach (explode(',', $parameters->slots) as $slotRange) {
                $slots = explode('-', $slotRange, 2);
                if (!isset($slots[1])) {
                    $slots[1] = $slots[0];
                }
                $this->slotmap->setSlots($slots[0], $slots[1], $connectionID);
            }
        }
    }