Documentation
¶
Index ¶
- Variables
- type Object
- func (*Object) Descriptor() ([]byte, []int)deprecated
- func (x *Object) GetData() []byte
- func (x *Object) GetKey() []byte
- func (x *Object) GetNamespace() string
- func (x *Object) GetOwner() string
- func (x *Object) GetRegion() string
- func (x *Object) GetVersion() *Version
- func (*Object) ProtoMessage()
- func (x *Object) ProtoReflect() protoreflect.Message
- func (x *Object) Reset()
- func (x *Object) String() string
- func (o *Object) Tombstone() bool
- type Version
- func (*Version) Descriptor() ([]byte, []int)deprecated
- func (x *Version) GetParent() *Version
- func (x *Version) GetPid() uint64
- func (x *Version) GetRegion() string
- func (x *Version) GetTombstone() bool
- func (x *Version) GetVersion() uint64
- func (v *Version) IsLater(other *Version) bool
- func (v *Version) IsZero() bool
- func (*Version) ProtoMessage()
- func (x *Version) ProtoReflect() protoreflect.Message
- func (x *Version) Reset()
- func (x *Version) String() string
Constants ¶
This section is empty.
Variables ¶
var File_object_v1_object_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Object ¶
type Object struct {
// The object metadata that must be populated on both VersionVectors and Updates
Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // A unique key/id that represents the object across the namespace of the object type
Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` // The namespace of the object, used to disambiguate keys or different object types
Version *Version `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` // A version vector representing this objects current or latest version
Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` // The region code where the data originated
Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"` // The replica that created the object (identified as "pid:name" if name exists)
// The object data that is only populated on Updates.
Data []byte `protobuf:"bytes,10,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
An Object is a generic representation of a replicated piece of data. At the top level it contains enough metadata in order to detect changes during anti-entropy, specifically, given two objects, which is the later object (or does it need to be created or deleted). When used in VersionVectors only the metadata of the object is supplied. When passed via Updates, then the full data of the object is populated.
For research purposes, this anti-entropy mechanism tracks the region and owner of each object to determine provinence and global interactions. Because this is side channel information that may not necessarily be stored with the object data, it is recommended that an objects table be kept for fast lookups of object versions. Additionally, it is recommended that a history table be maintained locally so that Object versions can be rolled back to previous states where necessary.
func (*Object) Descriptor
deprecated
func (*Object) GetNamespace ¶
func (*Object) GetVersion ¶
func (*Object) ProtoMessage ¶
func (*Object) ProtoMessage()
func (*Object) ProtoReflect ¶
func (x *Object) ProtoReflect() protoreflect.Message
type Version ¶
type Version struct {
Pid uint64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` // Process ID - used to deconflict ties in the version number.
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` // Montonically increasing version number.
Region string `protobuf:"bytes,3,opt,name=region,proto3" json:"region,omitempty"` // The region where the change occurred to track multi-region handling.
Parent *Version `protobuf:"bytes,4,opt,name=parent,proto3" json:"parent,omitempty"` // In order to get a complete version history, identify the predessor; for compact data transfer parent should not be defined in parent version.
Tombstone bool `protobuf:"varint,5,opt,name=tombstone,proto3" json:"tombstone,omitempty"` // Set to true in order to mark the object as deleted
// contains filtered or unexported fields
}
Implements a geo-distributed version as a Lamport Scalar
func (*Version) Descriptor
deprecated
func (*Version) GetTombstone ¶
func (*Version) GetVersion ¶
func (*Version) IsLater ¶
IsLater returns true if the specified version is later than the other version. It returns false if the other version is later or equal to the specified version.
func (*Version) IsZero ¶
IsZero determines if the version is zero valued (e.g. the PID and Version are zero). Note that zero-valuation does not check parent or region.
func (*Version) ProtoMessage ¶
func (*Version) ProtoMessage()
func (*Version) ProtoReflect ¶
func (x *Version) ProtoReflect() protoreflect.Message