infs

package module
v0.0.0-...-edaca3c Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 9 Imported by: 4

Documentation

Overview

Package infs contains SOP implementations that use Redis for caching and the filesystem for backend data storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsStoreExists

func IsStoreExists(ctx context.Context, t sop.Transaction, name string) (bool, error)

IsStoreExists checks if a B-tree store with the given name exists in the backend.

func NewBtree

func NewBtree[TK btree.Ordered, TV any](ctx context.Context, so sop.StoreOptions, t sop.Transaction, comparer btree.ComparerFunc[TK]) (btree.BtreeInterface[TK, TV], error)

NewBtree creates a new B-tree instance with data persisted to the backend storage upon commit. If the B-tree (by name) is not found, a new one is created; otherwise, the existing one is opened and parameters validated. If you know it exists, prefer OpenBtree for clarity.

func NewBtreeWithReplication

func NewBtreeWithReplication[TK btree.Ordered, TV any](ctx context.Context, so sop.StoreOptions, t sop.Transaction, comparer btree.ComparerFunc[TK]) (btree.BtreeInterface[TK, TV], error)

NewBtreeWithReplication creates a B-tree that uses SOP's filesystem-based replication feature.

func NewStreamingDataStore

func NewStreamingDataStore[TK btree.Ordered](ctx context.Context, so sop.StoreOptions, trans sop.Transaction, comparer btree.ComparerFunc[sd.StreamingDataKey[TK]]) (*sd.StreamingDataStore[TK], error)

NewStreamingDataStore creates a streaming data store backed by a B-tree for chunked large-object storage.

func NewStreamingDataStoreWithReplication

func NewStreamingDataStoreWithReplication[TK btree.Ordered](ctx context.Context, so sop.StoreOptions, trans sop.Transaction, comparer btree.ComparerFunc[sd.StreamingDataKey[TK]]) (*sd.StreamingDataStore[TK], error)

NewStreamingDataStoreWithReplication creates a streaming data store with filesystem replication enabled.

func NewTransaction

func NewTransaction(ctx context.Context, config sop.TransactionOptions) (sop.Transaction, error)

NewTransaction is a convenience function to create an enduser facing transaction object that wraps the two phase commit transaction.

func NewTransactionWithReplication

func NewTransactionWithReplication(ctx context.Context, config sop.TransactionOptions) (sop.Transaction, error)

NewTransactionWithReplication creates a transaction that supports replication via SOP's replication on StoreRepository & Registry, and Erasure Coding on the Blob Store.

func NewTwoPhaseCommitTransaction

func NewTwoPhaseCommitTransaction(ctx context.Context, config sop.TransactionOptions) (sop.TwoPhaseCommitTransaction, error)

NewTwoPhaseCommitTransaction will instantiate a transaction object for writing(forWriting=true) or for reading(forWriting=false). Pass in -1 on maxTime to default to 15 minutes of max "commit" duration.

Timeout semantics: the commit ends when the earlier of ctx deadline or maxTime is reached. Locks use maxTime as TTL so they are bounded even if ctx is canceled. If you want replication/log cleanup to finish under the same budget, set ctx.Deadline to at least maxTime plus a small grace period.

func NewTwoPhaseCommitTransactionWithReplication

func NewTwoPhaseCommitTransactionWithReplication(ctx context.Context, config sop.TransactionOptions) (sop.TwoPhaseCommitTransaction, error)

NewTwoPhaseCommitTransactionWithReplication creates a two-phase commit transaction with replication enabled.

Timeout semantics: see NewTwoPhaseCommitTransaction for guidance on ctx.Deadline vs maxTime and lock TTLs. Returns sop.TwoPhaseCommitTransaction to allow integration with custom application transactions requiring direct access to SOP's API.

func OpenBtree

func OpenBtree[TK btree.Ordered, TV any](ctx context.Context, name string, t sop.Transaction, comparer btree.ComparerFunc[TK]) (btree.BtreeInterface[TK, TV], error)

OpenBtree opens an existing B-tree instance and prepares it for use in a transaction.

func OpenBtreeWithReplication

func OpenBtreeWithReplication[TK btree.Ordered, TV any](ctx context.Context, name string, t sop.Transaction, comparer btree.ComparerFunc[TK]) (btree.BtreeInterface[TK, TV], error)

OpenBtreeWithReplication opens a B-tree that uses SOP's filesystem-based replication feature.

func OpenStreamingDataStore

func OpenStreamingDataStore[TK btree.Ordered](ctx context.Context, name string, trans sop.Transaction, comparer btree.ComparerFunc[sd.StreamingDataKey[TK]]) (*sd.StreamingDataStore[TK], error)

OpenStreamingDataStore opens an existing streaming data store.

func OpenStreamingDataStoreWithReplication

func OpenStreamingDataStoreWithReplication[TK btree.Ordered](ctx context.Context, name string, trans sop.Transaction, comparer btree.ComparerFunc[sd.StreamingDataKey[TK]]) (*sd.StreamingDataStore[TK], error)

OpenStreamingDataStoreWithReplication opens an existing streaming data store with filesystem replication enabled.

func ReinstateFailedDrives

func ReinstateFailedDrives(ctx context.Context, storesFolders []string, cacheType sop.L2CacheType) error

ReinstateFailedDrives asks the replication tracker to reinstate failed passive targets. storesFolders must contain the active and passive stores' base folder paths.

func RemoveBtree

func RemoveBtree(ctx context.Context, name string, storesFolders []string, erasureConfig map[string]sop.ErasureCodingConfig, cacheType sop.L2CacheType, redisConfig ...*sop.RedisCacheConfig) error

RemoveBtree removes the B-tree with the given name from backend storage. This is destructive: it drops registry and node-blob data and cannot be rolled back.

Types

This section is empty.

Directories

Path Synopsis
stresstests

Jump to

Keyboard shortcuts

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