PHP Class Kafka\Protocol\Encoder

Author: $_SWANBR_AUTHOR_$ +------------------------------------------------------------------------------
Inheritance: extends Kafka\Protocol\Protocol
Datei anzeigen Open project: nmred/kafka-php Class Usage Examples

Public Methods

Method Description
commitOffsetRequest ( array $payloads ) : string build consumer commit offset request
encodeArray ( array $array, Callable $func, null $options = null ) : string encode key array
encodeMessageSet ( array $messages, integer $compression = self::COMPRESSION_NONE ) : string encode message set N.B., MessageSets are not preceded by an int32 like other array elements in the protocol.
encodeString ( string $string, integer $bytes, integer $compression = self::COMPRESSION_NONE ) : string encode pack string type
fetchOffsetRequest ( array $payloads ) : string build consumer fetch offset request
fetchRequest ( array $payloads ) : string build fetch request
metadataRequest ( array $topics ) : string build metadata request protocol
offsetRequest ( array $payloads ) : string build offset request
produceRequest ( array $payloads, integer $compression = self::COMPRESSION_NONE ) : integer produce request
requestHeader ( string $clientId, integer $correlationId, integer $apiKey ) : string get request header

Protected Methods

Method Description
_encodeCommitOffset ( $values ) : string encode signal topic
_encodeCommitOffsetPartion ( $values ) : string encode signal part
_encodeFetchOffset ( $values ) : string encode signal topic
_encodeFetchOffsetPartion ( $values ) : string encode signal part
_encodeFetchPartion ( $values ) : string encode signal part
_encodeFetchTopic ( $values ) : string encode signal topic
_encodeMessage ( string $message, integer $compression = self::COMPRESSION_NONE ) : string encode signal message
_encodeOffsetPartion ( $values ) : string encode signal part
_encodeOffsetTopic ( $values ) : string encode signal topic
_encodeProcudePartion ( $values, $compression ) : string encode signal part
_encodeProcudeTopic ( $values, $compression ) : string encode signal topic

Method Details

_encodeCommitOffset() protected static method

encode signal topic
protected static _encodeCommitOffset ( $values ) : string
return string

_encodeCommitOffsetPartion() protected static method

encode signal part
protected static _encodeCommitOffsetPartion ( $values ) : string
return string

_encodeFetchOffset() protected static method

encode signal topic
protected static _encodeFetchOffset ( $values ) : string
return string

_encodeFetchOffsetPartion() protected static method

encode signal part
protected static _encodeFetchOffsetPartion ( $values ) : string
return string

_encodeFetchPartion() protected static method

encode signal part
protected static _encodeFetchPartion ( $values ) : string
return string

_encodeFetchTopic() protected static method

encode signal topic
protected static _encodeFetchTopic ( $values ) : string
return string

_encodeMessage() protected static method

encode signal message
protected static _encodeMessage ( string $message, integer $compression = self::COMPRESSION_NONE ) : string
$message string
$compression integer
return string

_encodeOffsetPartion() protected static method

encode signal part
protected static _encodeOffsetPartion ( $values ) : string
return string

_encodeOffsetTopic() protected static method

encode signal topic
protected static _encodeOffsetTopic ( $values ) : string
return string

_encodeProcudePartion() protected static method

encode signal part
protected static _encodeProcudePartion ( $values, $compression ) : string
$values
$compression
return string

_encodeProcudeTopic() protected static method

encode signal topic
protected static _encodeProcudeTopic ( $values, $compression ) : string
$values
$compression
return string

commitOffsetRequest() public method

build consumer commit offset request
public commitOffsetRequest ( array $payloads ) : string
$payloads array
return string

encodeArray() public static method

encode key array
public static encodeArray ( array $array, Callable $func, null $options = null ) : string
$array array
$func Callable
$options null
return string

encodeMessageSet() public static method

encode message set N.B., MessageSets are not preceded by an int32 like other array elements in the protocol.
public static encodeMessageSet ( array $messages, integer $compression = self::COMPRESSION_NONE ) : string
$messages array
$compression integer
return string

encodeString() public static method

encode pack string type
public static encodeString ( string $string, integer $bytes, integer $compression = self::COMPRESSION_NONE ) : string
$string string
$bytes integer self::PACK_INT32: int32 big endian order. self::PACK_INT16: int16 big endian order.
$compression integer
return string

fetchOffsetRequest() public method

build consumer fetch offset request
public fetchOffsetRequest ( array $payloads ) : string
$payloads array
return string

fetchRequest() public method

build fetch request
public fetchRequest ( array $payloads ) : string
$payloads array
return string

metadataRequest() public method

build metadata request protocol
public metadataRequest ( array $topics ) : string
$topics array
return string

offsetRequest() public method

build offset request
public offsetRequest ( array $payloads ) : string
$payloads array
return string

produceRequest() public method

produce request
public produceRequest ( array $payloads, integer $compression = self::COMPRESSION_NONE ) : integer
$payloads array
$compression integer
return integer

requestHeader() public static method

get request header
public static requestHeader ( string $clientId, integer $correlationId, integer $apiKey ) : string
$clientId string
$correlationId integer
$apiKey integer
return string