Documentation ¶
Index ¶
- Variables
- type AlivePolicy
- type ExtentManager
- func (em *ExtentManager) Close()
- func (em *ExtentManager) ConnPool(peers []string) ([]*conn.Pool, error)
- func (em *ExtentManager) EtcdClient() *clientv3.Client
- func (em *ExtentManager) GetExtentConn(extentID uint64, policy SelectNodePolicy) *grpc.ClientConn
- func (em *ExtentManager) GetExtentInfo(extentID uint64) *pb.ExtentInfo
- func (em *ExtentManager) GetNodeInfo(nodeID uint64) *pb.NodeInfo
- func (em *ExtentManager) GetPeers(extentID uint64) []string
- func (em *ExtentManager) Latest(extentID uint64) *pb.ExtentInfo
- func (em *ExtentManager) WaitVersion(extentID uint64, version uint64) *pb.ExtentInfo
- type PrimaryPolicy
- type SMClient
- func (client *SMClient) Alive() bool
- func (client *SMClient) CheckCommitLength(ctx context.Context, streamID uint64, ownerKey string, revision int64) (*pb.StreamInfo, *pb.ExtentInfo, uint32, error)
- func (client *SMClient) Close()
- func (client *SMClient) Connect() error
- func (client *SMClient) CreateStream(ctx context.Context, dataShard uint32, parityShard uint32) (*pb.StreamInfo, *pb.ExtentInfo, error)
- func (client *SMClient) CurrentLeader() string
- func (client *SMClient) ExtentInfo(ctx context.Context, extentID uint64) (*pb.ExtentInfo, error)
- func (client *SMClient) MultiModifySplit(ctx context.Context, partID uint64, midKey []byte, ownerKey string, ...) error
- func (client *SMClient) NodesInfo(ctx context.Context) (map[uint64]*pb.NodeInfo, error)
- func (client *SMClient) PunchHoles(ctx context.Context, streamID uint64, holes []uint64, ownerKey string, ...) (updatedStream *pb.StreamInfo, err error)
- func (client *SMClient) RegisterNode(ctx context.Context, uuids []string, addr string) (uint64, map[string]uint64, error)
- func (client *SMClient) Status() error
- func (client *SMClient) StreamAllocExtent(ctx context.Context, streamID uint64, ownerKey string, revision int64, ...) (*pb.StreamInfo, *pb.ExtentInfo, error)
- func (client *SMClient) StreamInfo(ctx context.Context, streamIDs []uint64) (map[uint64]*pb.StreamInfo, map[uint64]*pb.ExtentInfo, error)
- func (client *SMClient) TruncateStream(ctx context.Context, streamID uint64, extentID uint64, ownerKey string, ...) (updatedStream *pb.StreamInfo, err error)
- type SelectNodePolicy
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTimeOut = errors.New("can not find connection to stream manager, timeout")
)
Functions ¶
This section is empty.
Types ¶
type AlivePolicy ¶
type AlivePolicy struct{}
func (AlivePolicy) Choose ¶
func (AlivePolicy) Choose(em *ExtentManager, extentID uint64) *grpc.ClientConn
type ExtentManager ¶
type ExtentManager struct {
// contains filtered or unexported fields
}
func NewExtentManager ¶
func NewExtentManager(smclient *SMClient, etcdAddr []string, extentsUpdate extentInfoUpdatedFunc) *ExtentManager
NewExtentManager will block forever until connected to etcd
func (*ExtentManager) Close ¶
func (em *ExtentManager) Close()
func (*ExtentManager) ConnPool ¶
func (em *ExtentManager) ConnPool(peers []string) ([]*conn.Pool, error)
func (*ExtentManager) EtcdClient ¶
func (em *ExtentManager) EtcdClient() *clientv3.Client
func (*ExtentManager) GetExtentConn ¶
func (em *ExtentManager) GetExtentConn(extentID uint64, policy SelectNodePolicy) *grpc.ClientConn
func (*ExtentManager) GetExtentInfo ¶
func (em *ExtentManager) GetExtentInfo(extentID uint64) *pb.ExtentInfo
func (*ExtentManager) GetNodeInfo ¶
func (em *ExtentManager) GetNodeInfo(nodeID uint64) *pb.NodeInfo
func (*ExtentManager) GetPeers ¶
func (em *ExtentManager) GetPeers(extentID uint64) []string
func (*ExtentManager) Latest ¶
func (em *ExtentManager) Latest(extentID uint64) *pb.ExtentInfo
func (*ExtentManager) WaitVersion ¶
func (em *ExtentManager) WaitVersion(extentID uint64, version uint64) *pb.ExtentInfo
// c.L.Lock() // for !condition() { // c.Wait() // } // ... make use of condition ... // c.L.Unlock()
type PrimaryPolicy ¶
type PrimaryPolicy struct{}
func (PrimaryPolicy) Choose ¶
func (PrimaryPolicy) Choose(em *ExtentManager, extentID uint64) *grpc.ClientConn
type SMClient ¶
func NewSMClient ¶
func (*SMClient) CheckCommitLength ¶
func (*SMClient) Connect ¶
Connect to Zero's grpc service, if all of connect failed to connnect, return error
func (*SMClient) CreateStream ¶
func (client *SMClient) CreateStream(ctx context.Context, dataShard uint32, parityShard uint32) (*pb.StreamInfo, *pb.ExtentInfo, error)
FIXME: stream layer need Code to tell logic error or network error
func (*SMClient) CurrentLeader ¶
func (*SMClient) ExtentInfo ¶
func (*SMClient) MultiModifySplit ¶
func (*SMClient) PunchHoles ¶
func (*SMClient) RegisterNode ¶
func (*SMClient) StreamAllocExtent ¶
func (*SMClient) StreamInfo ¶
type SelectNodePolicy ¶
type SelectNodePolicy interface {
Choose(em *ExtentManager, extentID uint64) *grpc.ClientConn
}
Click to show internal directories.
Click to hide internal directories.