allocate brokers to serve segments
This commit is contained in:
@@ -1,23 +1,36 @@
|
||||
package mq
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/mq_pb"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Namespace string
|
||||
|
||||
type Topic struct {
|
||||
namespace Namespace
|
||||
name string
|
||||
Namespace Namespace
|
||||
Name string
|
||||
}
|
||||
|
||||
type Partition struct {
|
||||
rangeStart int
|
||||
rangeStop int // exclusive
|
||||
ringSize int
|
||||
RangeStart int
|
||||
RangeStop int // exclusive
|
||||
RingSize int
|
||||
}
|
||||
|
||||
type Segment struct {
|
||||
topic Topic
|
||||
id int32
|
||||
partition Partition
|
||||
lastModified time.Time
|
||||
Topic Topic
|
||||
Id int32
|
||||
Partition Partition
|
||||
LastModified time.Time
|
||||
}
|
||||
|
||||
func FromPbSegment(segment *mq_pb.Segment) *Segment {
|
||||
return &Segment{
|
||||
Topic: Topic{
|
||||
Namespace: Namespace(segment.Namespace),
|
||||
Name: segment.Topic,
|
||||
},
|
||||
Id: segment.Id,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user