PHP Class Kafka\ZooKeeper

Author: $_SWANBR_AUTHOR_$ +------------------------------------------------------------------------------
Inheritance: implements Kafka\ClusterMetaData
Afficher le fichier Open project: nmred/kafka-php

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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

Method Details

__construct() public méthode

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

addPartitionOwner() public méthode

add partition owner
public addPartitionOwner ( string $groupId, string $topicName, integer $partitionId, string $consumerId ) : void
$groupId string
$topicName string
$partitionId integer
$consumerId string
Résultat void

cancelWatch() public méthode

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
Résultat boolean | null

getBrokerDetail() public méthode

get broker detail
public getBrokerDetail ( integer $brokerId ) : string | boolean
$brokerId integer
Résultat string | boolean

getConsumersPerTopic() public méthode

get consumer per topic
public getConsumersPerTopic ( string $groupId ) : array
$groupId string
Résultat array

getPartitionState() public méthode

get partition state
public getPartitionState ( string $topicName, integer $partitionId ) : string | boolean
$topicName string
$partitionId integer
Résultat string | boolean

getTopicDetail() public méthode

get topic detail
public getTopicDetail ( string $topicName ) : string | boolean
$topicName string
Résultat string | boolean

listBrokers() public méthode

get broker list using zookeeper
public listBrokers ( ) : array
Résultat array

listConsumer() public méthode

list consumer
public listConsumer ( string $groupId ) : array
$groupId string
Résultat array

makeZkNode() protected méthode

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
Résultat boolean

makeZkPath() protected méthode

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
Résultat boolean

refreshMetadata() public méthode

Clear internal caches
public refreshMetadata ( ) : null
Résultat null

registerConsumer() public méthode

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

watch() public méthode

Wath a given path
public watch ( string $path, callable $callback ) : string | null
$path string the path to node
$callback callable callback function
Résultat string | null

watchCallback() public méthode

Wath event callback warper
public watchCallback ( integer $event_type, integer $stat, string $path ) : the
$event_type integer
$stat integer
$path string
Résultat the return of the callback or null