Documentation ¶
Overview ¶
Package storage implements the storage backend.
Index ¶
- Constants
- Variables
- func Enabled() bool
- func GetLocalBackendDBDir(dataDir, backend string) string
- func NewLocalBackend(dataDir string, namespace common.Namespace, identity *identity.Identity) (api.LocalBackend, error)
- type Worker
- func (w *Worker) Cleanup()
- func (w *Worker) Enabled() bool
- func (w *Worker) GetLastSyncedRound(ctx context.Context, request *api.GetLastSyncedRoundRequest) (*api.GetLastSyncedRoundResponse, error)
- func (w *Worker) GetRuntime(id common.Namespace) *committee.Node
- func (w *Worker) Initialized() <-chan struct{}
- func (w *Worker) Name() string
- func (w *Worker) PauseCheckpointer(ctx context.Context, request *api.PauseCheckpointerRequest) error
- func (w *Worker) Quit() <-chan struct{}
- func (w *Worker) Start() error
- func (w *Worker) Stop()
- func (w *Worker) WaitForRound(ctx context.Context, request *api.WaitForRoundRequest) (*api.WaitForRoundResponse, error)
Constants ¶
const ( // CfgWorkerEnabled enables the storage worker. CfgWorkerEnabled = "worker.storage.enabled" // CfgWorkerPublicRPCEnabled enables storage state access for all nodes instead of just // storage committee members. CfgWorkerPublicRPCEnabled = "worker.storage.public_rpc.enabled" // CfgWorkerCheckpointerDisabled disables the storage checkpointer. CfgWorkerCheckpointerDisabled = "worker.storage.checkpointer.disabled" // CfgWorkerCheckpointCheckInterval configures the checkpointer check interval. CfgWorkerCheckpointCheckInterval = "worker.storage.checkpointer.check_interval" // CfgCheckpointSyncDisabled disables syncing from checkpoints on worker startup. CfgWorkerCheckpointSyncDisabled = "worker.storage.checkpoint_sync.disabled" // CfgWorkerDebugIgnoreApply is a debug option that makes the worker ignore // all apply operations. CfgWorkerDebugIgnoreApply = "worker.debug.storage.ignore_apply" // CfgBackend configures the storage backend flag. CfgBackend = "worker.storage.backend" // CfgLRUSlots configures the LRU apply lock slots. CfgLRUSlots = "worker.storage.root_cache.apply_lock_lru_slots" // CfgMaxCacheSize configures the maximum in-memory cache size. CfgMaxCacheSize = "worker.storage.max_cache_size" // CfgInsecureSkipChecks disables known root checks. CfgInsecureSkipChecks = "worker.storage.debug.insecure_skip_checks" )
Variables ¶
var Flags = flag.NewFlagSet("", flag.ContinueOnError)
Flags has the configuration flags.
Functions ¶
func GetLocalBackendDBDir ¶ added in v0.2100.0
GetLocalBackendDBDir returns the database name for local backends.
func NewLocalBackend ¶ added in v0.2012.3
func NewLocalBackend( dataDir string, namespace common.Namespace, identity *identity.Identity, ) (api.LocalBackend, error)
NewLocalBackend constructs a new Backend based on the configuration flags.
Types ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker is a worker handling storage operations.
func New ¶
func New( grpcInternal *grpc.Server, commonWorker *workerCommon.Worker, registration *registration.Worker, genesis genesis.Provider, commonStore *persistent.CommonStore, ) (*Worker, error)
New constructs a new storage worker.
func (*Worker) Cleanup ¶
func (w *Worker) Cleanup()
Cleanup performs the service specific post-termination cleanup.
func (*Worker) GetLastSyncedRound ¶
func (w *Worker) GetLastSyncedRound(ctx context.Context, request *api.GetLastSyncedRoundRequest) (*api.GetLastSyncedRoundResponse, error)
func (*Worker) GetRuntime ¶ added in v0.2010.0
GetRuntime returns a storage committee node for the given runtime (if available).
In case the runtime with the specified id was not configured for this node it returns nil.
func (*Worker) Initialized ¶
func (w *Worker) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the storage worker is initialized and ready to service requests.
func (*Worker) PauseCheckpointer ¶ added in v0.2102.0
func (*Worker) Quit ¶
func (w *Worker) Quit() <-chan struct{}
Quit returns a channel that will be closed when the service terminates.
func (*Worker) WaitForRound ¶ added in v0.2102.0
func (w *Worker) WaitForRound(ctx context.Context, request *api.WaitForRoundRequest) (*api.WaitForRoundResponse, error)