bucket

package
v0.0.0-...-ac41614 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 19 Imported by: 36

Documentation

Index

Constants

View Source
const MAX_SORTING_KEY_LENGTH = 255
View Source
const StorageFormatVersion = "1"
View Source
const UpgradeFormatBatchSize = 100

Variables

View Source
var ENoSuchBucket = errors.New("No such bucket")
View Source
var MASTER_MERKLE_TREE_PREFIX = []byte{0}
View Source
var NODE_METADATA_PREFIX = []byte{3}
View Source
var PARTITION_DATA_PREFIX = []byte{2}
View Source
var PARTITION_MERKLE_LEAF_PREFIX = []byte{1}

Functions

func NanoToMilli

func NanoToMilli(v uint64) uint64

Types

type BasicSiblingSetIterator

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

func NewBasicSiblingSetIterator

func NewBasicSiblingSetIterator(dbIterator StorageIterator, storageFormatVersion string) *BasicSiblingSetIterator

func (*BasicSiblingSetIterator) Error

func (ssIterator *BasicSiblingSetIterator) Error() error

func (*BasicSiblingSetIterator) Key

func (ssIterator *BasicSiblingSetIterator) Key() []byte

func (*BasicSiblingSetIterator) LocalVersion

func (ssIterator *BasicSiblingSetIterator) LocalVersion() uint64

func (*BasicSiblingSetIterator) Next

func (ssIterator *BasicSiblingSetIterator) Next() bool

func (*BasicSiblingSetIterator) Prefix

func (ssIterator *BasicSiblingSetIterator) Prefix() []byte

func (*BasicSiblingSetIterator) Release

func (ssIterator *BasicSiblingSetIterator) Release()

func (*BasicSiblingSetIterator) Value

func (ssIterator *BasicSiblingSetIterator) Value() *SiblingSet

type Bucket

type Bucket interface {
	Name() string
	ShouldReplicateOutgoing(peerID string) bool
	ShouldReplicateIncoming(peerID string) bool
	ShouldAcceptWrites(clientID string) bool
	ShouldAcceptReads(clientID string) bool
	RecordMetadata() error
	RebuildMerkleLeafs() error
	MerkleTree() *MerkleTree
	GarbageCollect(tombstonePurgeAge uint64) error
	Get(keys [][]byte) ([]*SiblingSet, error)
	GetMatches(keys [][]byte) (SiblingSetIterator, error)
	GetSyncChildren(nodeID uint32) (SiblingSetIterator, error)
	GetAll() (SiblingSetIterator, error)
	Forget(keys [][]byte) error
	Batch(batch *UpdateBatch) (map[string]*SiblingSet, error)
	Merge(siblingSets map[string]*SiblingSet) error
	Watch(ctx context.Context, keys [][]byte, prefixes [][]byte, localVersion uint64, ch chan Row)
	LockWrites()
	UnlockWrites()
	LockReads()
	UnlockReads()
}

type BucketList

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

func NewBucketList

func NewBucketList() *BucketList

func (*BucketList) AddBucket

func (bucketList *BucketList) AddBucket(bucket Bucket) *BucketList

func (*BucketList) All

func (bucketList *BucketList) All() []Bucket

func (*BucketList) Get

func (bucketList *BucketList) Get(bucketName string) Bucket

func (*BucketList) HasBucket

func (bucketList *BucketList) HasBucket(bucketName string) bool

func (*BucketList) Incoming

func (bucketList *BucketList) Incoming(peerID string) []Bucket

func (*BucketList) Outgoing

func (bucketList *BucketList) Outgoing(peerID string) []Bucket

type MerkleChildrenIterator

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

func NewMerkleChildrenIterator

func NewMerkleChildrenIterator(iter StorageIterator, storageDriver StorageDriver, storageFormatVersion string) *MerkleChildrenIterator

func (*MerkleChildrenIterator) Error

func (mIterator *MerkleChildrenIterator) Error() error

func (*MerkleChildrenIterator) Key

func (mIterator *MerkleChildrenIterator) Key() []byte

func (*MerkleChildrenIterator) LocalVersion

func (mIterator *MerkleChildrenIterator) LocalVersion() uint64

func (*MerkleChildrenIterator) Next

func (mIterator *MerkleChildrenIterator) Next() bool

