Documentation ¶
Index ¶
- func NewShard(perShardMax uint32) *shard
- func UniformModel(index, size int) float64
- func ZipfModel(index, size int) float64
- type Config
- type ModelFunc
- type Server
- func (srv *Server) Close() error
- func (srv *Server) Get(ctx context.Context, in *proto.GetRequest) (out *proto.GetReply, err error)
- func (srv *Server) Put(ctx context.Context, in *proto.PutRequest) (out *proto.PutReply, err error)
- func (srv *Server) Remove(ctx context.Context, in *proto.RemoveRequest) (out *proto.RemoveReply, err error)
- func (srv *Server) Stat(ctx context.Context, in *proto.StatRequest) (*proto.StatReply, error)
- func (srv *Server) Walk(in *proto.WalkRequest, serverstream proto.CAS_WalkServer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UniformModel ¶
Types ¶
type ModelFunc ¶
ModelFunc is a function that takes the size of a cache and the index of one element (0 = most hits, size-1 == least hits), and returns the expected number of hits as a ratio to the max number of hits.
∀x: ∀y: 0.0 ≤ f(x, y) ≤ 1.0 ∀y: f(0, y) = 1.0
type Server ¶
func (*Server) Remove ¶
func (srv *Server) Remove(ctx context.Context, in *proto.RemoveRequest) (out *proto.RemoveReply, err error)
func (*Server) Walk ¶
func (srv *Server) Walk(in *proto.WalkRequest, serverstream proto.CAS_WalkServer) error
Click to show internal directories.
Click to hide internal directories.