Documentation ¶
Index ¶
- Constants
- Variables
- func CalendarToRFC(uuid UUID) (u [16]byte)
- func CalendarToRFCString(uuid UUID) string
- func Compare(a, b UUID) int
- func DecodeCalendar(v uint64) time.Time
- func EncodeCalendar(t time.Time) (i uint64)
- func EventComparator(a, b *Frame) int64
- func EventComparatorDesc(a, b *Frame) int64
- func FormatInt(output []byte, value uint64) []byte
- func FormatUUID(buf []byte, uuid UUID) []byte
- func FormatZipInt(output []byte, value, context uint64) []byte
- func FormatZipUUID(buf []byte, uuid, context UUID) []byte
- func Int60Prefix(a, b uint64) int
- func IsBase64(b byte) bool
- func RefComparator(a, b *Frame) int64
- func RefComparatorDesc(a, b *Frame) int64
- type Atom
- type Atoms
- type Batch
- func (batch *Batch) AppendFrame(f Frame)
- func (batch Batch) AppendOpFrame(term int, atoms []Atom) Batch
- func (batch Batch) Compare(other Batch) (eq bool, op, at int)
- func (batch Batch) Equal(other Batch) bool
- func (batch Batch) HasFullState() bool
- func (batch Batch) IsEmpty() bool
- func (batch Batch) Join() Frame
- func (batch Batch) Len() int
- func (batch Batch) String() (ret string)
- func (batch Batch) WriteAll(w io.Writer) (err error)
- type Checker
- type Clock
- type Comparator
- type EmptyReducer
- type Environment
- type Frame
- func CreateFrame(rdtype, object, event, location, value string) Frame
- func MakeFormattedFrame(format uint, prealloc_bytes int) (ret Frame)
- func MakeFrame(prealloc_bytes int) (ret Frame)
- func MakeQueryFrame(headerSpec Spec) Frame
- func MakeStream(prealloc_bytes int) (ret Frame)
- func NewBufferFrame(data []byte) (i Frame)
- func NewFormattedFrame(format uint) (ret Frame)
- func NewFrame() Frame
- func NewOp(term int, rdt, obj, event, ref UUID, values Atoms) Frame
- func NewOpFrame(t, o, e, r UUID, term int) Frame
- func NewQuery(t, o, e, r UUID) Frame
- func NewRawOp(t, o, e, r UUID) Frame
- func NewStateHeader(t, o, e, r UUID) Frame
- func NewStringFrame(data string) (i Frame)
- func OpenFrame(data []byte) Frame
- func ParseFrame(data []byte) Frame
- func ParseFrameString(frame string) Frame
- func ParseStream(buf []byte) Frame
- func (frame *Frame) AddReducedOp(event, ref UUID, atoms ...Atom)
- func (frame *Frame) Append(other Frame)
- func (frame *Frame) AppendAll(i Frame)
- func (frame *Frame) AppendAmended(spec Spec, values Frame, term int)
- func (frame *Frame) AppendBytes(data []byte)
- func (frame *Frame) AppendEmpty(spec Spec, term int)
- func (frame *Frame) AppendEmptyReducedOp(spec Spec)
- func (frame *Frame) AppendFrame(second Frame)
- func (frame *Frame) AppendOp(term int, atoms Atoms)
- func (frame *Frame) AppendQueryHeader(spec Spec)
- func (frame *Frame) AppendReduced(other Frame)
- func (frame *Frame) AppendReducedOpInt(spec Spec, value int64)
- func (frame *Frame) AppendReducedOpUUID(spec Spec, value UUID)
- func (frame *Frame) AppendReducedRef(ref UUID, other Frame)
- func (frame *Frame) AppendSpecValT(spec Spec, value Atom, term int)
- func (frame *Frame) AppendSpecValuesTerm(spec Spec, values Atoms, term int)
- func (frame *Frame) AppendStateHeader(spec Spec)
- func (frame *Frame) AppendStateHeaderValues(rdt, obj, ev, ref UUID, values Atoms)
- func (frame Frame) Atom(i int) Atom
- func (frame Frame) Atoms() []Atom
- func (frame Frame) Cap() int
- func (frame Frame) Clone() (clone Frame)
- func (frame *Frame) Close() Frame
- func (frame Frame) Compare(other Frame) (eq bool, at int)
- func (frame Frame) CompareAll(other Frame) (eq bool, op, at int)
- func (frame Frame) Count() int
- func (frame Frame) EOF() bool
- func (frame Frame) Equal(other Frame) bool
- func (frame Frame) EscString(idx int) []byte
- func (frame Frame) Event() UUID
- func (frame Frame) Fill(clock Clock, env Environment) Frame
- func (frame Frame) GetInt(i int) int
- func (frame Frame) GetInteger(i int) int64
- func (frame Frame) GetString(i int) string
- func (frame Frame) GetUUID(i int) UUID
- func (frame Frame) HasIntAt(i int) bool
- func (frame Frame) HasUUIDAt(i int) bool
- func (frame Frame) Integer(i int) int64
- func (frame Frame) IsComment() bool
- func (frame Frame) IsComplete() bool
- func (frame Frame) IsEmpty() bool
- func (frame Frame) IsFramed() bool
- func (frame Frame) IsFullState() bool
- func (frame Frame) IsHeader() bool
- func (frame Frame) IsLast() bool
- func (frame Frame) IsOff() bool
- func (frame Frame) IsOn() bool
- func (frame Frame) IsQuery() bool
- func (frame Frame) IsRaw() bool
- func (frame Frame) IsSameOp(b Frame) bool
- func (frame Frame) Len() int
- func (frame *Frame) Next() bool
- func (frame Frame) Object() UUID
- func (frame Frame) Offset() int
- func (frame Frame) OpString() string
- func (frame Frame) Origin() uint64
- func (frame *Frame) Parse()
- func (frame Frame) Position() int
- func (frame Frame) RawString(idx int) string
- func (frame *Frame) Read(reader io.Reader) (length int, err error)
- func (frame Frame) Ref() UUID
- func (frame Frame) Reformat(format uint) Frame
- func (frame Frame) Rest() []byte
- func (frame Frame) Rewind() Frame
- func (frame *Frame) SkipHeader()
- func (frame Frame) Spec() Spec
- func (frame Frame) Split() Batch
- func (frame Frame) Split2() (left, right Frame)
- func (frame Frame) SplitInclusive() Frame
- func (frame Frame) Stamp(clock Clock) Frame
- func (frame Frame) String() string
- func (frame Frame) Term() int
- func (frame Frame) Time() uint64
- func (frame Frame) Type() UUID
- func (frame Frame) UUID(idx int) UUID
- func (frame Frame) Values() []Atom
- func (frame Frame) Verify() int
- func (frame Frame) Write(w io.Writer) error
- type FrameHeap
- func (heap *FrameHeap) Clear()
- func (heap *FrameHeap) Current() (frame *Frame)
- func (heap *FrameHeap) EOF() bool
- func (heap *FrameHeap) Frame() Frame
- func (heap FrameHeap) Len() int
- func (heap *FrameHeap) Next() (frame *Frame)
- func (heap *FrameHeap) NextPrim() (frame *Frame)
- func (heap *FrameHeap) Put(i *Frame)
- func (heap *FrameHeap) PutAll(b Batch)
- func (heap *FrameHeap) PutFrame(frame Frame)
- type Half
- type Mapper
- type OmniReducer
- type ParserState
- type RawUUID
- type Reducer
- type ReducerMaker
- type SerializerState
- type Spec
- type StringMapper
- type UUID
- func NewError(name string) UUID
- func NewEventUUID(time, origin uint64) UUID
- func NewHashUUID(time, origin uint64) UUID
- func NewName(name string) UUID
- func NewNameUUID(time, origin uint64) UUID
- func NewRonUUID(scheme, variety uint, value, origin uint64) UUID
- func NewUUID(scheme uint, value, origin uint64) UUID
- func ParseUUID(data []byte) (uuid UUID, err error)
- func ParseUUIDString(uuid string) (ret UUID, err error)
- func (u UUID) Atom() Atom
- func (a UUID) Compare(b UUID) int64
- func (uuid UUID) Derived() UUID
- func (a UUID) EarlierThan(b UUID) bool
- func (t UUID) Equal(b UUID) bool
- func (uuid UUID) Error() string
- func (uuid UUID) IsError() bool
- func (uuid UUID) IsName() bool
- func (uuid UUID) IsTemplate() bool
- func (uuid UUID) IsTranscendentName() bool
- func (uuid UUID) IsZero() bool
- func (a UUID) LaterThan(b UUID) bool
- func (uuid UUID) Origin() uint64
- func (ctx_uuid UUID) Parse(data []byte) (UUID, error)
- func (a UUID) Replica() uint64
- func (a UUID) SameAs(b UUID) bool
- func (a UUID) Scheme() uint64
- func (a UUID) Sign() byte
- func (uuid UUID) String() (ret string)
- func (uuid UUID) ToScheme(scheme uint) UUID
- func (uuid UUID) Value() uint64
- func (a UUID) Variety() uint
- func (uuid UUID) ZipString(context UUID) string
- type UUIDHeap
- type UUIDMultiMap
- func (um *UUIDMultiMap) Add(key, value UUID)
- func (um UUIDMultiMap) Keys() []UUID
- func (um UUIDMultiMap) Len() int
- func (um UUIDMultiMap) List(key UUID) []UUID
- func (um *UUIDMultiMap) Put(key UUID, values []UUID)
- func (um *UUIDMultiMap) Remove(key UUID, value UUID)
- func (um UUIDMultiMap) Take(key UUID) (ret []UUID)
- type VVector
Constants ¶
const ( ACID_NONE = iota // single-writer, strictly "state + linear op log", like MySQL ACID_D = 1 // multiple-writer, partial-order ACID_I = 2 // survives data duplication ACID_ID = ACID_I | ACID_D ACID_C = 4 // arbitrary order (causality violations don't break convergence) ACID_CD = ACID_C | ACID_D ACID_CID = ACID_CD | ACID_I ACID_A = 8 // can form patches ACID_AD = ACID_A | ACID_D ACID_AI = ACID_I | ACID_A ACID_AID = ACID_A | ACID_ID ACID_ACD = ACID_C | ACID_AD ACID_FULL = ACID_A | ACID_CID )
An RDT may have a combination of the following features:
* Associative (ab)c = a(bc) * Commutative ab = ba * Idempotent aa = a * Distributed ab=ba, but for concurrent ops only
These features tell us precisely what we can do with an object of a given type. e.g. ACID_NONE are single-writer objects; ACID_D is the bare minimum necessary for a multiple-writer type. ACID_FULL are the most robust: they survive everything but data loss; ACID_AID are close to ACID_FULL, except they depend on causal delivery order.
const ( SPEC_TYPE = iota SPEC_OBJECT SPEC_EVENT SPEC_REF )
const ( UUID_NAME = iota UUID_HASH UUID_EVENT UUID_DERIVED )
const ( ATOM_UUID = iota ATOM_INT ATOM_STRING ATOM_FLOAT )
const ( TERM_RAW = iota TERM_REDUCED TERM_HEADER TERM_QUERY )
const ( PREFIX_PRE4 = iota PREFIX_PRE5 PREFIX_PRE6 PREFIX_PRE7 PREFIX_PRE8 PREFIX_PRE9 )
const ( BASE_0 = iota BASE_1 BASE_2 BASE_3 BASE_4 BASE_5 BASE_6 BASE_7 BASE_8 BASE_9 BASE_10 BASE_11 BASE_12 BASE_13 BASE_14 BASE_15 BASE_16 BASE_17 BASE_18 BASE_19 BASE_20 BASE_21 BASE_22 BASE_23 BASE_24 BASE_25 BASE_26 BASE_27 BASE_28 BASE_29 BASE_30 BASE_31 BASE_32 BASE_33 BASE_34 BASE_35 BASE_36 BASE_37 BASE_38 BASE_39 BASE_40 BASE_41 BASE_42 BASE_43 BASE_44 BASE_45 BASE_46 BASE_47 BASE_48 BASE_49 BASE_50 BASE_51 BASE_52 BASE_53 BASE_54 BASE_55 BASE_56 BASE_57 BASE_58 BASE_59 BASE_60 BASE_61 BASE_62 BASE_63 )
const ( FORMAT_UNZIP = 1 << iota FORMAT_GRID FORMAT_SPACE FORMAT_HEADER_SPACE FORMAT_NOSKIP FORMAT_REDEFAULT FORMAT_OP_LINES FORMAT_FRAME_LINES FORMAT_INDENT )
const ( // The parser reached end-of-input (in block mode) or // the closing dot (in streaming mode) successfully. // The rest of the input is frame.Rest() RON_FULL_STOP = -1 RON_OPEN uint64 = 1919905842 // https://play.golang.org/p/vo74Pf-DKh2 RON_CLOSED uint64 = 1919905330 )
const ATOM_FLOAT_SEP = '^'
const ATOM_INT_SEP = '='
const ATOM_STRING_SEP = '\''
const ATOM_UUID_SEP = '>'
const BASE_0_SEP = '0'
const BASE_10_SEP = 'A'
const BASE_11_SEP = 'B'
const BASE_12_SEP = 'C'
const BASE_13_SEP = 'D'
const BASE_14_SEP = 'E'
const BASE_15_SEP = 'F'
const BASE_16_SEP = 'G'
const BASE_17_SEP = 'H'
const BASE_18_SEP = 'I'
const BASE_19_SEP = 'J'
const BASE_1_SEP = '1'
const BASE_20_SEP = 'K'
const BASE_21_SEP = 'L'
const BASE_22_SEP = 'M'
const BASE_23_SEP = 'N'
const BASE_24_SEP = 'O'
const BASE_25_SEP = 'P'
const BASE_26_SEP = 'Q'
const BASE_27_SEP = 'R'
const BASE_28_SEP = 'S'
const BASE_29_SEP = 'T'
const BASE_2_SEP = '2'
const BASE_30_SEP = 'U'
const BASE_31_SEP = 'V'
const BASE_32_SEP = 'W'
const BASE_33_SEP = 'X'
const BASE_34_SEP = 'Y'
const BASE_35_SEP = 'Z'
const BASE_36_SEP = '_'
const BASE_37_SEP = 'a'
const BASE_38_SEP = 'b'
const BASE_39_SEP = 'c'
const BASE_3_SEP = '3'
const BASE_40_SEP = 'd'
const BASE_41_SEP = 'e'
const BASE_42_SEP = 'f'
const BASE_43_SEP = 'g'
const BASE_44_SEP = 'h'
const BASE_45_SEP = 'i'
const BASE_46_SEP = 'j'
const BASE_47_SEP = 'k'
const BASE_48_SEP = 'l'
const BASE_49_SEP = 'm'
const BASE_4_SEP = '4'
const BASE_50_SEP = 'n'
const BASE_51_SEP = 'o'
const BASE_52_SEP = 'p'
const BASE_53_SEP = 'q'
const BASE_54_SEP = 'r'
const BASE_55_SEP = 's'
const BASE_56_SEP = 't'
const BASE_57_SEP = 'u'
const BASE_58_SEP = 'v'
const BASE_59_SEP = 'w'
const BASE_5_SEP = '5'
const BASE_60_SEP = 'x'
const BASE_61_SEP = 'y'
const BASE_62_SEP = 'z'
const BASE_63_SEP = '~'
const BASE_6_SEP = '6'
const BASE_7_SEP = '7'
const BASE_8_SEP = '8'
const BASE_9_SEP = '9'
const DEFAULT_ATOMS_ALLOC = 6
const FRAME_FORMAT_CARPET = FORMAT_GRID | FORMAT_SPACE | FORMAT_OP_LINES | FORMAT_NOSKIP | FORMAT_UNZIP
const FRAME_FORMAT_LINE = FORMAT_FRAME_LINES | FORMAT_HEADER_SPACE
const FRAME_FORMAT_LIST = FORMAT_OP_LINES | FORMAT_INDENT
const FRAME_FORMAT_TABLE = FORMAT_GRID | FORMAT_SPACE | FORMAT_OP_LINES
const (
FRAME_TERM = iota
)
const FRAME_TERM_SEP = '.'
const INT60LEN = 10
const INT60_ERROR = INT60_FULL
const INT60_FLAGS = uint64(15) << 60
const INT60_FULL uint64 = 1<<60 - 1
const INT60_INFINITY = 63 << (6 * 9)
const MASK24 uint64 = 16777215
const MAX_ATOMS_PER_OP = 1 << 20
const PREFIX_PRE4_SEP = '('
const PREFIX_PRE5_SEP = '['
const PREFIX_PRE6_SEP = '{'
const PREFIX_PRE7_SEP = '}'
const PREFIX_PRE8_SEP = ']'
const PREFIX_PRE9_SEP = ')'
const (
REDEF_PREV = iota
)
const REDEF_PREV_SEP = '`'
const RON_en_main int = 13
const RON_error int = 0
const RON_first_final int = 13
const RON_start int = 13
const SPACES22 = " "
FORMAT_CONDENSED = 1 << iota FORMAT_OP_LINES FORMAT_FRAMES FORMAT_TABLE
const SPACES88 = SPACES22 + SPACES22 + SPACES22 + SPACES22
const SPEC_EVENT_SEP = '@'
const SPEC_OBJECT_SEP = '#'
const SPEC_REF_SEP = ':'
const SPEC_TYPE_SEP = '*'
const TERM_HEADER_SEP = '!'
const TERM_QUERY_SEP = '?'
const TERM_RAW_SEP = ';'
const TERM_REDUCED_SEP = ','
const U2M_DEFAULT_SLICE_SIZE = 2
const U2M_SLAB_SIZE = 32 // 32*16=512 bytes
const UUID_DERIVED_SEP = '-'
const UUID_EVENT_CALENDAR_RECORD = 0
const UUID_EVENT_EPOCH_RECORD = 2
const UUID_EVENT_LOGICAL_RECORD = 1
const UUID_EVENT_SEP = '+'
const UUID_HASH_SEP = '%'
const UUID_NAME_ISBN = 1
const UUID_NAME_SEP = '$'
const UUID_NAME_TRANSCENDENT = 0
/ paste RON_UUID [368fd2fd] / use var2go [191338df]
const UUID_NAME_UPPER_BITS = uint64(UUID_NAME) << 60
const ZEROS10 = "0000000000"
Variables ¶
var ABC [128]uint8
var ATOM_PUNCT = []byte(">='^")
var BASE64 = string(BASE_PUNCT)
var BASE_PUNCT = []byte("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~")
var COMMENT_UUID = NEVER_UUID
var DIGIT_OFFSETS = [11]uint8{54, 48, 42, 36, 30, 24, 18, 12, 6, 0, 255}
var ERROR_UUID = NewNameUUID(INT60_ERROR, 0)
var FRAME_PUNCT = []byte(".")
var FRAME_TERM_ARR = [2]byte{FRAME_TERM_SEP, '\n'}
var IS_BASE [4]uint64
var MAX_BIT_GRAB uint64 = 1 << 20
var NEVER_UUID = NewNameUUID(INT60_INFINITY, 0)
var PREFIX_MASKS = [11]uint64{0, 1134907106097364992, 1152640029630136320, 1152917106560335872, 1152921435887370240, 1152921503533105152, 1152921504590069760, 1152921504606584832, 1152921504606842880, 1152921504606846912, 1152921504606846975}
var PREFIX_PUNCT = []byte("([{}])")
var RDTYPES map[UUID]ReducerMaker
var REDEF_PUNCT = []byte("`")
var REDUCER = OmniReducer{}
var SPEC_PUNCT = []byte("*#@:")
/ paste ABC [b42b01fa] / use abc2go [d743c810]
var TERM_PUNCT = []byte(";,!?")
var UUID_EVENT_CALENDAR_RECORD_SEP = BASE_PUNCT[0]
var UUID_EVENT_EPOCH_RECORD_SEP = BASE_PUNCT[2]
var UUID_EVENT_LOGICAL_RECORD_SEP = BASE_PUNCT[1]
var UUID_NAME_FLAG = ((uint64)(UUID_NAME)) << 60
var UUID_NAME_ISBN_SEP = BASE_PUNCT[1]
var UUID_NAME_TRANSCENDENT_SEP = BASE_PUNCT[0]
var UUID_PUNCT = []byte("$%+-")
var ZERO_UUID = NewNameUUID(0, 0)
var ZERO_UUID_ATOM = Atom(ZERO_UUID)
Functions ¶
func CalendarToRFC ¶
func CalendarToRFCString ¶
func DecodeCalendar ¶
func EncodeCalendar ¶
func EventComparator ¶
func EventComparatorDesc ¶
func FormatUUID ¶
func FormatZipInt ¶
func FormatZipUUID ¶
func Int60Prefix ¶
func RefComparator ¶
func RefComparatorDesc ¶
Types ¶
type Atom ¶
type Atom [2]uint64
An atom is a constant of a RON type: int, float, string or UUID
func NewFloatAtom ¶
func NewIntegerAtom ¶
func (Atom) Float ¶
We can't rely on standard floats cause they MUTATE THE VALUE. If 3.141592 is parsed then serialized, it becomes 3.141591(9) or something, that is entirely platform-dependent. Overall, floats are NOT commutative. Any floating arithmetic is highly discouraged inside CRDT type implementations.
type Batch ¶
type Batch []Frame
func ParseStringBatch ¶
func (*Batch) AppendFrame ¶
func (Batch) Compare ¶
Equal checks two batches for op-by-op equality (irrespectively of frame borders)
func (Batch) HasFullState ¶
type Checker ¶
Checker performs sanity checks on incoming data. Note that a Checker may accumulate data, e.g. keep a max timestamp seen.
type Comparator ¶
Compare two ops; >1 for a>b, <1 for a<b, 0 for equal.
type EmptyReducer ¶
type EmptyReducer struct { }
func (EmptyReducer) Features ¶
func (omni EmptyReducer) Features() int
func (EmptyReducer) Reduce ¶
func (r EmptyReducer) Reduce(inputs Batch) (frame Frame)
type Environment ¶
type Frame ¶
type Frame struct { Parser ParserState Serializer SerializerState // Frame body, raw bytes. Body []byte // contains filtered or unexported fields }
RON Frame is a vector of immutable RON ops. A frame is always positioned on some op (initially, the first one). In a sense, Frame is its own iterator: frame.Next(), returns true is the frame is re-positioned to the next op, false on error (EOF is an error too). That is made to minimize boilerplate as Frames are forwarded based on the frame header (the first op). Frame is not thread-safe; the underlying buffer is append-only, thus thread-safe.
func CreateFrame ¶
func MakeFormattedFrame ¶
func MakeQueryFrame ¶
func MakeStream ¶
func NewBufferFrame ¶
func NewFormattedFrame ¶
func NewOpFrame ¶
func NewStateHeader ¶
func NewStringFrame ¶
func ParseFrame ¶
func ParseFrameString ¶
func ParseStream ¶
func (*Frame) AddReducedOp ¶
func (*Frame) AppendBytes ¶
func (*Frame) AppendEmpty ¶
func (*Frame) AppendEmptyReducedOp ¶
func (*Frame) AppendFrame ¶
func (*Frame) AppendQueryHeader ¶
func (*Frame) AppendReduced ¶
func (*Frame) AppendReducedOpInt ¶
func (*Frame) AppendReducedOpUUID ¶
func (*Frame) AppendReducedRef ¶
func (*Frame) AppendSpecValuesTerm ¶
func (*Frame) AppendStateHeader ¶
func (*Frame) AppendStateHeaderValues ¶
func (Frame) GetInteger ¶
func (Frame) IsComplete ¶
Whether op parsing is complete (not always the case for the streaming mode)
func (Frame) IsFullState ¶
func (*Frame) Parse ¶
func (frame *Frame) Parse()
Parse consumes one op from data[], unless the buffer ends earlier. Fills atoms[]
func (*Frame) SkipHeader ¶
func (frame *Frame) SkipHeader()
func (Frame) Split ¶
overall, serialized batches are used in rare cases (delivery fails, cross-key transactions) hence, we don't care about performance that much still, may consider explicit-length formats at some point
func (Frame) Split2 ¶
Split returns two frames: one from the start to the current pos (exclusive), another from the current pos (incl) to the end. The right one is "stripped".
func (Frame) SplitInclusive ¶
type FrameHeap ¶
type FrameHeap struct {
// contains filtered or unexported fields
}
FrameHeap is an iterator heap - gives the minimum available element at every step. Useful for merge sort like algorithms.
func MakeFrameHeap ¶
func MakeFrameHeap(primary, secondary Comparator, size int) (ret FrameHeap)
type OmniReducer ¶
func NewOmniReducer ¶
func NewOmniReducer() (ret OmniReducer)
func (OmniReducer) AddType ¶
func (omni OmniReducer) AddType(id UUID, r Reducer)
func (OmniReducer) Features ¶
func (omni OmniReducer) Features() int
func (OmniReducer) Reduce ¶
func (omni OmniReducer) Reduce(ins Batch) Frame
Reduce picks a reducer function, performs all the sanity checks, creates the header, invokes the reducer, returns the result
type ParserState ¶
type ParserState struct {
// contains filtered or unexported fields
}
func (ParserState) IsFail ¶
func (state ParserState) IsFail() bool
func (ParserState) State ¶
func (ps ParserState) State() int
type Reducer ¶
Reducer is essentially a replicated data type. A reduction of the object's full op log produces its RON state. A reduction of a log segment produces a patch. A reduced frame has the same object id and, in most cases, type. Event id is the one of the last input frame. Complexity guarantees: max O(log N) (could be made to reduce 1mln single-op frames) Associative, commutative*, idempotent.
type ReducerMaker ¶
type ReducerMaker func() Reducer // FIXME params map[UUID]Atom - no free-form strings
type SerializerState ¶
type SerializerState struct {
Format uint
}
type StringMapper ¶
type UUID ¶
type UUID Atom
var CLOCK_CALENDAR UUID
var CLOCK_EPOCH UUID
var CLOCK_LAMPORT UUID
func NewEventUUID ¶
func NewHashUUID ¶
func NewNameUUID ¶
func NewRonUUID ¶
func ParseUUIDString ¶
func (UUID) EarlierThan ¶
func (UUID) IsTemplate ¶
func (UUID) IsTranscendentName ¶
type UUIDMultiMap ¶
type UUIDMultiMap struct {
// contains filtered or unexported fields
}
func MakeUUID2Map ¶
func MakeUUID2Map() UUIDMultiMap
func (*UUIDMultiMap) Add ¶
func (um *UUIDMultiMap) Add(key, value UUID)
func (UUIDMultiMap) Keys ¶
func (um UUIDMultiMap) Keys() []UUID
func (UUIDMultiMap) Len ¶
func (um UUIDMultiMap) Len() int
func (UUIDMultiMap) List ¶
func (um UUIDMultiMap) List(key UUID) []UUID
func (*UUIDMultiMap) Put ¶
func (um *UUIDMultiMap) Put(key UUID, values []UUID)
func (*UUIDMultiMap) Remove ¶
func (um *UUIDMultiMap) Remove(key UUID, value UUID)
func (UUIDMultiMap) Take ¶
func (um UUIDMultiMap) Take(key UUID) (ret []UUID)