Documentation
¶
Index ¶
- Variables
- func DeltaMapping(partsFn message.PartitionsFunc) message.MappingFunc
- func MustViewSpecOfRow(key []byte, s *factable.Schema) factable.MaterializedViewSpec
- func NewSchemaKeySpace(etcdPath string, fns *factable.ExtractFns) *keyspace.KeySpace
- func ViewSpecOfRow(key []byte, s *factable.Schema) (factable.MaterializedViewSpec, error)
- type CommonConfig
- type DeltaEvent
- func (*DeltaEvent) Descriptor() ([]byte, []int)
- func (m *DeltaEvent) GetExtractor() string
- func (m *DeltaEvent) GetRowKey() []byte
- func (m *DeltaEvent) GetRowValue() []byte
- func (m *DeltaEvent) GetSeqNo() int64
- func (m *DeltaEvent) GetUUID() uuid.UUID
- func (m *DeltaEvent) Marshal() (dAtA []byte, err error)
- func (m *DeltaEvent) MarshalTo(dAtA []byte) (int, error)
- func (m *DeltaEvent) NewAcknowledgement(journal broker.Journal) message.Message
- func (*DeltaEvent) ProtoMessage()
- func (m *DeltaEvent) ProtoSize() (n int)
- func (m *DeltaEvent) Reset()
- func (m *DeltaEvent) SetUUID(uuid uuid.UUID)
- func (m *DeltaEvent) String() string
- func (m *DeltaEvent) Unmarshal(dAtA []byte) error
- func (m *DeltaEvent) ViewSpec(s *factable.Schema) (factable.MaterializedViewSpec, error)
- func (m *DeltaEvent) XXX_DiscardUnknown()
- func (m *DeltaEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *DeltaEvent) XXX_Merge(src proto.Message)
- func (m *DeltaEvent) XXX_Size() int
- func (m *DeltaEvent) XXX_Unmarshal(b []byte) error
- type SchemaService
- type Transactions
- func (m Transactions) Apply(e DeltaEvent) (committed []DeltaEvent, err error)
- func (*Transactions) Descriptor() ([]byte, []int)
- func (m *Transactions) GetExtractor() map[string]Transactions_State
- func (m *Transactions) Marshal() (dAtA []byte, err error)
- func (m *Transactions) MarshalTo(dAtA []byte) (int, error)
- func (*Transactions) ProtoMessage()
- func (m *Transactions) ProtoSize() (n int)
- func (m *Transactions) Reset()
- func (m *Transactions) String() string
- func (m *Transactions) Unmarshal(dAtA []byte) error
- func (m *Transactions) XXX_DiscardUnknown()
- func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Transactions) XXX_Merge(src proto.Message)
- func (m *Transactions) XXX_Size() int
- func (m *Transactions) XXX_Unmarshal(b []byte) error
- type Transactions_State
- func (*Transactions_State) Descriptor() ([]byte, []int)
- func (m *Transactions_State) GetEvents() []DeltaEvent
- func (m *Transactions_State) Marshal() (dAtA []byte, err error)
- func (m *Transactions_State) MarshalTo(dAtA []byte) (int, error)
- func (*Transactions_State) ProtoMessage()
- func (m *Transactions_State) ProtoSize() (n int)
- func (m *Transactions_State) Reset()
- func (m *Transactions_State) String() string
- func (m *Transactions_State) Unmarshal(dAtA []byte) error
- func (m *Transactions_State) XXX_DiscardUnknown()
- func (m *Transactions_State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Transactions_State) XXX_Merge(src proto.Message)
- func (m *Transactions_State) XXX_Size() int
- func (m *Transactions_State) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthDeltas = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDeltas = fmt.Errorf("proto: integer overflow") )
var ErrViewNotFound = errors.New("view not found")
ErrViewNotFound indicates the MVTag is not in the Schema.
Functions ¶
func DeltaMapping ¶
func DeltaMapping(partsFn message.PartitionsFunc) message.MappingFunc
DeltaMapping returns a ModuloMapping of DeltaEvent on RowKey.
func MustViewSpecOfRow ¶
func MustViewSpecOfRow(key []byte, s *factable.Schema) factable.MaterializedViewSpec
MustViewSpecOfRow maps a row key to its MaterializedViewSpec, and panics on error.
func NewSchemaKeySpace ¶
func NewSchemaKeySpace(etcdPath string, fns *factable.ExtractFns) *keyspace.KeySpace
NewSchemaKeySpace returns a KeySpace over the singular shared SchemaSpec key.
func ViewSpecOfRow ¶
ViewSpecOfRow maps a row key to its MaterializedViewSpec.
Types ¶
type CommonConfig ¶
type CommonConfig struct { Deltas string `long:"deltas" description:"Journal label selector to which row delta events are published"` Instance string `long:"instance" description:"Name of the Factable release instance"` SchemaKey string `long:"schema" description:"Etcd key of shared SchemaSpec configuration"` TxnConcurrency uint `long:"txnConcurrency" default:"0" description:"Concurrency of consumer transactions. 0 defaults to GOMAXPROCS."` }
CommonConfig shared between the VTable and Extractor consumers.
func (CommonConfig) DeltasSelector ¶
func (cfg CommonConfig) DeltasSelector() pb.LabelSelector
func (CommonConfig) Validate ¶
func (cfg CommonConfig) Validate() error
type DeltaEvent ¶
type DeltaEvent struct { // Extractor ID emitting the DeltaEvent. Often this will be a ShardID. // Backfill jobs use a unique and per-job ID. Extractor string `protobuf:"bytes,1,opt,name=extractor,proto3" json:"extractor,omitempty"` // Sequence number of the DeltaEvent, with respect to the |combiner|. // |seq_no| is monotonically increasing for row DeltaEvents. Commit // DeltaEvents use the |seq_no| of the last row DeltaEvent. SeqNo int64 `protobuf:"varint,2,opt,name=seq_no,json=seqNo,proto3" json:"seq_no,omitempty"` RowKey []byte `protobuf:"bytes,3,opt,name=row_key,json=rowKey,proto3" json:"row_key,omitempty"` RowValue []byte `protobuf:"bytes,4,opt,name=row_value,json=rowValue,proto3" json:"row_value,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeltaEvent) Descriptor ¶
func (*DeltaEvent) Descriptor() ([]byte, []int)
func (*DeltaEvent) GetExtractor ¶
func (m *DeltaEvent) GetExtractor() string
func (*DeltaEvent) GetRowKey ¶
func (m *DeltaEvent) GetRowKey() []byte
func (*DeltaEvent) GetRowValue ¶
func (m *DeltaEvent) GetRowValue() []byte
func (*DeltaEvent) GetSeqNo ¶
func (m *DeltaEvent) GetSeqNo() int64
func (*DeltaEvent) GetUUID ¶
func (m *DeltaEvent) GetUUID() uuid.UUID
Keep it simple. Do not opt into exactly-once just yet. Do this later.
func (*DeltaEvent) Marshal ¶
func (m *DeltaEvent) Marshal() (dAtA []byte, err error)
func (*DeltaEvent) NewAcknowledgement ¶
func (m *DeltaEvent) NewAcknowledgement(journal broker.Journal) message.Message
func (*DeltaEvent) ProtoMessage ¶
func (*DeltaEvent) ProtoMessage()
func (*DeltaEvent) ProtoSize ¶
func (m *DeltaEvent) ProtoSize() (n int)
func (*DeltaEvent) Reset ¶
func (m *DeltaEvent) Reset()
func (*DeltaEvent) SetUUID ¶
func (m *DeltaEvent) SetUUID(uuid uuid.UUID)
func (*DeltaEvent) String ¶
func (m *DeltaEvent) String() string
func (*DeltaEvent) Unmarshal ¶
func (m *DeltaEvent) Unmarshal(dAtA []byte) error
func (*DeltaEvent) ViewSpec ¶
func (m *DeltaEvent) ViewSpec(s *factable.Schema) (factable.MaterializedViewSpec, error)
ViewSpec maps the aggregated DeltaEvent to its MaterializedViewSpec.
func (*DeltaEvent) XXX_DiscardUnknown ¶
func (m *DeltaEvent) XXX_DiscardUnknown()
func (*DeltaEvent) XXX_Marshal ¶
func (m *DeltaEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DeltaEvent) XXX_Merge ¶
func (dst *DeltaEvent) XXX_Merge(src proto.Message)
func (*DeltaEvent) XXX_Size ¶
func (m *DeltaEvent) XXX_Size() int
func (*DeltaEvent) XXX_Unmarshal ¶
func (m *DeltaEvent) XXX_Unmarshal(b []byte) error
type SchemaService ¶
type SchemaService struct { Config CommonConfig KS *keyspace.KeySpace Etcd clientv3.KV ExtractFns *factable.ExtractFns }
SchemaService implements factable.SchemaServer, providing APIs over the shared SchemaSpec. It additionally provides a Schema accessor backed by a KeySpace.
func (*SchemaService) GetSchema ¶
func (ss *SchemaService) GetSchema(ctx context.Context, _ *empty.Empty) (*factable.GetSchemaResponse, error)
func (*SchemaService) Schema ¶
func (ss *SchemaService) Schema() (out *factable.Schema)
func (*SchemaService) UpdateSchema ¶
func (ss *SchemaService) UpdateSchema(ctx context.Context, req *factable.UpdateSchemaRequest) (*empty.Empty, error)
type Transactions ¶
type Transactions struct { // Extractor indexes states on Extractor ShardID. Extractor map[string]Transactions_State `` /* 135-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Transactions manages per-extractor transactions of DeltaEvents.
func (Transactions) Apply ¶
func (m Transactions) Apply(e DeltaEvent) (committed []DeltaEvent, err error)
func (*Transactions) Descriptor ¶
func (*Transactions) Descriptor() ([]byte, []int)
func (*Transactions) GetExtractor ¶
func (m *Transactions) GetExtractor() map[string]Transactions_State
func (*Transactions) Marshal ¶
func (m *Transactions) Marshal() (dAtA []byte, err error)
func (*Transactions) ProtoMessage ¶
func (*Transactions) ProtoMessage()
func (*Transactions) ProtoSize ¶
func (m *Transactions) ProtoSize() (n int)
func (*Transactions) Reset ¶
func (m *Transactions) Reset()
func (*Transactions) String ¶
func (m *Transactions) String() string
func (*Transactions) Unmarshal ¶
func (m *Transactions) Unmarshal(dAtA []byte) error
func (*Transactions) XXX_DiscardUnknown ¶
func (m *Transactions) XXX_DiscardUnknown()
func (*Transactions) XXX_Marshal ¶
func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transactions) XXX_Merge ¶
func (dst *Transactions) XXX_Merge(src proto.Message)
func (*Transactions) XXX_Size ¶
func (m *Transactions) XXX_Size() int
func (*Transactions) XXX_Unmarshal ¶
func (m *Transactions) XXX_Unmarshal(b []byte) error
type Transactions_State ¶
type Transactions_State struct { Events []DeltaEvent `protobuf:"bytes,1,rep,name=events" json:"events"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Transaction state of a single Extractor or back-fill loader.
func (*Transactions_State) Descriptor ¶
func (*Transactions_State) Descriptor() ([]byte, []int)
func (*Transactions_State) GetEvents ¶
func (m *Transactions_State) GetEvents() []DeltaEvent
func (*Transactions_State) Marshal ¶
func (m *Transactions_State) Marshal() (dAtA []byte, err error)
func (*Transactions_State) MarshalTo ¶
func (m *Transactions_State) MarshalTo(dAtA []byte) (int, error)
func (*Transactions_State) ProtoMessage ¶
func (*Transactions_State) ProtoMessage()
func (*Transactions_State) ProtoSize ¶
func (m *Transactions_State) ProtoSize() (n int)
func (*Transactions_State) Reset ¶
func (m *Transactions_State) Reset()
func (*Transactions_State) String ¶
func (m *Transactions_State) String() string
func (*Transactions_State) Unmarshal ¶
func (m *Transactions_State) Unmarshal(dAtA []byte) error
func (*Transactions_State) XXX_DiscardUnknown ¶
func (m *Transactions_State) XXX_DiscardUnknown()
func (*Transactions_State) XXX_Marshal ¶
func (m *Transactions_State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transactions_State) XXX_Merge ¶
func (dst *Transactions_State) XXX_Merge(src proto.Message)
func (*Transactions_State) XXX_Size ¶
func (m *Transactions_State) XXX_Size() int
func (*Transactions_State) XXX_Unmarshal ¶
func (m *Transactions_State) XXX_Unmarshal(b []byte) error