Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
type Assignment struct { // Drops v1版本只存放要干掉哪些,add仍旧由smserver在guard阶段下发 Drops []string `json:"drops"` }
type MockedShardPrimitives ¶
func (*MockedShardPrimitives) Add ¶
func (m *MockedShardPrimitives) Add(id string, spec *storage.ShardSpec) error
func (*MockedShardPrimitives) Drop ¶
func (m *MockedShardPrimitives) Drop(id string) error
type ShardKeeper ¶
type ShardKeeper struct {
// contains filtered or unexported fields
}
ShardKeeper 参考raft中log replication节点的实现机制,记录日志到boltdb,开goroutine异步下发指令给调用方
func NewShardKeeper ¶
func NewShardKeeper(opts *ShardKeeperOptions, st storage.Storage) (*ShardKeeper, error)
func (*ShardKeeper) Close ¶
func (sk *ShardKeeper) Close()
func (*ShardKeeper) Drop ¶
func (sk *ShardKeeper) Drop(id string) error
func (*ShardKeeper) Storage ¶
func (sk *ShardKeeper) Storage() storage.Storage
type ShardKeeperOptions ¶
type ShardKeeperOptions struct { Service string ContainerId string DropExpiredShard bool Client etcdutil.EtcdWrapper ShardDir string AppShardImpl ShardPrimitives }
ShardKeeperOptions copy from containerOptions
type ShardLease ¶
type ShardLease struct { storage.Lease // GuardLeaseID 不是clientv3.NoLease ,代表是bridge阶段,且要求本地shard的lease属性是该值 GuardLeaseID clientv3.LeaseID `json:"guardLeaseID"` // BridgeLeaseID 在guard阶段,要求本地的bridge是这个值 BridgeLeaseID clientv3.LeaseID `json:"bridgeLeaseID"` // Assignment 包含本轮需要drop掉的shard Assignment *Assignment `json:"assignment"` }
func (*ShardLease) String ¶
func (sl *ShardLease) String() string
Click to show internal directories.
Click to hide internal directories.