Documentation ¶
Index ¶
- Variables
- type NodeServer
- func (ns *NodeServer) Activate(ctx context.Context, req *pb.ServeRequest) (*pb.ServeResponse, error)
- func (ns *NodeServer) Deactivate(ctx context.Context, req *pb.DeactivateRequest) (*pb.DeactivateResponse, error)
- func (ns *NodeServer) Drop(ctx context.Context, req *pb.DropRequest) (*pb.DropResponse, error)
- func (ns *NodeServer) Info(ctx context.Context, req *pb.InfoRequest) (*pb.InfoResponse, error)
- func (ns *NodeServer) Prepare(ctx context.Context, req *pb.PrepareRequest) (*pb.PrepareResponse, error)
- func (ns *NodeServer) Ranges(req *pb.RangesRequest, stream pb.Node_RangesServer) error
- func (ns *NodeServer) Register(sr grpc.ServiceRegistrar)
- type Rangelet
- func (r *Rangelet) Find(k api.Key) (api.RangeID, bool)
- func (r *Rangelet) ForceDrop(rID api.RangeID) error
- func (r *Rangelet) Len() int
- func (rglt *Rangelet) OnLeaveState(rID api.RangeID, s api.RemoteState, f func())
- func (r *Rangelet) SetGracePeriod(d time.Duration)
- func (r *Rangelet) SetWantDrain(b bool)
- func (rglt *Rangelet) State(rID api.RangeID) api.RemoteState
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type NodeServer ¶
type NodeServer struct { pb.UnsafeNodeServer // contains filtered or unexported fields }
func (*NodeServer) Activate ¶
func (ns *NodeServer) Activate(ctx context.Context, req *pb.ServeRequest) (*pb.ServeResponse, error)
func (*NodeServer) Deactivate ¶
func (ns *NodeServer) Deactivate(ctx context.Context, req *pb.DeactivateRequest) (*pb.DeactivateResponse, error)
func (*NodeServer) Drop ¶
func (ns *NodeServer) Drop(ctx context.Context, req *pb.DropRequest) (*pb.DropResponse, error)
func (*NodeServer) Info ¶
func (ns *NodeServer) Info(ctx context.Context, req *pb.InfoRequest) (*pb.InfoResponse, error)
func (*NodeServer) Prepare ¶
func (ns *NodeServer) Prepare(ctx context.Context, req *pb.PrepareRequest) (*pb.PrepareResponse, error)
func (*NodeServer) Ranges ¶
func (ns *NodeServer) Ranges(req *pb.RangesRequest, stream pb.Node_RangesServer) error
func (*NodeServer) Register ¶
func (ns *NodeServer) Register(sr grpc.ServiceRegistrar)
type Rangelet ¶
type Rangelet struct { sync.RWMutex // guards info (keys *and* values), watchers, and callbacks // contains filtered or unexported fields }
func (*Rangelet) Find ¶
TODO: This method should be able to return multiple ranges. Might be called during an operation where both src and dest are on this node. Currently just returns the first one it finds.
func (*Rangelet) ForceDrop ¶
Force the Rangelet to forget about the given range, without calling any of the interface methods or performing any cleanup. It'll just vanish from probe responses. This should only ever be called by the node when it has decided to drop the range and wants to tell the controller that.
func (*Rangelet) OnLeaveState ¶
func (rglt *Rangelet) OnLeaveState(rID api.RangeID, s api.RemoteState, f func())
OnLeaveState registers a callback function which will be called when the given range transitions out of the given state. This is just for testing. TODO: Maybe just make this OnChangeState so FakeNode can do what it likes?
func (*Rangelet) SetGracePeriod ¶
Just for tests. TODO: Remove this somehow? Only TestNodes needs it.
func (*Rangelet) SetWantDrain ¶
func (*Rangelet) State ¶
func (rglt *Rangelet) State(rID api.RangeID) api.RemoteState
State returns the state that the given range is currently in, or NsNotFound if the range doesn't exist. This should not be used for anything other than sanity-checking and testing. Clients should react to changes via the Node interface.
Directories ¶
Path | Synopsis |
---|---|
Package mirror provides a range assignment mirror, which can maintain a map of all range assignments via the streaming Node.Ranges endpoint provided by the rangelet.
|
Package mirror provides a range assignment mirror, which can maintain a map of all range assignments via the streaming Node.Ranges endpoint provided by the rangelet. |
storage
|
|