func (*MerkleChildrenIterator) Prefix

func (mIterator *MerkleChildrenIterator) Prefix() []byte

func (*MerkleChildrenIterator) Release

func (mIterator *MerkleChildrenIterator) Release()

func (*MerkleChildrenIterator) Value

func (mIterator *MerkleChildrenIterator) Value() *SiblingSet

type Monitor

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

func NewMonitor

func NewMonitor(startVersion uint64) *Monitor

func (*Monitor) AddListener

func (monitor *Monitor) AddListener(ctx context.Context, keys [][]byte, prefixes [][]byte, ch chan data.Row)

func (*Monitor) DiscardIDRange

func (monitor *Monitor) DiscardIDRange(low uint64, high uint64)

This should be called if an ID range was reserved for a series of updates but those updates failed to be submitted so the range needs to be discarded

func (*Monitor) Notify

func (monitor *Monitor) Notify(update data.Row)

type Store

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

func (*Store) Batch

func (store *Store) Batch(batch *UpdateBatch) (map[string]*SiblingSet, error)

func (*Store) Forget

func (store *Store) Forget(keys [][]byte) error

func (*Store) GarbageCollect

func (store *Store) GarbageCollect(tombstonePurgeAge uint64) error

func (*Store) Get

func (store *Store) Get(keys [][]byte) ([]*SiblingSet, error)

func (*Store) GetAll

func (store *Store) GetAll() (SiblingSetIterator, error)

func (*Store) GetMatches

func (store *Store) GetMatches(keys [][]byte) (SiblingSetIterator, error)

func (*Store) GetSyncChildren

func (store *Store) GetSyncChildren(nodeID uint32) (SiblingSetIterator, error)

func (*Store) Initialize

func (store *Store) Initialize(nodeID string, storageDriver StorageDriver, merkleDepth uint8, conflictResolver ConflictResolver) error

func (*Store) LockReads

func (store *Store) LockReads()

func (*Store) LockWrites

func (store *Store) LockWrites()

func (*Store) Merge

func (store *Store) Merge(siblingSets map[string]*SiblingSet) error

func (*Store) MerkleTree

func (store *Store) MerkleTree() *MerkleTree

func (*Store) RebuildMerkleLeafs

func (store *Store) RebuildMerkleLeafs() error

func (*Store) RecordMetadata

func (store *Store) RecordMetadata() error

func (*Store) UnlockReads

func (store *Store) UnlockReads()

func (*Store) UnlockWrites

func (store *Store) UnlockWrites()

func (*Store) UpgradeStorageFormat

func (store *Store) UpgradeStorageFormat() error

func (*Store) Watch

func (store *Store) Watch(ctx context.Context, keys [][]byte, prefixes [][]byte, localVersion uint64, ch chan Row)

type UpdateBatch

type UpdateBatch struct {
	RawBatch *Batch          `json:"batch"`
	Contexts map[string]*DVV `json:"context"`
}

func NewUpdateBatch

func NewUpdateBatch() *UpdateBatch

func (*UpdateBatch) Batch

func (updateBatch *UpdateBatch) Batch() *Batch

func (*UpdateBatch) Context

func (updateBatch *UpdateBatch) Context() map[string]*DVV

func (*UpdateBatch) Delete

func (updateBatch *UpdateBatch) Delete(key []byte, context *DVV) (*UpdateBatch, error)

func (*UpdateBatch) FromJSON

func (updateBatch *UpdateBatch) FromJSON(reader io.Reader) error

func (*UpdateBatch) Put

func (updateBatch *UpdateBatch) Put(key []byte, value []byte, context *DVV) (*UpdateBatch, error)

func (*UpdateBatch) ToJSON

func (updateBatch *UpdateBatch) ToJSON() ([]byte, error)

type UpdateHeap

type UpdateHeap []*data.Row

func (UpdateHeap) Len

func (h UpdateHeap) Len() int

func (UpdateHeap) Less

func (h UpdateHeap) Less(i, j int) bool

func (*UpdateHeap) Pop

func (h *UpdateHeap) Pop() interface{}

func (*UpdateHeap) Push

func (h *UpdateHeap) Push(x interface{})

func (UpdateHeap) Swap

func (h UpdateHeap) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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