Function mz_sql::kafka_util::lookup_start_offsets
source ยท pub async fn lookup_start_offsets<C>(
consumer: Arc<BaseConsumer<C>>,
topic: &str,
time_offset: i64,
now: u64,
fetch_metadata_timeout: Duration,
) -> Result<Vec<i64>, PlanError>where
C: ConsumerContext + 'static,
Expand description
Returns start offsets for the partitions of topic
and the provided
START TIMESTAMP
option.
For each partition, the returned offset is the earliest offset whose timestamp is greater than or equal to the given timestamp for the partition. If no such message exists (or the Kafka broker is before 0.10.0), the current end offset is returned for the partition.
The provided START TIMESTAMP
option must be a non-zero number:
- Non-negative numbers will used as is (e.g.
1622659034343
) - Negative numbers will be translated to a timestamp in millis
before now (e.g.
-10
means 10 millis ago)