Kafka\ZooKeeper::addPartitionOwner PHP Метод

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

add partition owner
public addPartitionOwner ( string $groupId, string $topicName, integer $partitionId, string $consumerId ) : void
$groupId string
$topicName string
$partitionId integer
$consumerId string
Результат void
    public function addPartitionOwner($groupId, $topicName, $partitionId, $consumerId)
    {
        $path = sprintf(self::PARTITION_OWNER, (string) $groupId, $topicName);
        if (!$this->zookeeper->exists($path)) {
            $this->makeZkPath($path);
        }
        $partitionPath = $path . '/' . $partitionId;
        if (!$this->zookeeper->exists($partitionPath)) {
            $this->makeZkPath($partitionPath);
            $this->makeZkNode($partitionPath, $consumerId, \ZooKeeper::EPHEMERAL);
        }
        // if exists path other comsumer
    }