skafka icon indicating copy to clipboard operation
skafka copied to clipboard

consumer.offsetsForTimes - consider using Instant as query types instead of Offset

Open nikitapecasa opened this issue 5 years ago • 0 comments

Currently it's defined as

def offsetsForTimes(timestampsToSearch: Map[TopicPartition, Offset]): F[Map[TopicPartition, Option[OffsetAndTimestamp]]]

while working on #122 we agreed with @t3hnar to have following method def for new RebalanceCallback API

def offsetsForTimes[F[_]](
    timestampsToSearch: Nem[TopicPartition, Instant]
  ): RebalanceCallback[F, Map[TopicPartition, Option[OffsetAndTimestamp]]]

The diff is

  • usage of Instant instead of Offset
  • usage of NonEmptyMap instead of regular scala Map (which can be empty)

The same can be applied to corresponding Consumer methods

  • offsetsForTimes
  • offsetsForTimes with timeout

nikitapecasa avatar Apr 10 '21 19:04 nikitapecasa