PHP Класс Kafka\ZooKeeper

Автор: $_SWANBR_AUTHOR_$ +------------------------------------------------------------------------------
Наследование: implements Kafka\ClusterMetaData
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( $hostList, null $timeout = null ) __construct
addPartitionOwner ( string $groupId, string $topicName, integer $partitionId, string $consumerId ) : void add partition owner
cancelWatch ( string $path, callable $callback = null ) : boolean | null Delete watch callback on a node, delete all callback when $callback is null
getBrokerDetail ( integer $brokerId ) : string | boolean get broker detail
getConsumersPerTopic ( string $groupId ) : array get consumer per topic
getPartitionState ( string $topicName, integer $partitionId ) : string | boolean get partition state
getTopicDetail ( string $topicName ) : string | boolean get topic detail
listBrokers ( ) : array get broker list using zookeeper
listConsumer ( string $groupId ) : array list consumer
refreshMetadata ( ) : null Clear internal caches
registerConsumer ( $groupId, integer $consumerId, array $topics = [] ) register consumer
watch ( string $path, callable $callback ) : string | null Wath a given path
watchCallback ( integer $event_type, integer $stat, string $path ) : the Wath event callback warper

Защищенные методы

Метод Описание
makeZkNode ( string $path, mixed $value, $flag = null ) : boolean Create a node on ZooKeeper at the given path
makeZkPath ( string $path, mixed $value ) : boolean Equivalent of "mkdir -p" on ZooKeeper

Описание методов

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

__construct
public __construct ( $hostList, null $timeout = null )
$hostList
$timeout null

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

add partition owner
public addPartitionOwner ( string $groupId, string $topicName, integer $partitionId, string $consumerId ) : void
$groupId string
$topicName string
$partitionId integer
$consumerId string
Результат void

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

Delete watch callback on a node, delete all callback when $callback is null
public cancelWatch ( string $path, callable $callback = null ) : boolean | null
$path string
$callback callable
Результат boolean | null

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

get broker detail
public getBrokerDetail ( integer $brokerId ) : string | boolean
$brokerId integer
Результат string | boolean

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

get consumer per topic
public getConsumersPerTopic ( string $groupId ) : array
$groupId string
Результат array

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

get partition state
public getPartitionState ( string $topicName, integer $partitionId ) : string | boolean
$topicName string
$partitionId integer
Результат string | boolean

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

get topic detail
public getTopicDetail ( string $topicName ) : string | boolean
$topicName string
Результат string | boolean

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

get broker list using zookeeper
public listBrokers ( ) : array
Результат array

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

list consumer
public listConsumer ( string $groupId ) : array
$groupId string
Результат array

makeZkNode() защищенный Метод

Create a node on ZooKeeper at the given path
protected makeZkNode ( string $path, mixed $value, $flag = null ) : boolean
$path string The path to the node
$value mixed The value to assign to the new node
Результат boolean

makeZkPath() защищенный Метод

Equivalent of "mkdir -p" on ZooKeeper
protected makeZkPath ( string $path, mixed $value ) : boolean
$path string The path to the node
$value mixed The value to assign to each new node along the path
Результат boolean

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

Clear internal caches
public refreshMetadata ( ) : null
Результат null

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

register consumer
public registerConsumer ( $groupId, integer $consumerId, array $topics = [] )
$groupId
$consumerId integer
$topics array

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

Wath a given path
public watch ( string $path, callable $callback ) : string | null
$path string the path to node
$callback callable callback function
Результат string | null

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

Wath event callback warper
public watchCallback ( integer $event_type, integer $stat, string $path ) : the
$event_type integer
$stat integer
$path string
Результат the return of the callback or null