rangelet

package
v0.0.0-...-ba27772 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 New

func (*Rangelet) Find

func (r *Rangelet) Find(k api.Key) (api.RangeID, bool)

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

func (r *Rangelet) ForceDrop(rID api.RangeID) error

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) Len

func (r *Rangelet) Len() int

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

func (r *Rangelet) SetGracePeriod(d time.Duration)

Just for tests. TODO: Remove this somehow? Only TestNodes needs it.

func (*Rangelet) SetWantDrain

func (r *Rangelet) SetWantDrain(b bool)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL