Function sql::kafka_util::lookup_start_offsets[][src]

pub async fn lookup_start_offsets(
    consumer: Arc<BaseConsumer<KafkaErrCheckContext>>,
    topic: &str,
    with_options: &BTreeMap<String, Value>,
    now: u64
) -> Result<Option<Vec<i64>>, Error>
Expand description

Returns start offsets for the partitions of topic and the provided kafka_time_offset 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 kafka_time_offset 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)

If kafka_time_offset has not been configured, an empty Option is returned.