storage

package
v0.37.0-crescendo-RC3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerDatastoreManager

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

BadgerDatastoreManager wraps the Badger datastore to implement the DatastoreManager interface. It provides access to a Badger datastore instance and implements the required methods for managing it.

func NewBadgerDatastoreManager

func NewBadgerDatastoreManager(path string, options *badgerds.Options) (*BadgerDatastoreManager, error)

NewBadgerDatastoreManager creates a new instance of BadgerDatastoreManager with the specified datastore path and options.

Parameters: - path: The path where the datastore files will be stored. - options: Configuration options for the Badger datastore.

No errors are expected during normal operations.

func (*BadgerDatastoreManager) Close

func (b *BadgerDatastoreManager) Close() error

Close terminates the connection to the datastore and releases any associated resources. This method should be called when finished using the datastore to ensure proper resource cleanup.

func (*BadgerDatastoreManager) CollectGarbage

func (b *BadgerDatastoreManager) CollectGarbage(ctx context.Context) error

CollectGarbage initiates garbage collection on the Badger datastore to reclaim unused space and optimize performance.

func (*BadgerDatastoreManager) DB

func (b *BadgerDatastoreManager) DB() interface{}

DB returns the raw database object, allowing for more direct access to the underlying database features and operations.

func (*BadgerDatastoreManager) Datastore

func (b *BadgerDatastoreManager) Datastore() ds.Batching

Datastore provides access to the datastore for performing batched read and write operations.

type DatastoreManager

type DatastoreManager interface {
	// Datastore provides access to the datastore for performing batched
	// read and write operations.
	Datastore() datastore.Batching
	// DB returns the raw database object, allowing for more direct
	// access to the underlying database features and operations.
	DB() interface{}
	// Close terminates the connection to the datastore and releases
	// any associated resources. This method should be called
	// when finished using the datastore to ensure proper resource cleanup.
	Close() error
	// CollectGarbage initiates garbage collection on the datastore
	// to reclaim unused space and optimize performance.
	CollectGarbage(ctx context.Context) error
}

DatastoreManager is an interface that defines the methods for managing a datastore used for handling execution data. It provides methods to access the underlying datastore, perform garbage collection, and handle closing operations. Implementations of this interface are expected to wrap around different types of datastore's.

type PebbleDatastoreManager

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

PebbleDatastoreManager wraps the PebbleDB to implement the StorageDB interface.

func NewPebbleDatastoreManager

func NewPebbleDatastoreManager(path string, options *pebble.Options) (*PebbleDatastoreManager, error)

NewPebbleDatastoreManager creates and returns a new instance of PebbleDatastoreManager. It initializes the PebbleDB database with the specified path and options. If no options are provided, default options are used.

Parameters:

  • path: The path to the directory where the PebbleDB files will be stored.
  • options: Configuration options for the PebbleDB database. If nil, default options are applied.

No errors are expected during normal operations.

func (*PebbleDatastoreManager) Close

func (p *PebbleDatastoreManager) Close() error

Close terminates the connection to the datastore and releases any associated resources. This method should be called when finished using the datastore to ensure proper resource cleanup.

func (*PebbleDatastoreManager) CollectGarbage

func (p *PebbleDatastoreManager) CollectGarbage(_ context.Context) error

CollectGarbage initiates garbage collection on the datastore to reclaim unused space and optimize performance.

func (*PebbleDatastoreManager) DB

func (p *PebbleDatastoreManager) DB() interface{}

DB returns the raw database object, allowing for more direct access to the underlying database features and operations.

func (*PebbleDatastoreManager) Datastore

func (p *PebbleDatastoreManager) Datastore() ds.Batching

Datastore provides access to the datastore for performing batched read and write operations.

Jump to

Keyboard shortcuts

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