Documentation
¶
Overview ¶
Package walserver implements the Klio server infrastructure
Index ¶
- Variables
- func GetClusterRetentionPolicy(ctx context.Context, conn *repository.Connection, clusterName string) (*grpc.RetentionPolicy, error)
- func Start(ctx context.Context, repoConnection *repository.Connection, ...) error
- type Implementation
- func (w *Implementation) CloseBackup(ctx context.Context, request *grpc.CloseBackupRequest) (*grpc.CloseBackupResult, error)
- func (w *Implementation) Get(req *grpc.GetRequest, res grpc.WAL_GetServer) error
- func (w *Implementation) GetMetadata(ctx context.Context, req *grpc.GetMetadataRequest) (*grpc.ClusterMetadata, error)
- func (w *Implementation) GetRetentionPolicy(ctx context.Context, request *grpc.GetRetentionPolicyRequest) (*grpc.GetRetentionPolicyResult, error)
- func (w *Implementation) Put(req grpc.WAL_PutServer) error
- func (w *Implementation) RequestWALStart(ctx context.Context, req *grpc.RequestWALStartRequest) (*grpc.RequestWALStartResult, error)
- func (w *Implementation) ResetWALStream(ctx context.Context, req *grpc.ResetWALStreamRequest) (*grpc.ResetWALStreamResult, error)
- func (w *Implementation) SetRetentionPolicy(ctx context.Context, request *grpc.SetRetentionPolicyRequest) (*grpc.SetRetentionPolicyResult, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
var ErrIncoherentMetadata = errors.New("incoherent cluster metadata")
ErrIncoherentMetadata happens when the cluster metadata is incoherent or not unmarshallable.
var ( // ErrParsingClientCACertificate is raised when we couldn't parse // the client CA certificate file. ErrParsingClientCACertificate = errors.New("parsing client CA certificate file failed") )
Functions ¶
func GetClusterRetentionPolicy ¶
func GetClusterRetentionPolicy( ctx context.Context, conn *repository.Connection, clusterName string, ) (*grpc.RetentionPolicy, error)
GetClusterRetentionPolicy reads the retention policy stored for clusterName in conn, the WAL repository backing a WAL server. Exported so the retention sweep (internal/retention) can read it in-process, sharing the same tier1 WAL repository as this server, without a gRPC round trip.
func Start ¶
func Start( ctx context.Context, repoConnection *repository.Connection, walServerConfiguration *config.WalServerConfig, tlsConfiguration *config.TLSConfig, queueURL string, tier opentelemetry.Tier, ) error
Start starts a WAL server.
Types ¶
type Implementation ¶
type Implementation struct {
grpc.UnimplementedWALServer
// contains filtered or unexported fields
}
Implementation is the implementation of the WAL server.
func (*Implementation) CloseBackup ¶
func (w *Implementation) CloseBackup( ctx context.Context, request *grpc.CloseBackupRequest, ) (*grpc.CloseBackupResult, error)
CloseBackup implements the CloseBackup GRPC call.
func (*Implementation) Get ¶
func (w *Implementation) Get(req *grpc.GetRequest, res grpc.WAL_GetServer) error
Get implements the relative GRPC call.
func (*Implementation) GetMetadata ¶
func (w *Implementation) GetMetadata( ctx context.Context, req *grpc.GetMetadataRequest, ) (*grpc.ClusterMetadata, error)
GetMetadata implements the GetMetadata GRPC call.
func (*Implementation) GetRetentionPolicy ¶
func (w *Implementation) GetRetentionPolicy( ctx context.Context, request *grpc.GetRetentionPolicyRequest, ) (*grpc.GetRetentionPolicyResult, error)
GetRetentionPolicy implements the GetRetentionPolicy GRPC call.
func (*Implementation) Put ¶
func (w *Implementation) Put(req grpc.WAL_PutServer) error
Put uploads a new WAL to the data store.
func (*Implementation) RequestWALStart ¶
func (w *Implementation) RequestWALStart( ctx context.Context, req *grpc.RequestWALStartRequest, ) (*grpc.RequestWALStartResult, error)
RequestWALStart implements the corresponding GRPC call, validating the WAL streaming request of a client.
func (*Implementation) ResetWALStream ¶
func (w *Implementation) ResetWALStream( ctx context.Context, req *grpc.ResetWALStreamRequest, ) (*grpc.ResetWALStreamResult, error)
ResetWALStream implements the GRPC call.
func (*Implementation) SetRetentionPolicy ¶
func (w *Implementation) SetRetentionPolicy( ctx context.Context, request *grpc.SetRetentionPolicyRequest, ) (*grpc.SetRetentionPolicyResult, error)
SetRetentionPolicy implements the SetRetentionPolicy GRPC call.
type Options ¶
type Options struct {
// Connection is the repository to be used with this WAL server
Connection *repository.Connection
// ReadOnly is true when the repository should deny any write attempt
ReadOnly bool
// Queue is the connection to the Queue
Queue *queue.Conn
// Tier is the storage tier this WAL server serves, used to tag its metrics
// (a tier-1 server reads/writes local disk; a tier-2 server serves WAL from
// remote object storage).
Tier opentelemetry.Tier
}
Options is the structure describing the behavior of a WAL server.