|
virtual const std::string | name () const =0 |
|
virtual const std::string | memberid () const =0 |
| Returns the client's broker-assigned group member id. More...
|
|
virtual int | poll (int timeout_ms)=0 |
| Polls the provided kafka handle for events. More...
|
|
virtual int | outq_len ()=0 |
| Returns the current out queue length. More...
|
|
virtual ErrorCode | metadata (bool all_topics, const Topic *only_rkt, Metadata **metadatap, int timeout_ms)=0 |
| Request Metadata from broker. More...
|
|
virtual ErrorCode | pause (std::vector< TopicPartition * > &partitions)=0 |
| Pause producing or consumption for the provided list of partitions. More...
|
|
virtual ErrorCode | resume (std::vector< TopicPartition * > &partitions)=0 |
| Resume producing or consumption for the provided list of partitions. More...
|
|
virtual ErrorCode | query_watermark_offsets (const std::string &topic, int32_t partition, int64_t *low, int64_t *high, int timeout_ms)=0 |
| Query broker for low (oldest/beginning) and high (newest/end) offsets for partition. More...
|
|
virtual ErrorCode | get_watermark_offsets (const std::string &topic, int32_t partition, int64_t *low, int64_t *high)=0 |
| Get last known low (oldest/beginning) and high (newest/end) offsets for partition. More...
|
|
virtual ErrorCode | offsetsForTimes (std::vector< TopicPartition * > &offsets, int timeout_ms)=0 |
| Look up the offsets for the given partitions by timestamp. More...
|
|
virtual Queue * | get_partition_queue (const TopicPartition *partition)=0 |
| Retrieve queue for a given partition. More...
|
|
virtual ErrorCode | set_log_queue (Queue *queue)=0 |
| Forward librdkafka logs (and debug) to the specified queue for serving with one of the ..poll() calls. More...
|
|
virtual void | yield ()=0 |
| Cancels the current callback dispatcher (Handle::poll(), KafkaConsumer::consume(), etc). More...
|
|
virtual const std::string | clusterid (int timeout_ms)=0 |
| Returns the ClusterId as reported in broker metadata. More...
|
|
virtual struct rd_kafka_s * | c_ptr ()=0 |
| Returns the underlying librdkafka C rd_kafka_t handle. More...
|
|
virtual int32_t | controllerid (int timeout_ms)=0 |
| Returns the current ControllerId (controller broker id) as reported in broker metadata. More...
|
|
virtual ErrorCode | fatal_error (std::string &errstr) const =0 |
| Returns the first fatal error set on this client instance, or ERR_NO_ERROR if no fatal error has occurred. More...
|
|
virtual ErrorCode | oauthbearer_set_token (const std::string &token_value, int64_t md_lifetime_ms, const std::string &md_principal_name, const std::list< std::string > &extensions, std::string &errstr)=0 |
| Set SASL/OAUTHBEARER token and metadata. More...
|
|
virtual ErrorCode | oauthbearer_set_token_failure (const std::string &errstr)=0 |
| SASL/OAUTHBEARER token refresh failure indicator. More...
|
|
Base handle, super class for specific clients.
virtual ErrorCode RdKafka::Handle::get_watermark_offsets |
( |
const std::string & |
topic, |
|
|
int32_t |
partition, |
|
|
int64_t * |
low, |
|
|
int64_t * |
high |
|
) |
| |
|
pure virtual |
Get last known low (oldest/beginning) and high (newest/end) offsets for partition.
The low offset is updated periodically (if statistics.interval.ms is set) while the high offset is updated on each fetched message set from the broker.
If there is no cached offset (either low or high, or both) then OFFSET_INVALID will be returned for the respective offset.
Offsets are returned in *low
and *high
respectively.
- Returns
- RdKafka::ERR_NO_ERROR on success or an error code on failure.
virtual ErrorCode RdKafka::Handle::offsetsForTimes |
( |
std::vector< TopicPartition * > & |
offsets, |
|
|
int |
timeout_ms |
|
) |
| |
|
pure virtual |
Look up the offsets for the given partitions by timestamp.
The returned offset for each partition is the earliest offset whose timestamp is greater than or equal to the given timestamp in the corresponding partition.
The timestamps to query are represented as offset
in offsets
on input, and offset()
will return the closest earlier offset for the timestamp on output.
Timestamps are expressed as milliseconds since epoch (UTC).
The function will block for at most timeout_ms
milliseconds.
- Returns
- an error code for general errors, else RdKafka::ERR_NO_ERROR in which case per-partition errors might be set.
virtual ErrorCode RdKafka::Handle::fatal_error |
( |
std::string & |
errstr | ) |
const |
|
pure virtual |
Returns the first fatal error set on this client instance, or ERR_NO_ERROR if no fatal error has occurred.
This function is to be used with the Idempotent Producer and the Event class for EVENT_ERROR
events to detect fatal errors.
Generally all errors raised by the error event are to be considered informational and temporary, the client will try to recover from all errors in a graceful fashion (by retrying, etc).
However, some errors should logically be considered fatal to retain consistency; in particular a set of errors that may occur when using the Idempotent Producer and the in-order or exactly-once producer guarantees can't be satisfied.
- Parameters
-
errstr | A human readable error string if a fatal error was set. |
- Returns
- ERR_NO_ERROR if no fatal error has been raised, else any other error code.