wbstore

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Package wbstore implements a wrapper for a blob.Store that caches non-replacement writes of in a buffer and pushes them to the base store concurrently in the background.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	*monitor.M[wbState, *kvWrapper]
	// contains filtered or unexported fields
}

Store implements the blob.Store interface by delegating to a base store. Non-replacement writes to blob.KV instances derived from the base store are buffered and written back to the underlying store by a background worker that runs concurrently with the store.

func New

func New(ctx context.Context, base, buf blob.Store) Store

New constructs a blob.Store wrapper that delegates to base and uses buf as a local buffer store. New will panic if base == nil or buf == nil. The ctx value governs the operation of the background writer, which will run until the store is closed or ctx terminates.

func (Store) BufferLen added in v0.13.0

func (s Store) BufferLen(ctx context.Context) (int64, error)

BufferLen reports the total number of keys buffered for writeback in the buffer storage of s.

func (Store) Close

func (s Store) Close(ctx context.Context) error

Close implements the blob.Closer interface for s.

Jump to

Keyboard shortcuts

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