Documentation
¶
Index ¶
Constants ¶
View Source
const ModuleName = "worker/storage"
ModuleName is the storage worker module name.
Variables ¶
View Source
var ( // ErrRuntimeNotFound is the error returned when the called references an unknown runtime. ErrRuntimeNotFound = errors.New(ModuleName, 1, "worker/storage: runtime not found") // ErrCantPauseCheckpointer is the error returned when trying to pause the checkpointer without // setting the debug flag. ErrCantPauseCheckpointer = errors.New(ModuleName, 2, "worker/storage: pausing checkpointer only available in debug mode") )
Functions ¶
func RegisterService ¶
func RegisterService(server *grpc.Server, service StorageWorker)
RegisterService registers a new storage worker service with the given gRPC server.
Types ¶
type GetLastSyncedRoundRequest ¶
GetLastSyncedRoundRequest is a GetLastSyncedRound request.
type GetLastSyncedRoundResponse ¶
type GetLastSyncedRoundResponse struct {
Round uint64 `json:"round"`
IORoot storage.Root `json:"io_root"`
StateRoot storage.Root `json:"state_root"`
}
GetLastSyncedRoundResponse is a GetLastSyncedRound response.
type PauseCheckpointerRequest ¶ added in v0.2102.0
type PauseCheckpointerRequest struct {
RuntimeID common.Namespace `json:"runtime_id"`
Pause bool `json:"pause"`
}
PauseCheckpointerRequest is a PauseCheckpointer request.
type Status ¶ added in v0.2010.0
type Status struct {
// LastFinalizedRound is the last synced and finalized round.
LastFinalizedRound uint64 `json:"last_finalized_round"`
}
Status is the storage worker status.
type StorageWorker ¶
type StorageWorker interface {
// GetLastSyncedRound retrieves the last synced round for the storage worker.
GetLastSyncedRound(ctx context.Context, request *GetLastSyncedRoundRequest) (*GetLastSyncedRoundResponse, error)
// WaitForRound waits until the storage worker syncs the given round or root.
// It returns the round synced to; this will typically equal the given root's
// round, but may be higher.
WaitForRound(ctx context.Context, request *WaitForRoundRequest) (*WaitForRoundResponse, error)
// PauseCheckpointer pauses or unpauses the storage worker's checkpointer.
PauseCheckpointer(ctx context.Context, request *PauseCheckpointerRequest) error
}
StorageWorker is the storage worker control API interface.
func NewStorageWorkerClient ¶
func NewStorageWorkerClient(c *grpc.ClientConn) StorageWorker
NewStorageWorkerClient creates a new gRPC transaction scheduler client service.
type WaitForRoundRequest ¶ added in v0.2102.0
type WaitForRoundRequest struct {
RuntimeID common.Namespace `json:"runtime_id"`
Round uint64 `json:"round"`
Root *storage.Root `json:"root"`
}
WaitForRoundRequest is a WaitForStorageRound request.
type WaitForRoundResponse ¶ added in v0.2102.0
type WaitForRoundResponse struct {
LastRound uint64 `json:"last_round"`
}
WaitForRoundResponse is a WaitForRound response.
Click to show internal directories.
Click to hide internal directories.