mirror of
https://github.com/danog/psalm.git
synced 2024-12-02 09:37:59 +01:00
3578b42e5c
Fixes #3406
1195 lines
30 KiB
PHP
1195 lines
30 KiB
PHP
<?php
|
|
|
|
namespace {
|
|
|
|
const RD_KAFKA_RESP_ERR__BEGIN = -200;
|
|
const RD_KAFKA_RESP_ERR__BAD_MSG = -199;
|
|
const RD_KAFKA_RESP_ERR__BAD_COMPRESSION = -198;
|
|
const RD_KAFKA_RESP_ERR__DESTROY = -197;
|
|
const RD_KAFKA_RESP_ERR__FAIL = -196;
|
|
const RD_KAFKA_RESP_ERR__TRANSPORT = -195;
|
|
const RD_KAFKA_RESP_ERR__CRIT_SYS_RESOURCE = -194;
|
|
const RD_KAFKA_RESP_ERR__RESOLVE = -193;
|
|
const RD_KAFKA_RESP_ERR__MSG_TIMED_OUT = -192;
|
|
const RD_KAFKA_RESP_ERR__PARTITION_EOF = -191;
|
|
const RD_KAFKA_RESP_ERR__UNKNOWN_PARTITION = -190;
|
|
const RD_KAFKA_RESP_ERR__FS = -189;
|
|
const RD_KAFKA_RESP_ERR__UNKNOWN_TOPIC = -188;
|
|
const RD_KAFKA_RESP_ERR__ALL_BROKERS_DOWN = -187;
|
|
const RD_KAFKA_RESP_ERR__INVALID_ARG = -186;
|
|
const RD_KAFKA_RESP_ERR__TIMED_OUT = -185;
|
|
const RD_KAFKA_RESP_ERR__QUEUE_FULL = -184;
|
|
const RD_KAFKA_RESP_ERR__ISR_INSUFF = -183;
|
|
const RD_KAFKA_RESP_ERR__NODE_UPDATE = -182;
|
|
const RD_KAFKA_RESP_ERR__SSL = -181;
|
|
const RD_KAFKA_RESP_ERR__WAIT_COORD = -180;
|
|
const RD_KAFKA_RESP_ERR__UNKNOWN_GROUP = -179;
|
|
const RD_KAFKA_RESP_ERR__IN_PROGRESS = -178;
|
|
const RD_KAFKA_RESP_ERR__PREV_IN_PROGRESS = -177;
|
|
const RD_KAFKA_RESP_ERR__EXISTING_SUBSCRIPTION = -176;
|
|
const RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS = -175;
|
|
const RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS = -174;
|
|
const RD_KAFKA_RESP_ERR__CONFLICT = -173;
|
|
const RD_KAFKA_RESP_ERR__STATE = -172;
|
|
const RD_KAFKA_RESP_ERR__UNKNOWN_PROTOCOL = -171;
|
|
const RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED = -170;
|
|
const RD_KAFKA_RESP_ERR__AUTHENTICATION = -169;
|
|
const RD_KAFKA_RESP_ERR__NO_OFFSET = -168;
|
|
const RD_KAFKA_RESP_ERR__OUTDATED = -167;
|
|
const RD_KAFKA_RESP_ERR__TIMED_OUT_QUEUE = -166;
|
|
const RD_KAFKA_RESP_ERR__UNSUPPORTED_FEATURE = -165;
|
|
const RD_KAFKA_RESP_ERR__WAIT_CACHE = -164;
|
|
const RD_KAFKA_RESP_ERR__INTR = -163;
|
|
const RD_KAFKA_RESP_ERR__KEY_SERIALIZATION = -162;
|
|
const RD_KAFKA_RESP_ERR__VALUE_SERIALIZATION = -161;
|
|
const RD_KAFKA_RESP_ERR__KEY_DESERIALIZATION = -160;
|
|
const RD_KAFKA_RESP_ERR__VALUE_DESERIALIZATION = -159;
|
|
const RD_KAFKA_RESP_ERR__PARTIAL = -158;
|
|
const RD_KAFKA_RESP_ERR__READ_ONLY = -157;
|
|
const RD_KAFKA_RESP_ERR__NOENT = -156;
|
|
const RD_KAFKA_RESP_ERR__UNDERFLOW = -155;
|
|
const RD_KAFKA_RESP_ERR__INVALID_TYPE = -154;
|
|
const RD_KAFKA_RESP_ERR__RETRY = -153;
|
|
const RD_KAFKA_RESP_ERR__PURGE_QUEUE = -152;
|
|
const RD_KAFKA_RESP_ERR__PURGE_INFLIGHT = -151;
|
|
const RD_KAFKA_RESP_ERR__FATAL = -150;
|
|
const RD_KAFKA_RESP_ERR__INCONSISTENT = -149;
|
|
const RD_KAFKA_RESP_ERR__GAPLESS_GUARANTEE = -148;
|
|
const RD_KAFKA_RESP_ERR__MAX_POLL_EXCEEDED = -147;
|
|
const RD_KAFKA_RESP_ERR__UNKNOWN_BROKER = -146;
|
|
const RD_KAFKA_RESP_ERR__NOT_CONFIGURED = -145;
|
|
const RD_KAFKA_RESP_ERR__FENCED = -144;
|
|
const RD_KAFKA_RESP_ERR__APPLICATION = -143;
|
|
const RD_KAFKA_RESP_ERR__ASSIGNMENT_LOST = -142;
|
|
const RD_KAFKA_RESP_ERR__NOOP = -141;
|
|
const RD_KAFKA_RESP_ERR__AUTO_OFFSET_RESET = -140;
|
|
const RD_KAFKA_RESP_ERR__END = -100;
|
|
const RD_KAFKA_RESP_ERR_UNKNOWN = -1;
|
|
const RD_KAFKA_RESP_ERR_NO_ERROR = 0;
|
|
const RD_KAFKA_RESP_ERR_OFFSET_OUT_OF_RANGE = 1;
|
|
const RD_KAFKA_RESP_ERR_INVALID_MSG = 2;
|
|
const RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PART = 3;
|
|
const RD_KAFKA_RESP_ERR_INVALID_MSG_SIZE = 4;
|
|
const RD_KAFKA_RESP_ERR_LEADER_NOT_AVAILABLE = 5;
|
|
const RD_KAFKA_RESP_ERR_NOT_LEADER_FOR_PARTITION = 6;
|
|
const RD_KAFKA_RESP_ERR_REQUEST_TIMED_OUT = 7;
|
|
const RD_KAFKA_RESP_ERR_BROKER_NOT_AVAILABLE = 8;
|
|
const RD_KAFKA_RESP_ERR_REPLICA_NOT_AVAILABLE = 9;
|
|
const RD_KAFKA_RESP_ERR_MSG_SIZE_TOO_LARGE = 10;
|
|
const RD_KAFKA_RESP_ERR_STALE_CTRL_EPOCH = 11;
|
|
const RD_KAFKA_RESP_ERR_OFFSET_METADATA_TOO_LARGE = 12;
|
|
const RD_KAFKA_RESP_ERR_NETWORK_EXCEPTION = 13;
|
|
const RD_KAFKA_RESP_ERR_COORDINATOR_LOAD_IN_PROGRESS = 14;
|
|
const RD_KAFKA_RESP_ERR_COORDINATOR_NOT_AVAILABLE = 15;
|
|
const RD_KAFKA_RESP_ERR_NOT_COORDINATOR = 16;
|
|
const RD_KAFKA_RESP_ERR_GROUP_LOAD_IN_PROGRESS = 14; // alias, RD_KAFKA_RESP_ERR_COORDINATOR_LOAD_IN_PROGRESS
|
|
const RD_KAFKA_RESP_ERR_GROUP_COORDINATOR_NOT_AVAILABLE = 15; // alias, RD_KAFKA_RESP_ERR_COORDINATOR_NOT_AVAILABLE
|
|
const RD_KAFKA_RESP_ERR_NOT_COORDINATOR_FOR_GROUP = 16; // alias, RD_KAFKA_RESP_ERR_NOT_COORDINATOR
|
|
const RD_KAFKA_RESP_ERR_TOPIC_EXCEPTION = 17;
|
|
const RD_KAFKA_RESP_ERR_RECORD_LIST_TOO_LARGE = 18;
|
|
const RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS = 19;
|
|
const RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND = 20;
|
|
const RD_KAFKA_RESP_ERR_INVALID_REQUIRED_ACKS = 21;
|
|
const RD_KAFKA_RESP_ERR_ILLEGAL_GENERATION = 22;
|
|
const RD_KAFKA_RESP_ERR_INCONSISTENT_GROUP_PROTOCOL = 23;
|
|
const RD_KAFKA_RESP_ERR_INVALID_GROUP_ID = 24;
|
|
const RD_KAFKA_RESP_ERR_UNKNOWN_MEMBER_ID = 25;
|
|
const RD_KAFKA_RESP_ERR_INVALID_SESSION_TIMEOUT = 26;
|
|
const RD_KAFKA_RESP_ERR_REBALANCE_IN_PROGRESS = 27;
|
|
const RD_KAFKA_RESP_ERR_INVALID_COMMIT_OFFSET_SIZE = 28;
|
|
const RD_KAFKA_RESP_ERR_TOPIC_AUTHORIZATION_FAILED = 29;
|
|
const RD_KAFKA_RESP_ERR_GROUP_AUTHORIZATION_FAILED = 30;
|
|
const RD_KAFKA_RESP_ERR_CLUSTER_AUTHORIZATION_FAILED = 31;
|
|
const RD_KAFKA_RESP_ERR_INVALID_TIMESTAMP = 32;
|
|
const RD_KAFKA_RESP_ERR_UNSUPPORTED_SASL_MECHANISM = 33;
|
|
const RD_KAFKA_RESP_ERR_ILLEGAL_SASL_STATE = 34;
|
|
const RD_KAFKA_RESP_ERR_UNSUPPORTED_VERSION = 35;
|
|
const RD_KAFKA_RESP_ERR_TOPIC_ALREADY_EXISTS = 36;
|
|
const RD_KAFKA_RESP_ERR_INVALID_PARTITIONS = 37;
|
|
const RD_KAFKA_RESP_ERR_INVALID_REPLICATION_FACTOR = 38;
|
|
const RD_KAFKA_RESP_ERR_INVALID_REPLICA_ASSIGNMENT = 39;
|
|
const RD_KAFKA_RESP_ERR_INVALID_CONFIG = 40;
|
|
const RD_KAFKA_RESP_ERR_NOT_CONTROLLER = 41;
|
|
const RD_KAFKA_RESP_ERR_INVALID_REQUEST = 42;
|
|
const RD_KAFKA_RESP_ERR_UNSUPPORTED_FOR_MESSAGE_FORMAT = 43;
|
|
const RD_KAFKA_RESP_ERR_POLICY_VIOLATION = 44;
|
|
const RD_KAFKA_RESP_ERR_OUT_OF_ORDER_SEQUENCE_NUMBER = 45;
|
|
const RD_KAFKA_RESP_ERR_DUPLICATE_SEQUENCE_NUMBER = 46;
|
|
const RD_KAFKA_RESP_ERR_INVALID_PRODUCER_EPOCH = 47;
|
|
const RD_KAFKA_RESP_ERR_INVALID_TXN_STATE = 48;
|
|
const RD_KAFKA_RESP_ERR_INVALID_PRODUCER_ID_MAPPING = 49;
|
|
const RD_KAFKA_RESP_ERR_INVALID_TRANSACTION_TIMEOUT = 50;
|
|
const RD_KAFKA_RESP_ERR_CONCURRENT_TRANSACTIONS = 51;
|
|
const RD_KAFKA_RESP_ERR_TRANSACTION_COORDINATOR_FENCED = 52;
|
|
const RD_KAFKA_RESP_ERR_TRANSACTIONAL_ID_AUTHORIZATION_FAILED = 53;
|
|
const RD_KAFKA_RESP_ERR_SECURITY_DISABLED = 54;
|
|
const RD_KAFKA_RESP_ERR_OPERATION_NOT_ATTEMPTED = 55;
|
|
const RD_KAFKA_RESP_ERR_KAFKA_STORAGE_ERROR = 56;
|
|
const RD_KAFKA_RESP_ERR_LOG_DIR_NOT_FOUND = 57;
|
|
const RD_KAFKA_RESP_ERR_SASL_AUTHENTICATION_FAILED = 58;
|
|
const RD_KAFKA_RESP_ERR_UNKNOWN_PRODUCER_ID = 59;
|
|
const RD_KAFKA_RESP_ERR_REASSIGNMENT_IN_PROGRESS = 60;
|
|
const RD_KAFKA_RESP_ERR_DELEGATION_TOKEN_AUTH_DISABLED = 61;
|
|
const RD_KAFKA_RESP_ERR_DELEGATION_TOKEN_NOT_FOUND = 62;
|
|
const RD_KAFKA_RESP_ERR_DELEGATION_TOKEN_OWNER_MISMATCH = 63;
|
|
const RD_KAFKA_RESP_ERR_DELEGATION_TOKEN_REQUEST_NOT_ALLOWED = 64;
|
|
const RD_KAFKA_RESP_ERR_DELEGATION_TOKEN_AUTHORIZATION_FAILED = 65;
|
|
const RD_KAFKA_RESP_ERR_DELEGATION_TOKEN_EXPIRED = 66;
|
|
const RD_KAFKA_RESP_ERR_INVALID_PRINCIPAL_TYPE = 67;
|
|
const RD_KAFKA_RESP_ERR_NON_EMPTY_GROUP = 68;
|
|
const RD_KAFKA_RESP_ERR_GROUP_ID_NOT_FOUND = 69;
|
|
const RD_KAFKA_RESP_ERR_FETCH_SESSION_ID_NOT_FOUND = 70;
|
|
const RD_KAFKA_RESP_ERR_INVALID_FETCH_SESSION_EPOCH = 71;
|
|
const RD_KAFKA_RESP_ERR_LISTENER_NOT_FOUND = 72;
|
|
const RD_KAFKA_RESP_ERR_TOPIC_DELETION_DISABLED = 73;
|
|
const RD_KAFKA_RESP_ERR_FENCED_LEADER_EPOCH = 74;
|
|
const RD_KAFKA_RESP_ERR_UNKNOWN_LEADER_EPOCH = 75;
|
|
const RD_KAFKA_RESP_ERR_UNSUPPORTED_COMPRESSION_TYPE = 76;
|
|
const RD_KAFKA_RESP_ERR_STALE_BROKER_EPOCH = 77;
|
|
const RD_KAFKA_RESP_ERR_OFFSET_NOT_AVAILABLE = 78;
|
|
const RD_KAFKA_RESP_ERR_MEMBER_ID_REQUIRED = 79;
|
|
const RD_KAFKA_RESP_ERR_PREFERRED_LEADER_NOT_AVAILABLE = 80;
|
|
const RD_KAFKA_RESP_ERR_GROUP_MAX_SIZE_REACHED = 81;
|
|
const RD_KAFKA_RESP_ERR_FENCED_INSTANCE_ID = 82;
|
|
const RD_KAFKA_RESP_ERR_ELIGIBLE_LEADERS_NOT_AVAILABLE = 83;
|
|
const RD_KAFKA_RESP_ERR_ELECTION_NOT_NEEDED = 84;
|
|
const RD_KAFKA_RESP_ERR_NO_REASSIGNMENT_IN_PROGRESS = 85;
|
|
const RD_KAFKA_RESP_ERR_GROUP_SUBSCRIBED_TO_TOPIC = 86;
|
|
const RD_KAFKA_RESP_ERR_INVALID_RECORD = 87;
|
|
const RD_KAFKA_RESP_ERR_UNSTABLE_OFFSET_COMMIT = 88;
|
|
const RD_KAFKA_RESP_ERR_THROTTLING_QUOTA_EXCEEDED = 89;
|
|
const RD_KAFKA_RESP_ERR_PRODUCER_FENCED = 90;
|
|
const RD_KAFKA_RESP_ERR_RESOURCE_NOT_FOUND = 91;
|
|
const RD_KAFKA_RESP_ERR_DUPLICATE_RESOURCE = 92;
|
|
const RD_KAFKA_RESP_ERR_UNACCEPTABLE_CREDENTIAL = 93;
|
|
const RD_KAFKA_RESP_ERR_INCONSISTENT_VOTER_SET = 94;
|
|
const RD_KAFKA_RESP_ERR_INVALID_UPDATE_VERSION = 95;
|
|
const RD_KAFKA_RESP_ERR_FEATURE_UPDATE_FAILED = 96;
|
|
const RD_KAFKA_RESP_ERR_PRINCIPAL_DESERIALIZATION_FAILURE = 97;
|
|
const RD_KAFKA_CONSUMER = 1;
|
|
const RD_KAFKA_OFFSET_BEGINNING = -2;
|
|
const RD_KAFKA_OFFSET_END = -1;
|
|
const RD_KAFKA_OFFSET_STORED = -1000;
|
|
const RD_KAFKA_OFFSET_INVALID = -1001;
|
|
const RD_KAFKA_PARTITION_UA = -1;
|
|
const RD_KAFKA_PRODUCER = 0;
|
|
const RD_KAFKA_VERSION = 525568;
|
|
const RD_KAFKA_BUILD_VERSION = 17236223;
|
|
const RD_KAFKA_CONF_UNKNOWN = -2;
|
|
const RD_KAFKA_CONF_INVALID = -1;
|
|
const RD_KAFKA_CONF_OK = 0;
|
|
const RD_KAFKA_MSG_PARTITIONER_RANDOM = 2;
|
|
const RD_KAFKA_MSG_PARTITIONER_CONSISTENT = 3;
|
|
const RD_KAFKA_MSG_PARTITIONER_CONSISTENT_RANDOM = 4;
|
|
const RD_KAFKA_MSG_PARTITIONER_MURMUR2 = 5;
|
|
const RD_KAFKA_MSG_PARTITIONER_MURMUR2_RANDOM = 6;
|
|
const RD_KAFKA_LOG_PRINT = 100;
|
|
const RD_KAFKA_LOG_SYSLOG = 101;
|
|
const RD_KAFKA_LOG_SYSLOG_PRINT = 102;
|
|
const RD_KAFKA_PURGE_F_QUEUE = 1;
|
|
const RD_KAFKA_PURGE_F_INFLIGHT = 2;
|
|
const RD_KAFKA_PURGE_F_NON_BLOCKING = 4;
|
|
const RD_KAFKA_MSG_F_BLOCK = 4;
|
|
|
|
/**
|
|
* @param int $err Error code
|
|
*
|
|
* @return string Returns the error as a string.
|
|
*/
|
|
function rd_kafka_err2str($err)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $errnox A system errno
|
|
*
|
|
* @return int Returns a kafka error code as an integer.
|
|
*/
|
|
function rd_kafka_errno2err($errnox)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int Returns the system errno as an integer.
|
|
*/
|
|
function rd_kafka_errno()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $cnt
|
|
*
|
|
* @return int Returns the special offset as an integer.
|
|
*/
|
|
function rd_kafka_offset_tail($cnt)
|
|
{
|
|
}
|
|
|
|
abstract class RdKafka
|
|
{
|
|
/**
|
|
* @param string $broker_list
|
|
*
|
|
* @return int
|
|
*/
|
|
public function addBrokers($broker_list)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param bool $all_topics
|
|
* @param \RdKafka\Topic|null $only_topic
|
|
* @param int $timeout_ms
|
|
*
|
|
* @return \RdKafka\Metadata
|
|
* @throws \RdKafka\Exception
|
|
*/
|
|
public function getMetadata($all_topics, $only_topic = null, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getOutQLen()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic_name
|
|
* @param \RdKafka\TopicConf $topic_conf
|
|
*
|
|
* @return \RdKafka\Topic
|
|
*/
|
|
public function newTopic($topic_name, TopicConf $topic_conf = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $timeout_ms
|
|
*
|
|
* @return void
|
|
*/
|
|
public function poll($timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $level
|
|
*
|
|
* @return void
|
|
* @deprecated
|
|
*
|
|
*/
|
|
public function setLogLevel($level)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic
|
|
* @param int $partition
|
|
* @param int $low
|
|
* @param int $high
|
|
* @param int $timeout_ms
|
|
*/
|
|
public function queryWatermarkOffsets($topic, $partition, &$low, &$high, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param array $topicPartitions
|
|
* @param int $timeout_ms
|
|
* @return array
|
|
*/
|
|
public function offsetsForTimes($topicPartitions, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $purge_flags
|
|
* @return int
|
|
*/
|
|
public function purge($purge_flags)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $timeout_ms
|
|
* @return int
|
|
*/
|
|
public function flush($timeout_ms)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace RdKafka {
|
|
|
|
class Conf
|
|
{
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function dump()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $name
|
|
* @param string $value
|
|
*
|
|
* @return void
|
|
*/
|
|
public function set($name, $value)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param TopicConf $topic_conf
|
|
*
|
|
* @return void
|
|
* @deprecated Set default topic settings normally like global configuration settings.
|
|
*
|
|
*/
|
|
public function setDefaultTopicConf(TopicConf $topic_conf)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setDrMsgCb(callable $callback)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setErrorCb(callable $callback)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setRebalanceCb(callable $callback)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setStatsCb(callable $callback)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setConsumeCb(callable $callback)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setOffsetCommitCb(callable $callback)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setLogCb(callable $callback)
|
|
{
|
|
}
|
|
}
|
|
|
|
class Consumer extends \RdKafka
|
|
{
|
|
/**
|
|
* @param Conf $conf
|
|
*/
|
|
public function __construct(Conf $conf = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic_name
|
|
* @param TopicConf $topic_conf
|
|
*
|
|
* @return ConsumerTopic
|
|
*/
|
|
public function newTopic($topic_name, TopicConf $topic_conf = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return Queue
|
|
*/
|
|
public function newQueue()
|
|
{
|
|
}
|
|
}
|
|
|
|
class ConsumerTopic extends Topic
|
|
{
|
|
private function __construct()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $timeout_ms
|
|
*
|
|
* @return Message|null
|
|
*/
|
|
public function consume($partition, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $offset
|
|
* @param Queue $queue
|
|
*
|
|
* @return void
|
|
*/
|
|
public function consumeQueueStart($partition, $offset, Queue $queue)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $offset
|
|
*
|
|
* @return void
|
|
*/
|
|
public function consumeStart($partition, $offset)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
*
|
|
* @return void
|
|
*/
|
|
public function consumeStop($partition)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $offset
|
|
*
|
|
* @return void
|
|
*/
|
|
public function offsetStore($partition, $offset)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $timeout_ms
|
|
* @param int $batch_size
|
|
*
|
|
* @return array
|
|
* @throws \InvalidArgumentException
|
|
* @throws Exception
|
|
*/
|
|
public function consumeBatch($partition, $timeout_ms, $batch_size)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $timeout_ms
|
|
* @param callable $callback
|
|
*
|
|
* @return void
|
|
*/
|
|
public function consumeCallback($partition, $timeout_ms, callable $callback)
|
|
{
|
|
}
|
|
}
|
|
|
|
class Exception extends \Exception
|
|
{
|
|
}
|
|
|
|
class KafkaConsumer
|
|
{
|
|
/**
|
|
* @param Conf $conf
|
|
*/
|
|
public function __construct(Conf $conf)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param TopicPartition[] $topic_partitions
|
|
*
|
|
* @return void
|
|
* @throws Exception
|
|
*/
|
|
public function assign($topic_partitions = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param null|Message|TopicPartition[] $message_or_offsets
|
|
*
|
|
* @return void
|
|
* @throws Exception
|
|
*/
|
|
public function commit($message_or_offsets = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $message_or_offsets
|
|
*
|
|
* @return void
|
|
* @throws Exception
|
|
*/
|
|
public function commitAsync($message_or_offsets = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $timeout_ms
|
|
*
|
|
* @return Message
|
|
* @throws \InvalidArgumentException
|
|
* @throws Exception
|
|
*/
|
|
public function consume($timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return TopicPartition[]
|
|
* @throws Exception
|
|
*/
|
|
public function getAssignment()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param bool $all_topics
|
|
* @param KafkaConsumerTopic|null $only_topic
|
|
* @param int $timeout_ms
|
|
*
|
|
* @return Metadata
|
|
* @throws Exception
|
|
*/
|
|
public function getMetadata($all_topics, $only_topic, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getSubscription()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic_name
|
|
* @param TopicConf $topic_conf
|
|
*
|
|
* @return KafkaConsumerTopic
|
|
*/
|
|
public function newTopic($topic_name, TopicConf $topic_conf = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param array $topics
|
|
*
|
|
* @return void
|
|
* @throws Exception
|
|
*/
|
|
public function subscribe($topics)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
* @throws Exception
|
|
*/
|
|
public function unsubscribe()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param TopicPartition[] $topicPartitions
|
|
* @param int $timeout_ms Timeout in milliseconds
|
|
*
|
|
* @return TopicPartition[]
|
|
* @throws Exception
|
|
*/
|
|
public function getCommittedOffsets($topicPartitions, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param array $topicPartitions
|
|
* @param int $timeout_ms
|
|
* @return array
|
|
*/
|
|
public function offsetsForTimes($topicPartitions, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic
|
|
* @param int $partition
|
|
* @param int $low
|
|
* @param int $high
|
|
* @param int $timeout_ms
|
|
*/
|
|
public function queryWatermarkOffsets($topic, $partition, &$low, &$high, $timeout_ms)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param array $topics
|
|
*
|
|
* @return array
|
|
* @throws Exception
|
|
*/
|
|
public function getOffsetPositions($topics)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function close()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param TopicPartition[] $topic_partitions
|
|
* @return TopicPartition[]
|
|
*/
|
|
public function pausePartitions($topic_partitions)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param TopicPartition[] $topic_partitions
|
|
* @return TopicPartition[]
|
|
*/
|
|
public function resumePartitions($topic_partitions)
|
|
{
|
|
}
|
|
}
|
|
|
|
class KafkaConsumerTopic extends Topic
|
|
{
|
|
/**
|
|
* @param int $partition
|
|
* @param int $offset
|
|
*
|
|
* @return void
|
|
*/
|
|
public function offsetStore($partition, $offset)
|
|
{
|
|
}
|
|
}
|
|
|
|
class KafkaErrorException extends \Exception
|
|
{
|
|
/**
|
|
* @param string $message
|
|
* @param int $code
|
|
* @param string $errorString
|
|
* @param boolean $isFatal
|
|
* @param boolean $isRetriable
|
|
* @param boolean $transactionRequiresAbort
|
|
*/
|
|
public function __construct($message, $code, $errorString, $isFatal, $isRetriable, $transactionRequiresAbort)
|
|
{
|
|
parent::__construct($message, $code);
|
|
}
|
|
|
|
/**
|
|
* @returns string
|
|
*/
|
|
public function getErrorString()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @returns boolean
|
|
*/
|
|
public function isFatal()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @returns boolean
|
|
*/
|
|
public function isRetriable()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @returns boolean
|
|
*/
|
|
public function transactionRequiresAbort()
|
|
{
|
|
}
|
|
}
|
|
|
|
class Message
|
|
{
|
|
/**
|
|
* @var int
|
|
*/
|
|
public $err;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
public $topic_name;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
public $partition;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
public $payload;
|
|
|
|
/**
|
|
* @var int|null
|
|
*/
|
|
public $len;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
public $key;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
public $offset;
|
|
|
|
/**
|
|
* @var int
|
|
*/
|
|
public $timestamp;
|
|
|
|
/**
|
|
* @var array|null
|
|
*/
|
|
public $headers;
|
|
|
|
/**
|
|
* @var string|null
|
|
*/
|
|
public $opaque;
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function errstr()
|
|
{
|
|
}
|
|
}
|
|
|
|
class Metadata
|
|
{
|
|
/**
|
|
* @return \RdKafka\Metadata\Collection|\RdKafka\Metadata\Broker[]
|
|
*/
|
|
public function getBrokers()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return \RdKafka\Metadata\Collection|\RdKafka\Metadata\Topic[]
|
|
*/
|
|
public function getTopics()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getOrigBrokerId()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getOrigBrokerName()
|
|
{
|
|
}
|
|
}
|
|
|
|
class Producer extends \RdKafka
|
|
{
|
|
/**
|
|
* @param Conf $conf
|
|
*/
|
|
public function __construct(Conf $conf = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic_name
|
|
* @param TopicConf $topic_conf
|
|
*
|
|
* @return ProducerTopic
|
|
*/
|
|
public function newTopic($topic_name, TopicConf $topic_conf = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $timeoutMs
|
|
*
|
|
* @return void
|
|
* @throws KafkaErrorException
|
|
*/
|
|
public function initTransactions(int $timeoutMs)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
* @throws KafkaErrorException
|
|
*/
|
|
public function beginTransaction()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $timeoutMs
|
|
*
|
|
* @return void
|
|
* @throws KafkaErrorException
|
|
*/
|
|
public function commitTransaction(int $timeoutMs)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $timeoutMs
|
|
*
|
|
* @return void
|
|
* @throws KafkaErrorException
|
|
*/
|
|
public function abortTransaction(int $timeoutMs)
|
|
{
|
|
}
|
|
}
|
|
|
|
class ProducerTopic extends Topic
|
|
{
|
|
private function __construct()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $msgflags
|
|
* @param string $payload
|
|
* @param string $key
|
|
*
|
|
* @return void
|
|
* @throws Exception
|
|
*/
|
|
public function produce($partition, $msgflags, $payload, $key = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
* @param int $msgflags
|
|
* @param string $payload
|
|
* @param string|null $key
|
|
* @param array|null $headers
|
|
* @param int $timestamp_ms
|
|
*
|
|
* @throws Exception
|
|
*/
|
|
public function producev($partition, $msgflags, $payload, $key = null, $headers = null, $timestamp_ms = null)
|
|
{
|
|
}
|
|
}
|
|
|
|
class Queue
|
|
{
|
|
private function __construct()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $timeout_ms
|
|
*
|
|
* @return Message|null
|
|
*/
|
|
public function consume($timeout_ms)
|
|
{
|
|
}
|
|
}
|
|
|
|
abstract class Topic
|
|
{
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Configuration reference: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
|
|
*/
|
|
class TopicConf
|
|
{
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function dump()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $name
|
|
* @param string $value
|
|
*
|
|
* @return void
|
|
*/
|
|
public function set($name, $value)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partitioner
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setPartitioner($partitioner)
|
|
{
|
|
}
|
|
}
|
|
|
|
class TopicPartition
|
|
{
|
|
/**
|
|
* @param string $topic
|
|
* @param int $partition
|
|
* @param int $offset
|
|
*/
|
|
public function __construct($topic, $partition, $offset = null)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getOffset()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getPartition()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getTopic()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $offset
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setOffset($offset)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param int $partition
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setPartition($partition)
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @param string $topic_name
|
|
*
|
|
* @return void
|
|
*/
|
|
public function setTopic($topic_name)
|
|
{
|
|
}
|
|
}
|
|
}
|
|
|
|
namespace RdKafka\Metadata {
|
|
|
|
class Broker
|
|
{
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getHost()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getPort()
|
|
{
|
|
}
|
|
}
|
|
|
|
class Collection implements \Iterator, \Countable
|
|
{
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function current()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function next()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function key()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return boolean
|
|
*/
|
|
public function valid()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function rewind()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function count()
|
|
{
|
|
}
|
|
}
|
|
|
|
class Partition
|
|
{
|
|
/**
|
|
* @return int
|
|
*/
|
|
public function getId()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getErr()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getLeader()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getReplicas()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getIsrs()
|
|
{
|
|
}
|
|
}
|
|
|
|
class Topic
|
|
{
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getTopic()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return Partition[]
|
|
*/
|
|
public function getPartitions()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getErr()
|
|
{
|
|
}
|
|
}
|
|
} |