add helper functions
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package topic
|
||||
|
||||
import "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
|
||||
)
|
||||
|
||||
const PartitionCount = 4096
|
||||
|
||||
@@ -81,3 +84,11 @@ func (partition Partition) Overlaps(partition2 Partition) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func (partition Partition) String() string {
|
||||
return fmt.Sprintf("%04d-%04d", partition.RangeStart, partition.RangeStop)
|
||||
}
|
||||
|
||||
func ToString(partition *mq_pb.Partition) string {
|
||||
return fmt.Sprintf("%04d-%04d", partition.RangeStart, partition.RangeStop)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user