PHP Class Kafka\Client

Author: $_SWANBR_AUTHOR_$ +------------------------------------------------------------------------------
显示文件 Open project: nmred/kafka-php Class Usage Examples

Public Methods

Method Description
__construct ( kafka\ClusterMetaData $metadata ) __construct
freeStream ( string $key ) : void free stream pool
getBrokers ( ) : array get broker server
getHostByPartition ( string $topicName, integer $partitionId ) : string get broker host by topic partition
getStream ( string $host, null $lockKey = null ) : array get broker broker connect
getStreamOption ( $name ) : mixed
getTopicDetail ( string $topicName ) : array get topic detail info
getZooKeeper ( ) : ZooKeeper get kafka zookeeper object
setStreamOption ( $name, $value )
setStreamOptions ( array $options = [] ) update stream options

Private Methods

Method Description
updateStreamOptions ( )

Method Details

__construct() public method

__construct
public __construct ( kafka\ClusterMetaData $metadata )
$metadata kafka\ClusterMetaData

freeStream() public method

free stream pool
public freeStream ( string $key ) : void
$key string
return void

getBrokers() public method

get broker server
public getBrokers ( ) : array
return array

getHostByPartition() public method

get broker host by topic partition
public getHostByPartition ( string $topicName, integer $partitionId ) : string
$topicName string
$partitionId integer
return string

getStream() public method

get broker broker connect
public getStream ( string $host, null $lockKey = null ) : array
$host string
$lockKey null
return array

getStreamOption() public method

public getStreamOption ( $name ) : mixed
$name - name of option
return mixed

getTopicDetail() public method

get topic detail info
public getTopicDetail ( string $topicName ) : array
$topicName string
return array

getZooKeeper() public method

get kafka zookeeper object
public getZooKeeper ( ) : ZooKeeper
return ZooKeeper

setStreamOption() public method

public setStreamOption ( $name, $value )
$name - name of stream option
$value - value for option

setStreamOptions() public method

update stream options
public setStreamOptions ( array $options = [] )
$options array