subscriber receives partitions and dispatch to processors

This commit is contained in:
chrislu
2024-05-14 23:22:43 -07:00
parent 972e9faaa2
commit 1f20178ded
4 changed files with 104 additions and 36 deletions

View File

@@ -71,3 +71,13 @@ func (partition Partition) ToPbPartition() *mq_pb.Partition {
UnixTimeNs: partition.UnixTimeNs,
}
}
func (partition Partition) Overlaps(partition2 Partition) bool {
if partition.RangeStart >= partition2.RangeStop {
return false
}
if partition.RangeStop <= partition2.RangeStart {
return false
}
return true
}