data

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HASH_SIZE_BYTES = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DVV

type DVV struct {
	VVDot Dot               `json:"dot"`
	VV    map[string]uint64 `json:"vv"`
}

func NewDVV

func NewDVV(dot *Dot, vv map[string]uint64) *DVV

func (*DVV) Context

func (dvv *DVV) Context() map[string]uint64

func (*DVV) Dot

func (dvv *DVV) Dot() Dot

func (*DVV) Equals

func (dvv *DVV) Equals(otherDVV *DVV) bool

func (*DVV) HappenedBefore

func (dvv *DVV) HappenedBefore(otherDVV *DVV) bool

func (*DVV) Hash

func (dvv *DVV) Hash() Hash

func (*DVV) MarshalBinary

func (dvv *DVV) MarshalBinary() ([]byte, error)

func (*DVV) MaxDot

func (dvv *DVV) MaxDot(nodeID string) uint64

func (*DVV) Replicas

func (dvv *DVV) Replicas() []string

func (*DVV) UnmarshalBinary

func (dvv *DVV) UnmarshalBinary(data []byte) error

type Diff

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

func (Diff) Key

func (diff Diff) Key() string

func (Diff) NewSiblingSet

func (diff Diff) NewSiblingSet() *SiblingSet

func (Diff) OldSiblingSet

func (diff Diff) OldSiblingSet() *SiblingSet

type Dot

type Dot struct {
	NodeID string `json:"node"`
	Count  uint64 `json:"count"`
}

func NewDot

func NewDot(nodeID string, count uint64) *Dot

type Hash

type Hash struct {
	Hash [2]uint64
}

func NewHash

func NewHash(input []byte) Hash

func (Hash) Bytes

func (hash Hash) Bytes() [16]byte

func (Hash) High

func (hash Hash) High() uint64

func (Hash) Low

func (hash Hash) Low() uint64

func (Hash) SetHigh

func (hash Hash) SetHigh(h uint64) Hash

func (Hash) SetLow

func (hash Hash) SetLow(l uint64) Hash

func (Hash) Xor

func (hash Hash) Xor(otherHash Hash) Hash

type Row

type Row struct {
	Key          string      `json:"key"`
	LocalVersion uint64      `json:"localVersion"`
	Siblings     *SiblingSet `json:"siblings"`
}

func (*Row) Decode

func (row *Row) Decode(encodedRow []byte, formatVersion string) error

func (*Row) Encode

func (row *Row) Encode() []byte

type Sibling

type Sibling struct {
	VectorClock       *DVV   `json:"clock"`
	BinaryValue       []byte `json:"value"`
	PhysicalTimestamp uint64 `json:"timestamp"`
}

func NewSibling

func NewSibling(clock *DVV, value []byte, timestamp uint64) *Sibling

func (*Sibling) Clock

func (sibling *Sibling) Clock() *DVV

func (*Sibling) Compare

func (sibling *Sibling) Compare(otherSibling *Sibling) int

provides an ordering between siblings in order to break ties and decide which one to keep when two siblings have the same clock value. Favors keeping a value instead of a tombstone.

func (*Sibling) Hash

func (sibling *Sibling) Hash() Hash

func (*Sibling) IsTombstone

func (sibling *Sibling) IsTombstone() bool

func (*Sibling) MarshalBinary

func (sibling *Sibling) MarshalBinary() ([]byte, error)

func (*Sibling) Timestamp

func (sibling *Sibling) Timestamp() uint64

func (*Sibling) UnmarshalBinary

func (sibling *Sibling) UnmarshalBinary(data []byte) error

func (*Sibling) Value

func (sibling *Sibling) Value() []byte

type SiblingSet

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

func NewSiblingSet

func NewSiblingSet(siblings map[*Sibling]bool) *SiblingSet

func (*SiblingSet) Add

func (siblingSet *SiblingSet) Add(sibling *Sibling) *SiblingSet

func (*SiblingSet) CanPurge

func (siblingSet *SiblingSet) CanPurge(timestampCutoff uint64) bool

func (*SiblingSet) Decode

func (siblingSet *SiblingSet) Decode(encodedSiblingSet []byte) error

func (*SiblingSet) Delete

func (siblingSet *SiblingSet) Delete(sibling *Sibling) *SiblingSet

func (*SiblingSet) Diff

func (siblingSet *SiblingSet) Diff(otherSiblingSet *SiblingSet) *SiblingSet

func (*SiblingSet) Discard

func (siblingSet *SiblingSet) Discard(clock *DVV) *SiblingSet

func (*SiblingSet) Encode

func (siblingSet *SiblingSet) Encode() []byte

func (*SiblingSet) Event

func (siblingSet *SiblingSet) Event(contextClock map[string]uint64, replica string) *DVV

func (*SiblingSet) GetOldestTombstone

func (siblingSet *SiblingSet) GetOldestTombstone() *Sibling

func (*SiblingSet) Has

func (siblingSet *SiblingSet) Has(sibling *Sibling) bool

func (*SiblingSet) Hash

func (siblingSet *SiblingSet) Hash(key []byte) Hash

func (*SiblingSet) IsTombstoneSet

func (siblingSet *SiblingSet) IsTombstoneSet() bool

func (*SiblingSet) Iter

func (siblingSet *SiblingSet) Iter() <-chan *Sibling

func (*SiblingSet) Join

func (siblingSet *SiblingSet) Join() map[string]uint64

func (*SiblingSet) JoinOne

func (siblingSet *SiblingSet) JoinOne(replica string) uint64

func (*SiblingSet) MarshalBinary

func (siblingSet *SiblingSet) MarshalBinary() ([]byte, error)

func (*SiblingSet) MarshalJSON

func (siblingSet *SiblingSet) MarshalJSON() ([]byte, error)

func (*SiblingSet) MergeSync

func (siblingSet *SiblingSet) MergeSync(otherSiblingSet *SiblingSet, replica string) *SiblingSet

func (*SiblingSet) Size

func (siblingSet *SiblingSet) Size() int

func (*SiblingSet) Sync

func (siblingSet *SiblingSet) Sync(otherSiblingSet *SiblingSet) *SiblingSet

func (*SiblingSet) UnmarshalBinary

func (siblingSet *SiblingSet) UnmarshalBinary(data []byte) error

func (*SiblingSet) UnmarshalJSON

func (siblingSet *SiblingSet) UnmarshalJSON(data []byte) error

func (*SiblingSet) Value

func (siblingSet *SiblingSet) Value() []byte

type SiblingSetIterator

type SiblingSetIterator interface {
	Next() bool
	Prefix() []byte
	Key() []byte
	Value() *SiblingSet
	LocalVersion() uint64
	Release()
	Error() error
}

type Update

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

func NewUpdate

func NewUpdate() *Update

func (*Update) AddDiff

func (update *Update) AddDiff(key string, oldSiblingSet *SiblingSet, newSiblingSet *SiblingSet) *Update

func (*Update) Iter

func (update *Update) Iter() <-chan Diff

func (*Update) Size

func (update *Update) Size() int

Jump to

Keyboard shortcuts

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