rdt

package
v0.0.0-...-7f7ac00 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CAUSAL_SET_UUID = ron.NewName("cas")
View Source
var DELTA_UUID = ron.NewName("d")
View Source
var LOG_UUID = ron.NewName("log")
View Source
var LWW_UUID = ron.NewName("lww")
View Source
var NO_ATOMS []ron.Atom
View Source
var RGA_UUID = ron.NewName("rga")
View Source
var RM_UUID = ron.NewName("rm")
View Source
var SET_UUID = ron.NewName("set")
View Source
var VV_UUID = ron.NewName("vv")

Functions

func AddMax

func AddMax(rmmap map[ron.UUID]ron.UUID, event, target ron.UUID)

func MakeCausalSetReducer

func MakeCausalSetReducer() ron.Reducer

func MakeLWW

func MakeLWW() ron.Reducer

func MakeLogReducer

func MakeLogReducer() ron.Reducer

func MakeRGAReducer

func MakeRGAReducer() ron.Reducer

func MakeSetReducer

func MakeSetReducer() ron.Reducer

func MakeVVReducer

func MakeVVReducer() ron.Reducer

func SetComparator

func SetComparator(af, bf *ron.Frame) int64

func VVComparator

func VVComparator(a, b *ron.Frame) int64

Types

type CausalSet

type CausalSet struct {
	AlwaysFull bool
	// contains filtered or unexported fields
}

Causal set, assumes causally consistent op delivery. Hence, no tombstones. You can either add or remove an atom/tuple. Equal elements possible.

func (CausalSet) Features

func (cs CausalSet) Features() int

func (CausalSet) Reduce

func (cs CausalSet) Reduce(batch ron.Batch) ron.Frame

type LWW

type LWW struct {
}

LWW is a last-write-wins replicated data type that may host a variety of user-land data types, like:

  • a dictionary,
  • a struct or
  • a simple 1D array (no splice, no index shifts),
  • a simple 2D array.

This LWW employs client-side logical timestamps to decide which write wins, on a field-by-field basis. That is similar to e.g. Cassandra LWW.

func (LWW) Features

func (lww LWW) Features() int

func (LWW) Reduce

func (lww LWW) Reduce(inputs ron.Batch) (res ron.Frame)

type Log

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

func (Log) Features

func (log Log) Features() int

func (Log) Reduce

func (log Log) Reduce(batch ron.Batch) ron.Frame

type RGA

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

RGA is a Replicated Growable Array data type, an ordered collection of anything (numbers, strings, objects). This algorithm is actually closer to Causal Trees, albeit that name may turn confusing (RG Arrays are actually trees, Causal Trees are actually arrays, but nevermind).

Algorithmically, this differs from Operational Transforms by bruteforcing the problem: all the elements of an array have unique ids, so concurrent changes can't introduce confusion.

func (RGA) Features

func (rga RGA) Features() int

func (RGA) Reduce

func (rga RGA) Reduce(batch ron.Batch) ron.Frame

Reduce RGA frames

type RefOrderedBatch

type RefOrderedBatch []*ron.Frame

func (RefOrderedBatch) Len

func (b RefOrderedBatch) Len() int

func (RefOrderedBatch) Less

func (b RefOrderedBatch) Less(i, j int) bool

func (RefOrderedBatch) Swap

func (b RefOrderedBatch) Swap(i, j int)

type RevOrderedUUIDSlice

type RevOrderedUUIDSlice []ron.UUID

func (RevOrderedUUIDSlice) Len

func (b RevOrderedUUIDSlice) Len() int

func (RevOrderedUUIDSlice) Less

func (b RevOrderedUUIDSlice) Less(i, j int) bool

func (RevOrderedUUIDSlice) Swap

func (b RevOrderedUUIDSlice) Swap(i, j int)

type Set

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

Set, fully commutative, with tombstones. You can either add or remove an atom/tuple. Equal elements possible.

func (Set) Features

func (set Set) Features() int

func (Set) Reduce

func (set Set) Reduce(batch ron.Batch) ron.Frame

type TxtMapper

type TxtMapper struct {
}

func (TxtMapper) Map

func (txt TxtMapper) Map(batch ron.Batch) string

type VV

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

func (VV) Features

func (vv VV) Features() int

func (VV) Reduce

func (vv VV) Reduce(batch ron.Batch) ron.Frame

Jump to

Keyboard shortcuts

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