// Seek seeks the first offset which binlog CommitTs bigger than ts
Seek seeks the first offset which binlog CommitTs bigger than ts
// Seek seeks the first offset which binlog CommitTs bigger than ts
func (ks *KafkaSeeker) Seek(topic string, ts int64, partitions []int32) (offsets []int64, err error) {
	if len(partitions) == 0 {
		partitions, err = ks.consumer.Partitions(topic)
		if err != nil {
			log.Errorf("get partitions from topic %s error %v", topic, err)
			return nil, errors.Trace(err)
		}
	}
	offsets, err = ks.seekOffsets(topic, partitions, ts)
	if err != nil {
		err = errors.Trace(err)
		log.Errorf("seek offsets error %v", err)
	}
	return
}
func ( ks * KafkaSeeker ) Seek ( topic string , ts int64 , partitions [ ] int32 ) ( offsets [ ] int64 , err error ) { if len ( partitions ) == 0 { partitions , err = ks . consumer . Partitions ( topic ) if err != nil { log . Errorf ( " " , topic , err ) return nil , errors . Trace ( err ) } } offsets , err = ks . seekOffsets ( topic , partitions , ts ) if err != nil { err = errors . Trace ( err ) log . Errorf ( " " , err ) } return }
Seek seeks the first offset which binlog CommitTs bigger than ts
Seek seeks the first offset which binlog CommitTs bigger than ts