regattaserver

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMaxGRPCSize is the default maximum size of body of gRPC message to be loaded from dragonboat.
	DefaultMaxGRPCSize = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupServer

type BackupServer struct {
	regattapb.UnimplementedMaintenanceServer
	Tables   TableService
	AuthFunc func(ctx context.Context) (context.Context, error)
}

BackupServer implements some Maintenance service methods from proto/regatta.proto.

func (*BackupServer) AuthFuncOverride added in v0.5.0

func (m *BackupServer) AuthFuncOverride(ctx context.Context, _ string) (context.Context, error)

func (*BackupServer) Backup

func (*BackupServer) Restore

type ClusterServer added in v0.3.0

type ClusterServer struct {
	regattapb.UnimplementedClusterServer
	Cluster ClusterService
	Config  ConfigService
}

func (*ClusterServer) MemberList added in v0.3.0

func (*ClusterServer) Status added in v0.3.0

type ClusterService added in v0.3.0

type ConfigService added in v0.4.0

type ConfigService func() map[string]any

type ForwardingKVServer added in v0.5.0

type ForwardingKVServer struct {
	KVServer
	// contains filtered or unexported fields
}

ForwardingKVServer forwards the write operations to the leader cluster.

func NewForwardingKVServer added in v0.5.0

func NewForwardingKVServer(storage KVService, client regattapb.KVClient, q *storage.IndexNotificationQueue) *ForwardingKVServer

func (*ForwardingKVServer) DeleteRange added in v0.5.0

DeleteRange implements proto/regatta.proto KV.DeleteRange method.

func (*ForwardingKVServer) Put added in v0.5.0

Put implements proto/regatta.proto KV.Put method.

func (*ForwardingKVServer) Txn added in v0.5.0

Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is allowed to modify the same key several times within one txn (the result will be the last Op that modified the key). Readonly transactions allowed using follower API.

type KVServer

type KVServer struct {
	regattapb.UnimplementedKVServer
	Storage KVService
}

KVServer implements KV service from proto/regatta.proto.

func (*KVServer) DeleteRange

DeleteRange implements proto/regatta.proto KV.DeleteRange method.

func (*KVServer) IterateRange added in v0.4.0

IterateRange gets the keys in the range from the key-value store.

func (*KVServer) Put

Put implements proto/regatta.proto KV.Put method.

func (*KVServer) Range

Range implements proto/regatta.proto KV.Range method. Currently, only subset of functionality is implemented. The versioning functionality is not available.

func (*KVServer) Txn

Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is allowed to modify the same key several times within one txn (the result will be the last Op that modified the key).

type LogReaderService

type LogReaderService interface {
	QueryRaftLog(ctx context.Context, clusterID uint64, logRange dragonboat.LogRange, maxSize uint64) ([]raftpb.Entry, error)
}

type LogServer

type LogServer struct {
	Tables    TableService
	LogReader LogReaderService
	Log       *zap.SugaredLogger

	regattapb.UnimplementedLogServer
	// contains filtered or unexported fields
}

LogServer implements Log service from proto/replication.proto.

func NewLogServer

func NewLogServer(ts TableService, lr LogReaderService, logger *zap.Logger, maxMessageSize uint64) *LogServer

func (*LogServer) Replicate

Replicate entries from the leader's log.

type MetadataServer

type MetadataServer struct {
	regattapb.UnimplementedMetadataServer
	Tables TableService
}

MetadataServer implements Metadata service from proto/replication.proto.

type RESTServer

type RESTServer struct {
	// contains filtered or unexported fields
}

RESTServer is server exposing debug/healthcheck/metrics services of Regatta.

func NewRESTServer

func NewRESTServer(addr string, readTimeout time.Duration) *RESTServer

NewRESTServer returns initialized REST server.

func (*RESTServer) ListenAndServe

func (s *RESTServer) ListenAndServe() error

ListenAndServe starts underlying HTTP server.

func (*RESTServer) Shutdown

func (s *RESTServer) Shutdown()

Shutdown stops underlying HTTP server.

type ReadonlyTablesServer added in v0.5.0

type ReadonlyTablesServer struct {
	TablesServer
}

func (*ReadonlyTablesServer) Create added in v0.5.0

func (*ReadonlyTablesServer) Delete added in v0.5.0

type RegattaServer

type RegattaServer struct {
	*grpc.Server
	// contains filtered or unexported fields
}

RegattaServer is server where gRPC services can be registered in.

func NewServer

func NewServer(addr, network string, logger *zap.SugaredLogger, opts ...grpc.ServerOption) *RegattaServer

NewServer returns initialized gRPC server.

func (*RegattaServer) Addr

func (s *RegattaServer) Addr() string

func (*RegattaServer) ListenAndServe

func (s *RegattaServer) ListenAndServe() error

ListenAndServe starts underlying gRPC server.

func (*RegattaServer) Shutdown

func (s *RegattaServer) Shutdown()

Shutdown stops underlying gRPC server.

type ResetServer

type ResetServer struct {
	regattapb.UnimplementedMaintenanceServer
	Tables   TableService
	AuthFunc func(ctx context.Context) (context.Context, error)
}

ResetServer implements some Maintenance service methods from proto/regatta.proto.

func (*ResetServer) AuthFuncOverride added in v0.5.0

func (m *ResetServer) AuthFuncOverride(ctx context.Context, _ string) (context.Context, error)

func (*ResetServer) Reset

type SnapshotServer

type SnapshotServer struct {
	regattapb.UnimplementedSnapshotServer
	Tables TableService
}

SnapshotServer implements Snapshot service from proto/replication.proto.

func (*SnapshotServer) Stream

type SnapshotService

type SnapshotService interface {
	Snapshot(ctx context.Context, writer io.Writer) error
}

type TableService

type TableService interface {
	GetTables() ([]table.Table, error)
	GetTable(name string) (table.ActiveTable, error)
	Restore(name string, reader io.Reader) error
	CreateTable(name string) (table.Table, error)
	DeleteTable(name string) error
}

type TablesServer added in v0.5.0

type TablesServer struct {
	regattapb.UnimplementedTablesServer
	Tables   TableService
	AuthFunc func(ctx context.Context) (context.Context, error)
}

func (*TablesServer) AuthFuncOverride added in v0.5.0

func (t *TablesServer) AuthFuncOverride(ctx context.Context, _ string) (context.Context, error)

func (*TablesServer) Create added in v0.5.0

func (*TablesServer) Delete added in v0.5.0

func (*TablesServer) List added in v0.5.0

Directories

Path Synopsis
encoding

Jump to

Keyboard shortcuts

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