server

package
v0.0.0-...-3a1a44b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {

	// (Used in 4B)
	Latches *latches.Latches
	// contains filtered or unexported fields
}

Server is a TinyKV server, it 'faces outwards', sending and receiving messages from clients such as TinySQL.

func NewServer

func NewServer(storage storage.Storage) *Server

func (*Server) Coprocessor

func (server *Server) Coprocessor(_ context.Context, req *coppb.Request) (*coppb.Response, error)

SQL push down commands.

func (*Server) KvBatchRollback

func (*Server) KvCheckTxnStatus

func (*Server) KvCommit

func (server *Server) KvCommit(_ context.Context, req *kvrpcpb.CommitRequest) (*kvrpcpb.CommitResponse, error)

func (*Server) KvGet

func (server *Server) KvGet(_ context.Context, req *kvrpcpb.GetRequest) (*kvrpcpb.GetResponse, error)

Transactional API.

func (*Server) KvPrewrite

func (server *Server) KvPrewrite(_ context.Context, req *kvrpcpb.PrewriteRequest) (*kvrpcpb.PrewriteResponse, error)

func (*Server) KvResolveLock

func (server *Server) KvResolveLock(_ context.Context, req *kvrpcpb.ResolveLockRequest) (*kvrpcpb.ResolveLockResponse, error)

func (*Server) KvScan

func (server *Server) KvScan(_ context.Context, req *kvrpcpb.ScanRequest) (*kvrpcpb.ScanResponse, error)

func (*Server) Raft

func (server *Server) Raft(stream tinykvpb.TinyKv_RaftServer) error

Raft commands (tinykv <-> tinykv) Only used for RaftStorage, so trivially forward it.

func (*Server) RawDelete

RawDelete delete the target data from storage and returns the corresponding response

func (*Server) RawGet

func (server *Server) RawGet(_ context.Context, req *kvrpcpb.RawGetRequest) (*kvrpcpb.RawGetResponse, error)

RawGet return the corresponding Get response based on RawGetRequest's CF and Key fields

func (*Server) RawPut

func (server *Server) RawPut(_ context.Context, req *kvrpcpb.RawPutRequest) (*kvrpcpb.RawPutResponse, error)

RawPut puts the target data into storage and returns the corresponding response

func (*Server) RawScan

RawScan scan the data starting from the start key up to limit. and return the corresponding result

func (*Server) Snapshot

func (server *Server) Snapshot(stream tinykvpb.TinyKv_SnapshotServer) error

Snapshot stream (tinykv <-> tinykv) Only used for RaftStorage, so trivially forward it.

Jump to

Keyboard shortcuts

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