factable

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DimensionType_name = map[int32]string{
	0: "INVALID_DIM_TYPE",
	1: "VARINT",
	3: "FLOAT",
	4: "STRING",
	5: "TIMESTAMP",
}
View Source
var DimensionType_value = map[string]int32{
	"INVALID_DIM_TYPE": 0,
	"VARINT":           1,
	"FLOAT":            3,
	"STRING":           4,
	"TIMESTAMP":        5,
}
View Source
var ErrResultSetTooLarge = errors.New("result set is too large for buffering")
View Source
var KVIteratorDone = errors.New("iterator done")

KVIteratorDone is returned by Next when the sequence is complete.

View Source
var MetricType_name = map[int32]string{
	0: "INVALID_METRIC_TYPE",
	1: "VARINT_SUM",
	2: "VARINT_GAUGE",
	3: "FLOAT_SUM",
	4: "STRING_HLL",
}
View Source
var MetricType_value = map[string]int32{
	"INVALID_METRIC_TYPE": 0,
	"VARINT_SUM":          1,
	"VARINT_GAUGE":        2,
	"FLOAT_SUM":           3,
	"STRING_HLL":          4,
}

Functions

func MarshalBinaryKeyValue

func MarshalBinaryKeyValue(bw *bufio.Writer, key, value []byte) (err error)

MarshalBinaryKeyValue marshals the row defined by |key| & |value| into the bufio.Writer, using the same wire encoding as NewStreamIterator.

func NewCombinerIterator

func NewCombinerIterator(it KVIterator, schema Schema, input ResolvedView, query ResolvedQuery) (*combIter, error)

NewCombinerIterator runs the |input| iterator through a Combiner represented by the |inputShape| and |query|. The returned iterator steps over keys & values emitted by the Combiner, driving the |input| iterator forward as required.

func NewHexIterator

func NewHexIterator(br *bufio.Reader) *hexIter

NewHexIterator returns a KVIterator which wraps a bufio.Reader of hex-encoded lines of keys & values, eg "HEX(key)\tHEX(value)\n".

func NewMergeIterator

func NewMergeIterator(iterators ...KVIterator) *mergeIter

NewMergeIterator accepts a variable number of KVIterators, and returns a merging iterator which produces the combined sequence of keys across all iterators. If all input KVIterators enumerate Keys in sorted order, than the sequence produced by NewMergeIterator is also sorted. |iterators| must be non-empty or NewMergeIterator panics.

func NewSliceIterator

func NewSliceIterator(s ...[2][]byte) *sliceIter

NewSliceIterator returns a KVIterator which ranges over the input slice |s|. The input slice is directly referenced by the iterator and must not change.

func NewSortingIterator

func NewSortingIterator(it KVIterator, arenaSize, maxArenas int) *sortIter

NewSortingIterator returns an KVIterator which, on its first call to Next, fully consumes the |input| KVIterator sequence and sorts it. Subsequent invocations of Next step over the sorted range. The iterator uses a block- based parallel sort-and-merge strategy: input keys are buffered into multiple blocks of size |arenaSize|, sorted in parallel, and finally merged. Up to |maxArenas| blocks will be used to buffer input: if more would be required, ErrResultSetTooLarge is returned.

func NewStreamIterator

func NewStreamIterator(recvFn func(interface{}) error) *streamIter

NewStreamIterator returns a KVIterator which wraps a stream. |recvFn| reads the next *QueryResponse of the stream, and should be initialized with a Factable_QueryClient instance's RecvMsg function closure.

func PackKey

func PackKey(dims ...interface{}) []byte

PackKey encodes a key having the given dimensions. It's primarily useful in the construction of test fixtures.

func PackValue

func PackValue(aggs ...interface{}) []byte

PackValue encodes a value having the given aggregates. It's primarily useful in the construction of test fixtures.

func RegisterQueryServer

func RegisterQueryServer(s *grpc.Server, srv QueryServer)

func RegisterSchemaServer

func RegisterSchemaServer(s *grpc.Server, srv SchemaServer)

func ValidateSchemaTransition

func ValidateSchemaTransition(from, to Schema) (err error)

ValidateSchemaTransition returns an error if the transition from |from| to |to| would alter an immutable property of the Schema.

Types

type Aggregate

type Aggregate interface{}

Aggregate captures the inner state of a partially-reduced Metric. For example, a Metric computing an Average might Flatten into a float64, but internally would retain both the numerator and denominator as its Aggregate, enabling future reduction with other Aggregate instances.

func BuildStrHLL

func BuildStrHLL(strs ...string) Aggregate

BuildStrHLL constructs a HLL Aggregate initialized with the given strings. It's primarily useful in the construction of test fixtures.

type Combiner

type Combiner struct {
	Schema
	// contains filtered or unexported fields
}

Combiner combines ordered keys and values of a relation on behalf of a QuerySpec. It applies query filters, identifies opportunities to seek forward in the input key space due to current filters, and produces grouped output keys and aggregates.

func NewCombiner

func NewCombiner(schema Schema, input ResolvedView, query ResolvedQuery) (*Combiner, error)

NewCombiner returns a Combiner over rows having the |input| ViewSpec, and which emits rows & aggregates according to the Query ViewSpec and applicable filters. It returns an error if the |input| ViewSpec or |query| are not well-formed with respect to each other, and to the Schema.

func (*Combiner) Aggregates

func (cb *Combiner) Aggregates() []Aggregate

Aggregates returns the last Flushed Aggregates.

func (*Combiner) Combine

func (cb *Combiner) Combine(key, value []byte) (flushed, seek bool, err error)

Combine folds the ordered input key & value into the Combiner's state. |seek| is returned if the Combiner did not accept |key|, and will not process further input keys less than the key returned by Seek(). |flushed| is returned if the Combiner determined that a previous grouped key has been fully aggregated, and Flushed it. Only one of |flushed| or |seek| will be set.

func (*Combiner) Flush

func (cb *Combiner) Flush() bool

Flush the key and aggregates currently being grouped. It returns false iff the Combiner has no current key & aggregates to be flushed (eg, because the Combiner is in an initialized state, or every key supplied to Combine was filtered).

func (*Combiner) Key

func (cb *Combiner) Key() []byte

Key returns the last Flushed key.

func (*Combiner) Seek

func (cb *Combiner) Seek(b []byte) []byte

Seek appends the next potential key or key prefix which will be considered by the Combiner to |b|. If Seek instead returns nil, then the valid input range has been exhausted and iteration may halt.

func (*Combiner) Value

func (cb *Combiner) Value(b []byte) []byte

Value returns the last Flushed value, which is appended to |b|.

type DimTag

type DimTag uint64

DimTag uniquely identifies a DimensionSpec.

const DimMVTag DimTag = 0

DimMVTag is a non-validating DimTag which stands-in for the MVTag encoded as the first field of every row key serialized in a VTable.

type DimensionSpec

type DimensionSpec struct {
	// Short, unique name of the Dimension.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Type of the Dimension. Immutable.
	Type DimensionType `protobuf:"varint,2,opt,name=type,proto3,enum=factable.DimensionType" json:"type,omitempty"`
	// Longer, free-form description of the Dimension.
	Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"`
	// Unique tag of the dimension.
	Tag DimTag `protobuf:"varint,4,opt,name=tag,proto3,casttype=DimTag" json:"tag,omitempty"`
}

DimensionSpec defines a Dimension which may be extracted from a RelationRow.

func (*DimensionSpec) Descriptor

func (*DimensionSpec) Descriptor() ([]byte, []int)

func (*DimensionSpec) ProtoMessage

func (*DimensionSpec) ProtoMessage()

func (*DimensionSpec) ProtoSize

func (m *DimensionSpec) ProtoSize() (n int)

func (*DimensionSpec) Reset

func (m *DimensionSpec) Reset()

func (*DimensionSpec) String

func (m *DimensionSpec) String() string

func (*DimensionSpec) XXX_DiscardUnknown

func (m *DimensionSpec) XXX_DiscardUnknown()

func (*DimensionSpec) XXX_Marshal

func (m *DimensionSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DimensionSpec) XXX_Merge

func (m *DimensionSpec) XXX_Merge(src proto.Message)

func (*DimensionSpec) XXX_Size

func (m *DimensionSpec) XXX_Size() int

func (*DimensionSpec) XXX_Unmarshal

func (m *DimensionSpec) XXX_Unmarshal(b []byte) error

type DimensionType

type DimensionType int32
const (
	DimensionType_INVALID_DIM_TYPE DimensionType = 0
	DimensionType_VARINT           DimensionType = 1
	DimensionType_FLOAT            DimensionType = 3
	DimensionType_STRING           DimensionType = 4
	DimensionType_TIMESTAMP        DimensionType = 5
)

func (DimensionType) EnumDescriptor

func (DimensionType) EnumDescriptor() ([]byte, []int)

func (DimensionType) MarshalYAML

func (x DimensionType) MarshalYAML() (interface{}, error)

MarshalYAML returns the string DimensionType name.

func (DimensionType) String

func (x DimensionType) String() string

func (*DimensionType) UnmarshalYAML

func (x *DimensionType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML decodes the string DimensionType name.

type ExecuteQueryRequest

type ExecuteQueryRequest struct {
	// Header attached by a proxy-ing peer. Not directly set by clients.
	Header *protocol.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// Shard to query. Set iff |header| is also set
	// TODO (chris): if this is go.gazette.dev/core/consumer.ShardID instead of a string
	// the .pb.go file is not valid.
	Shard go_gazette_dev_core_consumer_protocol.ShardID `protobuf:"bytes,2,opt,name=shard,proto3,casttype=go.gazette.dev/core/consumer/protocol.ShardID" json:"shard,omitempty"`
	// Query specification.
	Query ResolvedQuery `protobuf:"bytes,3,opt,name=query,proto3" json:"query"`
}

func (*ExecuteQueryRequest) Descriptor

func (*ExecuteQueryRequest) Descriptor() ([]byte, []int)

func (*ExecuteQueryRequest) ProtoMessage

func (*ExecuteQueryRequest) ProtoMessage()

func (*ExecuteQueryRequest) ProtoSize

func (m *ExecuteQueryRequest) ProtoSize() (n int)

func (*ExecuteQueryRequest) Reset

func (m *ExecuteQueryRequest) Reset()

func (*ExecuteQueryRequest) String

func (m *ExecuteQueryRequest) String() string

func (*ExecuteQueryRequest) Validate

func (m *ExecuteQueryRequest) Validate() error

Validate returns an error if the QueryRequest is malformed.

func (*ExecuteQueryRequest) XXX_DiscardUnknown

func (m *ExecuteQueryRequest) XXX_DiscardUnknown()

func (*ExecuteQueryRequest) XXX_Marshal

func (m *ExecuteQueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ExecuteQueryRequest) XXX_Merge

func (m *ExecuteQueryRequest) XXX_Merge(src proto.Message)

func (*ExecuteQueryRequest) XXX_Size

func (m *ExecuteQueryRequest) XXX_Size() int

func (*ExecuteQueryRequest) XXX_Unmarshal

func (m *ExecuteQueryRequest) XXX_Unmarshal(b []byte) error

type ExtractFns

type ExtractFns struct {
	// NewMessage supplies a user Message instance for the input JournalSpec.
	NewMessage func(*pb.JournalSpec) (message.Message, error)
	// Mapping of decoded messages to zero or more RelationRows.
	Mapping map[MapTag]func(message.Envelope) []RelationRow
	// Dimension extractors for each DimensionType.
	// Registered tags must be non-overlapping.
	Int    map[DimTag]func(r RelationRow) int64
	Float  map[DimTag]func(r RelationRow) float64
	String map[DimTag]func(r RelationRow) string
	Time   map[DimTag]func(r RelationRow) time.Time
}

ExtractFns are user-defined functions which map a message to InputRecords, or InputRecords to an extracted Dimension. Each extractor is keyed by its corresponding configured tag. The configured dimension type of the tag must match that of the extractor registered herein.

type Field

type Field interface{}

Field is a simple data type (eg, int64, float64, time.Time, string). A Dimension is always a Field, as is an Aggregate which has been flattened.

func Flatten

func Flatten(agg Aggregate) Field

Flatten Aggregate into a corresponding simple Field type.

type GetSchemaResponse

type GetSchemaResponse struct {
	// Name of this Factable release instance.
	Instance string `protobuf:"bytes,3,opt,name=instance,proto3" json:"instance,omitempty"`
	// ModRevision of the current SchemaSpec
	ModRevision int64 `protobuf:"varint,1,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"`
	// Current value of the SchemaSpec. Zero-valued if |mod_revision| is zero.
	Spec SchemaSpec `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec"`
	// LabelSelector over Extractor output / VTable input "delta" partitions.
	DeltaPartitions protocol.LabelSelector `protobuf:"bytes,4,opt,name=delta_partitions,json=deltaPartitions,proto3" json:"delta_partitions"`
}

GetSchemaResponse is the response of the GetSchema RPC.

func (*GetSchemaResponse) Descriptor

func (*GetSchemaResponse) Descriptor() ([]byte, []int)

func (*GetSchemaResponse) ProtoMessage

func (*GetSchemaResponse) ProtoMessage()

func (*GetSchemaResponse) ProtoSize

func (m *GetSchemaResponse) ProtoSize() (n int)

func (*GetSchemaResponse) Reset

func (m *GetSchemaResponse) Reset()

func (*GetSchemaResponse) String

func (m *GetSchemaResponse) String() string

func (*GetSchemaResponse) XXX_DiscardUnknown

func (m *GetSchemaResponse) XXX_DiscardUnknown()

func (*GetSchemaResponse) XXX_Marshal

func (m *GetSchemaResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetSchemaResponse) XXX_Merge

func (m *GetSchemaResponse) XXX_Merge(src proto.Message)

func (*GetSchemaResponse) XXX_Size

func (m *GetSchemaResponse) XXX_Size() int

func (*GetSchemaResponse) XXX_Unmarshal

func (m *GetSchemaResponse) XXX_Unmarshal(b []byte) error

type HexEncoder

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

func NewHexEncoder

func NewHexEncoder(bw *bufio.Writer) *HexEncoder

NewHexEncoder returns a HexEncoder which encodes hexadecimal keys & values to |w|. See also NewHexIterator.

func (*HexEncoder) Encode

func (e *HexEncoder) Encode(key, value []byte) error

type KVIterator

type KVIterator interface {
	// Next returns the next |key| and |value| of the KVIterator. It returns
	// KVIteratorDone if no items remain in the sequence, or any encountered
	// error (which also invalidates the iterator). The returned |key| and
	// |value| may be retained only until the next call to Next.
	Next() (key, value []byte, err error)
	// Close the KVIterator, releasing associated resources.
	Close() error
}

KVIterator is an iterator over keys and their values.

type KVIteratorSeeker

type KVIteratorSeeker interface {
	Seek(key []byte)
}

KVIteratorSeeker is an optional interface of KVIterator which will seek to |key|, which must be lexicographically greater-than the last returned key. If the sequence ends prior to the sought |key|, a subsequent Next will return KVIteratorDone.

type MVTag

type MVTag uint64

MVTag uniquely identifies a MaterializedViewSpec.

type MapTag

type MapTag uint64

MapTag uniquely identifies a MappingSpec.

type MappingSpec

type MappingSpec struct {
	// Short, unique name of the Mapping.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Longer, free-form description of the Mapping.
	Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"`
	// Unique tag of the Mapping.
	Tag MapTag `protobuf:"varint,3,opt,name=tag,proto3,casttype=MapTag" json:"tag,omitempty"`
}

MappingSpec defines a Mapping of input Messages to InputRecords. In many cases, Relations will opt to use an identity Mapping. For events having de-normalized & nested event structures, Mappings provide a means to "unpack" into multiple normalized RelationRows. For example a "purchase" event having several product SKUs might map to a RelationRow{purchase, SKU} tuple for each purchased product.

func (*MappingSpec) Descriptor

func (*MappingSpec) Descriptor() ([]byte, []int)

func (*MappingSpec) ProtoMessage

func (*MappingSpec) ProtoMessage()

func (*MappingSpec) ProtoSize

func (m *MappingSpec) ProtoSize() (n int)

func (*MappingSpec) Reset

func (m *MappingSpec) Reset()

func (*MappingSpec) String

func (m *MappingSpec) String() string

func (*MappingSpec) XXX_DiscardUnknown

func (m *MappingSpec) XXX_DiscardUnknown()

func (*MappingSpec) XXX_Marshal

func (m *MappingSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MappingSpec) XXX_Merge

func (m *MappingSpec) XXX_Merge(src proto.Message)

func (*MappingSpec) XXX_Size

func (m *MappingSpec) XXX_Size() int

func (*MappingSpec) XXX_Unmarshal

func (m *MappingSpec) XXX_Unmarshal(b []byte) error

type MaterializedViewSpec

type MaterializedViewSpec struct {
	// Short, unique name of the MaterializedView.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Relation which this view materializes.
	Relation string `protobuf:"bytes,2,opt,name=relation,proto3" json:"relation,omitempty"`
	// View materialized by the MaterializedView.
	View ViewSpec `protobuf:"bytes,3,opt,name=view,proto3" json:"view"`
	// Longer, free-form description of the MaterializedView.
	Desc      string                          `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"`
	Retention *MaterializedViewSpec_Retention `protobuf:"bytes,5,opt,name=retention,proto3" json:"retention,omitempty"`
	// Unique tag of the MaterializedView.
	Tag MVTag `protobuf:"varint,6,opt,name=tag,proto3,casttype=MVTag" json:"tag,omitempty"`
	// Resolved RelTag. Immutable.
	RelTag RelTag `protobuf:"varint,7,opt,name=rel_tag,json=relTag,proto3,casttype=RelTag" json:"rel_tag,omitempty" yaml:",omitempty"`
	// Resolution of the View. Immutable.
	ResolvedView ResolvedView `protobuf:"bytes,8,opt,name=resolved_view,json=resolvedView,proto3" json:"resolved_view" yaml:",omitempty"`
}

MaterializedViewSpec defines a materialization of a ViewSpec. Its Metrics are continuously aggregated as RelationRows are processed, and the total storage commitment is limited to the cardinality of the View Dimensions.

func (*MaterializedViewSpec) Descriptor

func (*MaterializedViewSpec) Descriptor() ([]byte, []int)

func (*MaterializedViewSpec) ProtoMessage

func (*MaterializedViewSpec) ProtoMessage()

func (*MaterializedViewSpec) ProtoSize

func (m *MaterializedViewSpec) ProtoSize() (n int)

func (*MaterializedViewSpec) Reset

func (m *MaterializedViewSpec) Reset()

func (*MaterializedViewSpec) String

func (m *MaterializedViewSpec) String() string

func (*MaterializedViewSpec) XXX_DiscardUnknown

func (m *MaterializedViewSpec) XXX_DiscardUnknown()

func (*MaterializedViewSpec) XXX_Marshal

func (m *MaterializedViewSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MaterializedViewSpec) XXX_Merge

func (m *MaterializedViewSpec) XXX_Merge(src proto.Message)

func (*MaterializedViewSpec) XXX_Size

func (m *MaterializedViewSpec) XXX_Size() int

func (*MaterializedViewSpec) XXX_Unmarshal

func (m *MaterializedViewSpec) XXX_Unmarshal(b []byte) error

type MaterializedViewSpec_Retention

type MaterializedViewSpec_Retention struct {
	// Duration after which a row is eligible for removal.
	RemoveAfter time.Duration `protobuf:"bytes,1,opt,name=remove_after,json=removeAfter,proto3,stdduration" json:"remove_after"`
	// Dimension, which must be part of the MaterializedView and of type
	// Timestamp, to which |remove_after| is added to determine the effective
	// removal horizon.
	RelativeTo string `protobuf:"bytes,2,opt,name=relative_to,json=relativeTo,proto3" json:"relative_to,omitempty"`
	// Resolved DimTag of |relative_to|.
	RelativeToTag DimTag `` /* 137-byte string literal not displayed */
}

Optional retention of MaterializedView rows.

func (*MaterializedViewSpec_Retention) Descriptor

func (*MaterializedViewSpec_Retention) Descriptor() ([]byte, []int)

func (*MaterializedViewSpec_Retention) ProtoMessage

func (*MaterializedViewSpec_Retention) ProtoMessage()

func (*MaterializedViewSpec_Retention) ProtoSize

func (m *MaterializedViewSpec_Retention) ProtoSize() (n int)

func (*MaterializedViewSpec_Retention) Reset

func (m *MaterializedViewSpec_Retention) Reset()

func (*MaterializedViewSpec_Retention) String

func (*MaterializedViewSpec_Retention) XXX_DiscardUnknown

func (m *MaterializedViewSpec_Retention) XXX_DiscardUnknown()

func (*MaterializedViewSpec_Retention) XXX_Marshal

func (m *MaterializedViewSpec_Retention) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MaterializedViewSpec_Retention) XXX_Merge

func (m *MaterializedViewSpec_Retention) XXX_Merge(src proto.Message)

func (*MaterializedViewSpec_Retention) XXX_Size

func (m *MaterializedViewSpec_Retention) XXX_Size() int

func (*MaterializedViewSpec_Retention) XXX_Unmarshal

func (m *MaterializedViewSpec_Retention) XXX_Unmarshal(b []byte) error

type MetTag

type MetTag uint64

MetTag uniquely identifies a MetricSpec.

type MetricSpec

type MetricSpec struct {
	// Short, unique name of the Metric.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Dimension from which the Metric is extracted.
	Dimension string `protobuf:"bytes,2,opt,name=dimension,proto3" json:"dimension,omitempty"`
	// Type of the Metric. Immutable.
	Type MetricType `protobuf:"varint,3,opt,name=type,proto3,enum=factable.MetricType" json:"type,omitempty"`
	// Longer, free-form description of the Metric.
	Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"`
	// Unique tag of the Metric.
	Tag MetTag `protobuf:"varint,5,opt,name=tag,proto3,casttype=MetTag" json:"tag,omitempty"`
	// Resolved DimTag of |dimension|. Immutable.
	DimTag DimTag `protobuf:"varint,6,opt,name=dim_tag,json=dimTag,proto3,casttype=DimTag" json:"dim_tag,omitempty" yaml:",omitempty"`
}

MetricSpec defines a Metric which may be derived from a specified Dimension.

func (*MetricSpec) Descriptor

func (*MetricSpec) Descriptor() ([]byte, []int)

func (*MetricSpec) ProtoMessage

func (*MetricSpec) ProtoMessage()

func (*MetricSpec) ProtoSize

func (m *MetricSpec) ProtoSize() (n int)

func (*MetricSpec) Reset

func (m *MetricSpec) Reset()

func (*MetricSpec) String

func (m *MetricSpec) String() string

func (*MetricSpec) XXX_DiscardUnknown

func (m *MetricSpec) XXX_DiscardUnknown()

func (*MetricSpec) XXX_Marshal

func (m *MetricSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MetricSpec) XXX_Merge

func (m *MetricSpec) XXX_Merge(src proto.Message)

func (*MetricSpec) XXX_Size

func (m *MetricSpec) XXX_Size() int

func (*MetricSpec) XXX_Unmarshal

func (m *MetricSpec) XXX_Unmarshal(b []byte) error

type MetricType

type MetricType int32
const (
	MetricType_INVALID_METRIC_TYPE MetricType = 0
	MetricType_VARINT_SUM          MetricType = 1
	MetricType_VARINT_GAUGE        MetricType = 2
	MetricType_FLOAT_SUM           MetricType = 3
	MetricType_STRING_HLL          MetricType = 4
)

func (MetricType) EnumDescriptor

func (MetricType) EnumDescriptor() ([]byte, []int)

func (MetricType) MarshalYAML

func (x MetricType) MarshalYAML() (interface{}, error)

MarshalYAML returns the string MetricType name.

func (MetricType) String

func (x MetricType) String() string

func (*MetricType) UnmarshalYAML

func (x *MetricType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML decodes the string MetricType name.

type QueryClient

type QueryClient interface {
	// ResolveQuery maps a QuerySpec into a validated ResolvedQuery,
	// under the current server schema.
	ResolveQuery(ctx context.Context, in *QuerySpec, opts ...grpc.CallOption) (*ResolvedQuery, error)
	// ExecuteResolvedQuery against one or all Shards.
	ExecuteQuery(ctx context.Context, in *ExecuteQueryRequest, opts ...grpc.CallOption) (Query_ExecuteQueryClient, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc *grpc.ClientConn) QueryClient

type QueryResponse

type QueryResponse struct {
	// Response header. Set on the first QueryResponse only.
	Header *protocol.Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// Encoded table rows.
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
}

func (*QueryResponse) Descriptor

func (*QueryResponse) Descriptor() ([]byte, []int)

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) ProtoSize

func (m *QueryResponse) ProtoSize() (n int)

func (*QueryResponse) Reset

func (m *QueryResponse) Reset()

func (*QueryResponse) String

func (m *QueryResponse) String() string

func (*QueryResponse) Validate

func (m *QueryResponse) Validate() error

Validate returns an error if the QueryResponse is malformed.

func (*QueryResponse) XXX_DiscardUnknown

func (m *QueryResponse) XXX_DiscardUnknown()

func (*QueryResponse) XXX_Marshal

func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryResponse) XXX_Merge

func (m *QueryResponse) XXX_Merge(src proto.Message)

func (*QueryResponse) XXX_Size

func (m *QueryResponse) XXX_Size() int

func (*QueryResponse) XXX_Unmarshal

func (m *QueryResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// ResolveQuery maps a QuerySpec into a validated ResolvedQuery,
	// under the current server schema.
	ResolveQuery(context.Context, *QuerySpec) (*ResolvedQuery, error)
	// ExecuteResolvedQuery against one or all Shards.
	ExecuteQuery(*ExecuteQueryRequest, Query_ExecuteQueryServer) error
}

QueryServer is the server API for Query service.

type QuerySpec

type QuerySpec struct {
	// MaterializedView to query.
	MaterializedView string `protobuf:"bytes,2,opt,name=materialized_view,json=materializedView,proto3" json:"materialized_view,omitempty"`
	// View of the Query result.
	//
	// Dimensions of the Relation which should be grouped over and returned with
	// the Query result set. Other Dimensions included in the MaterializedView but
	// not included in the Query Shape are aggregated across.
	//
	// Where possible, use a strict ordered prefix of underlying MaterializedView
	// Dimensions. This is much more efficient to evaluate, as grouping can
	// utilize the natural index order, and no further recombining or sorting is
	// required. When using a prefix, the Query result set is incrementally
	// streamed as it is evaluated, and even extremely large result sets can be
	// queried efficiently.
	//
	// If Dimensions are not a strict prefix, the Query evaluator must perform
	// recombination and sorting steps, and results will be sent only after
	// all underlying view rows have been read. Implementations may also limit
	// the size of the result sets they will buffer, returning an error for
	// Queries which exceed it.
	View    ViewSpec           `protobuf:"bytes,3,opt,name=view,proto3" json:"view"`
	Filters []QuerySpec_Filter `protobuf:"bytes,4,rep,name=filters,proto3" json:"filters"`
}

QuerySpec describes a result which should be computed from a Relation. In particular it defines the "shape" (in Dimensions and Metrics) of the desired result, and any filters which should be applied.

func (*QuerySpec) Descriptor

func (*QuerySpec) Descriptor() ([]byte, []int)

func (*QuerySpec) ProtoMessage

func (*QuerySpec) ProtoMessage()

func (*QuerySpec) ProtoSize

func (m *QuerySpec) ProtoSize() (n int)

func (*QuerySpec) Reset

func (m *QuerySpec) Reset()

func (*QuerySpec) String

func (m *QuerySpec) String() string

func (*QuerySpec) XXX_DiscardUnknown

func (m *QuerySpec) XXX_DiscardUnknown()

func (*QuerySpec) XXX_Marshal

func (m *QuerySpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySpec) XXX_Merge

func (m *QuerySpec) XXX_Merge(src proto.Message)

func (*QuerySpec) XXX_Size

func (m *QuerySpec) XXX_Size() int

func (*QuerySpec) XXX_Unmarshal

func (m *QuerySpec) XXX_Unmarshal(b []byte) error

type QuerySpec_Filter

type QuerySpec_Filter struct {
	// Dimension to which the Filter is applied.
	Dimension string                    `protobuf:"bytes,1,opt,name=dimension,proto3" json:"dimension,omitempty"`
	Ints      []QuerySpec_Filter_Int    `protobuf:"bytes,2,rep,name=ints,proto3" json:"ints"`
	Floats    []QuerySpec_Filter_Float  `protobuf:"bytes,3,rep,name=floats,proto3" json:"floats"`
	Strings   []QuerySpec_Filter_String `protobuf:"bytes,4,rep,name=strings,proto3" json:"strings"`
	Times     []QuerySpec_Filter_Time   `protobuf:"bytes,5,rep,name=times,proto3" json:"times"`
}

A Filter is a sequence of ordered non-overlapping ranges for a Dimension. Filters may be applied to any subset of MaterializedView Dimensions, including those not present in the Query View.

func (*QuerySpec_Filter) Descriptor

func (*QuerySpec_Filter) Descriptor() ([]byte, []int)

func (*QuerySpec_Filter) ProtoMessage

func (*QuerySpec_Filter) ProtoMessage()

func (*QuerySpec_Filter) ProtoSize

func (m *QuerySpec_Filter) ProtoSize() (n int)

func (*QuerySpec_Filter) Reset

func (m *QuerySpec_Filter) Reset()

func (*QuerySpec_Filter) String

func (m *QuerySpec_Filter) String() string

func (*QuerySpec_Filter) XXX_DiscardUnknown

func (m *QuerySpec_Filter) XXX_DiscardUnknown()

func (*QuerySpec_Filter) XXX_Marshal

func (m *QuerySpec_Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySpec_Filter) XXX_Merge

func (m *QuerySpec_Filter) XXX_Merge(src proto.Message)

func (*QuerySpec_Filter) XXX_Size

func (m *QuerySpec_Filter) XXX_Size() int

func (*QuerySpec_Filter) XXX_Unmarshal

func (m *QuerySpec_Filter) XXX_Unmarshal(b []byte) error

type QuerySpec_Filter_Float

type QuerySpec_Filter_Float struct {
	Begin float64 `protobuf:"fixed64,1,opt,name=begin,proto3" json:"begin,omitempty"`
	End   float64 `protobuf:"fixed64,2,opt,name=end,proto3" json:"end,omitempty"`
}

func (*QuerySpec_Filter_Float) Descriptor

func (*QuerySpec_Filter_Float) Descriptor() ([]byte, []int)

func (*QuerySpec_Filter_Float) ProtoMessage

func (*QuerySpec_Filter_Float) ProtoMessage()

func (*QuerySpec_Filter_Float) ProtoSize

func (m *QuerySpec_Filter_Float) ProtoSize() (n int)

func (*QuerySpec_Filter_Float) Reset

func (m *QuerySpec_Filter_Float) Reset()

func (*QuerySpec_Filter_Float) String

func (m *QuerySpec_Filter_Float) String() string

func (*QuerySpec_Filter_Float) XXX_DiscardUnknown

func (m *QuerySpec_Filter_Float) XXX_DiscardUnknown()

func (*QuerySpec_Filter_Float) XXX_Marshal

func (m *QuerySpec_Filter_Float) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySpec_Filter_Float) XXX_Merge

func (m *QuerySpec_Filter_Float) XXX_Merge(src proto.Message)

func (*QuerySpec_Filter_Float) XXX_Size

func (m *QuerySpec_Filter_Float) XXX_Size() int

func (*QuerySpec_Filter_Float) XXX_Unmarshal

func (m *QuerySpec_Filter_Float) XXX_Unmarshal(b []byte) error

type QuerySpec_Filter_Int

type QuerySpec_Filter_Int struct {
	Begin int64 `protobuf:"varint,1,opt,name=begin,proto3" json:"begin,omitempty"`
	End   int64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty"`
}

func (*QuerySpec_Filter_Int) Descriptor

func (*QuerySpec_Filter_Int) Descriptor() ([]byte, []int)

func (*QuerySpec_Filter_Int) ProtoMessage

func (*QuerySpec_Filter_Int) ProtoMessage()

func (*QuerySpec_Filter_Int) ProtoSize

func (m *QuerySpec_Filter_Int) ProtoSize() (n int)

func (*QuerySpec_Filter_Int) Reset

func (m *QuerySpec_Filter_Int) Reset()

func (*QuerySpec_Filter_Int) String

func (m *QuerySpec_Filter_Int) String() string

func (*QuerySpec_Filter_Int) XXX_DiscardUnknown

func (m *QuerySpec_Filter_Int) XXX_DiscardUnknown()

func (*QuerySpec_Filter_Int) XXX_Marshal

func (m *QuerySpec_Filter_Int) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySpec_Filter_Int) XXX_Merge

func (m *QuerySpec_Filter_Int) XXX_Merge(src proto.Message)

func (*QuerySpec_Filter_Int) XXX_Size

func (m *QuerySpec_Filter_Int) XXX_Size() int

func (*QuerySpec_Filter_Int) XXX_Unmarshal

func (m *QuerySpec_Filter_Int) XXX_Unmarshal(b []byte) error

type QuerySpec_Filter_String

type QuerySpec_Filter_String struct {
	Begin string `protobuf:"bytes,1,opt,name=begin,proto3" json:"begin,omitempty"`
	End   string `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
}

func (*QuerySpec_Filter_String) Descriptor

func (*QuerySpec_Filter_String) Descriptor() ([]byte, []int)

func (*QuerySpec_Filter_String) ProtoMessage

func (*QuerySpec_Filter_String) ProtoMessage()

func (*QuerySpec_Filter_String) ProtoSize

func (m *QuerySpec_Filter_String) ProtoSize() (n int)

func (*QuerySpec_Filter_String) Reset

func (m *QuerySpec_Filter_String) Reset()

func (*QuerySpec_Filter_String) String

func (m *QuerySpec_Filter_String) String() string

func (*QuerySpec_Filter_String) XXX_DiscardUnknown

func (m *QuerySpec_Filter_String) XXX_DiscardUnknown()

func (*QuerySpec_Filter_String) XXX_Marshal

func (m *QuerySpec_Filter_String) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySpec_Filter_String) XXX_Merge

func (m *QuerySpec_Filter_String) XXX_Merge(src proto.Message)

func (*QuerySpec_Filter_String) XXX_Size

func (m *QuerySpec_Filter_String) XXX_Size() int

func (*QuerySpec_Filter_String) XXX_Unmarshal

func (m *QuerySpec_Filter_String) XXX_Unmarshal(b []byte) error

type QuerySpec_Filter_Time

type QuerySpec_Filter_Time struct {
	Begin         time.Time     `protobuf:"bytes,1,opt,name=begin,proto3,stdtime" json:"begin"`
	End           time.Time     `protobuf:"bytes,2,opt,name=end,proto3,stdtime" json:"end"`
	RelativeBegin time.Duration `protobuf:"bytes,3,opt,name=relative_begin,json=relativeBegin,proto3,stdduration" json:"relative_begin"`
	RelativeEnd   time.Duration `protobuf:"bytes,4,opt,name=relative_end,json=relativeEnd,proto3,stdduration" json:"relative_end"`
}

func (*QuerySpec_Filter_Time) Descriptor

func (*QuerySpec_Filter_Time) Descriptor() ([]byte, []int)

func (*QuerySpec_Filter_Time) ProtoMessage

func (*QuerySpec_Filter_Time) ProtoMessage()

func (*QuerySpec_Filter_Time) ProtoSize

func (m *QuerySpec_Filter_Time) ProtoSize() (n int)

func (*QuerySpec_Filter_Time) Reset

func (m *QuerySpec_Filter_Time) Reset()

func (*QuerySpec_Filter_Time) String

func (m *QuerySpec_Filter_Time) String() string

func (*QuerySpec_Filter_Time) XXX_DiscardUnknown

func (m *QuerySpec_Filter_Time) XXX_DiscardUnknown()

func (*QuerySpec_Filter_Time) XXX_Marshal

func (m *QuerySpec_Filter_Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QuerySpec_Filter_Time) XXX_Merge

func (m *QuerySpec_Filter_Time) XXX_Merge(src proto.Message)

func (*QuerySpec_Filter_Time) XXX_Size

func (m *QuerySpec_Filter_Time) XXX_Size() int

func (*QuerySpec_Filter_Time) XXX_Unmarshal

func (m *QuerySpec_Filter_Time) XXX_Unmarshal(b []byte) error

type Query_ExecuteQueryClient

type Query_ExecuteQueryClient interface {
	Recv() (*QueryResponse, error)
	grpc.ClientStream
}

type Query_ExecuteQueryServer

type Query_ExecuteQueryServer interface {
	Send(*QueryResponse) error
	grpc.ServerStream
}

type RelTag

type RelTag uint64

RelTag uniquely identifies a RelationSpec.

type RelationRow

type RelationRow []interface{}

RelationRow is a user-defined record type which a Mapping extractor produces, and over which which a Dimension extractor operates.

type RelationSpec

type RelationSpec struct {
	// Short, unique name of the Relation.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// LabelSelector identifies journals which, taken together, compose the "rows" of the Relation.
	Selector protocol.LabelSelector `protobuf:"bytes,2,opt,name=selector,proto3" json:"selector"`
	// Mapping which transforms journal events into Relation rows.
	Mapping string `protobuf:"bytes,3,opt,name=mapping,proto3" json:"mapping,omitempty"`
	// Dimensions of the Relation. Dimensions may be added and removed over time,
	// but all Dimensions or derived Metrics of current MaterializedViewSpecs must
	// refer to current Dimensions of the RelationSpec.
	Dimensions []string `protobuf:"bytes,4,rep,name=dimensions,proto3" json:"dimensions,omitempty"`
	// Longer, free-form description of the Relation.
	Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"`
	// Unique tag of the Relation.
	Tag RelTag `protobuf:"varint,6,opt,name=tag,proto3,casttype=RelTag" json:"tag,omitempty"`
	// Resolved MapTag of |mapping|. Immutable.
	MapTag MapTag `protobuf:"varint,7,opt,name=map_tag,json=mapTag,proto3,casttype=MapTag" json:"map_tag,omitempty" yaml:",omitempty"`
	// Resolved DimTags of |dimensions|. Immutable.
	DimTags []DimTag `protobuf:"varint,8,rep,packed,name=dim_tags,json=dimTags,proto3,casttype=DimTag" json:"dim_tags,omitempty" yaml:",omitempty"`
}

RelationSpec composes a journal LabelSelector, which defines a collection of input events, with a mapping that transforms each event into one or more RelationRows.

func (*RelationSpec) Descriptor

func (*RelationSpec) Descriptor() ([]byte, []int)

func (*RelationSpec) ProtoMessage

func (*RelationSpec) ProtoMessage()

func (*RelationSpec) ProtoSize

func (m *RelationSpec) ProtoSize() (n int)

func (*RelationSpec) Reset

func (m *RelationSpec) Reset()

func (*RelationSpec) String

func (m *RelationSpec) String() string

func (*RelationSpec) XXX_DiscardUnknown

func (m *RelationSpec) XXX_DiscardUnknown()

func (*RelationSpec) XXX_Marshal

func (m *RelationSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RelationSpec) XXX_Merge

func (m *RelationSpec) XXX_Merge(src proto.Message)

func (*RelationSpec) XXX_Size

func (m *RelationSpec) XXX_Size() int

func (*RelationSpec) XXX_Unmarshal

func (m *RelationSpec) XXX_Unmarshal(b []byte) error

type ReservedMVTagSpec

type ReservedMVTagSpec struct {
	// Reserved tag in the same space as MaterializedView.
	Tag MVTag `protobuf:"varint,1,opt,name=tag,proto3,casttype=MVTag" json:"tag,omitempty"`
	// Longer, free-form description of the reserved MVTag.
	Desc string `protobuf:"bytes,2,opt,name=desc,proto3" json:"desc,omitempty"`
}

ReservedMVTagSpec defines MVTags that cannot be used in this schema. This can be used to reserve tags for future materialized views or to tombstone deleted materialized views. Re-using materialized view tags requires careful consideration of previously used delta journals and shard recovery logs because the tag is an input for generating shard IDs in `factctl sync`.

func (*ReservedMVTagSpec) Descriptor

func (*ReservedMVTagSpec) Descriptor() ([]byte, []int)

func (*ReservedMVTagSpec) ProtoMessage

func (*ReservedMVTagSpec) ProtoMessage()

func (*ReservedMVTagSpec) ProtoSize

func (m *ReservedMVTagSpec) ProtoSize() (n int)

func (*ReservedMVTagSpec) Reset

func (m *ReservedMVTagSpec) Reset()

func (*ReservedMVTagSpec) String

func (m *ReservedMVTagSpec) String() string

func (*ReservedMVTagSpec) XXX_DiscardUnknown

func (m *ReservedMVTagSpec) XXX_DiscardUnknown()

func (*ReservedMVTagSpec) XXX_Marshal

func (m *ReservedMVTagSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReservedMVTagSpec) XXX_Merge

func (m *ReservedMVTagSpec) XXX_Merge(src proto.Message)

func (*ReservedMVTagSpec) XXX_Size

func (m *ReservedMVTagSpec) XXX_Size() int

func (*ReservedMVTagSpec) XXX_Unmarshal

func (m *ReservedMVTagSpec) XXX_Unmarshal(b []byte) error

type ResolvedQuery

type ResolvedQuery struct {
	// Tag of the MaterializedViewSpec to be queried.
	MvTag MVTag `protobuf:"varint,1,opt,name=mv_tag,json=mvTag,proto3,casttype=MVTag" json:"mv_tag,omitempty"`
	// Shape of the query result.
	View    ResolvedView           `protobuf:"bytes,2,opt,name=view,proto3" json:"view"`
	Filters []ResolvedQuery_Filter `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters"`
}

func (*ResolvedQuery) Descriptor

func (*ResolvedQuery) Descriptor() ([]byte, []int)

func (*ResolvedQuery) ProtoMessage

func (*ResolvedQuery) ProtoMessage()

func (*ResolvedQuery) ProtoSize

func (m *ResolvedQuery) ProtoSize() (n int)

func (*ResolvedQuery) Reset

func (m *ResolvedQuery) Reset()

func (*ResolvedQuery) String

func (m *ResolvedQuery) String() string

func (*ResolvedQuery) XXX_DiscardUnknown

func (m *ResolvedQuery) XXX_DiscardUnknown()

func (*ResolvedQuery) XXX_Marshal

func (m *ResolvedQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResolvedQuery) XXX_Merge

func (m *ResolvedQuery) XXX_Merge(src proto.Message)

func (*ResolvedQuery) XXX_Size

func (m *ResolvedQuery) XXX_Size() int

func (*ResolvedQuery) XXX_Unmarshal

func (m *ResolvedQuery) XXX_Unmarshal(b []byte) error

type ResolvedQuery_Filter

type ResolvedQuery_Filter struct {
	// Dimension to which the Filter is applied.
	DimTag DimTag                       `protobuf:"varint,1,opt,name=dim_tag,json=dimTag,proto3,casttype=DimTag" json:"dim_tag,omitempty"`
	Ranges []ResolvedQuery_Filter_Range `protobuf:"bytes,2,rep,name=ranges,proto3" json:"ranges"`
}

Flattened filtered ranges over each view dimension.

func (*ResolvedQuery_Filter) Descriptor

func (*ResolvedQuery_Filter) Descriptor() ([]byte, []int)

func (*ResolvedQuery_Filter) ProtoMessage

func (*ResolvedQuery_Filter) ProtoMessage()

func (*ResolvedQuery_Filter) ProtoSize

func (m *ResolvedQuery_Filter) ProtoSize() (n int)

func (*ResolvedQuery_Filter) Reset

func (m *ResolvedQuery_Filter) Reset()

func (*ResolvedQuery_Filter) String

func (m *ResolvedQuery_Filter) String() string

func (*ResolvedQuery_Filter) XXX_DiscardUnknown

func (m *ResolvedQuery_Filter) XXX_DiscardUnknown()

func (*ResolvedQuery_Filter) XXX_Marshal

func (m *ResolvedQuery_Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResolvedQuery_Filter) XXX_Merge

func (m *ResolvedQuery_Filter) XXX_Merge(src proto.Message)

func (*ResolvedQuery_Filter) XXX_Size

func (m *ResolvedQuery_Filter) XXX_Size() int

func (*ResolvedQuery_Filter) XXX_Unmarshal

func (m *ResolvedQuery_Filter) XXX_Unmarshal(b []byte) error

type ResolvedQuery_Filter_Range

type ResolvedQuery_Filter_Range struct {
	Begin []byte `protobuf:"bytes,1,opt,name=begin,proto3" json:"begin,omitempty"`
	End   []byte `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
}

Flattened allowed byte ranges of the Dimension.

func (*ResolvedQuery_Filter_Range) Descriptor

func (*ResolvedQuery_Filter_Range) Descriptor() ([]byte, []int)

func (*ResolvedQuery_Filter_Range) ProtoMessage

func (*ResolvedQuery_Filter_Range) ProtoMessage()

func (*ResolvedQuery_Filter_Range) ProtoSize

func (m *ResolvedQuery_Filter_Range) ProtoSize() (n int)

func (*ResolvedQuery_Filter_Range) Reset

func (m *ResolvedQuery_Filter_Range) Reset()

func (*ResolvedQuery_Filter_Range) String

func (m *ResolvedQuery_Filter_Range) String() string

func (*ResolvedQuery_Filter_Range) XXX_DiscardUnknown

func (m *ResolvedQuery_Filter_Range) XXX_DiscardUnknown()

func (*ResolvedQuery_Filter_Range) XXX_Marshal

func (m *ResolvedQuery_Filter_Range) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResolvedQuery_Filter_Range) XXX_Merge

func (m *ResolvedQuery_Filter_Range) XXX_Merge(src proto.Message)

func (*ResolvedQuery_Filter_Range) XXX_Size

func (m *ResolvedQuery_Filter_Range) XXX_Size() int

func (*ResolvedQuery_Filter_Range) XXX_Unmarshal

func (m *ResolvedQuery_Filter_Range) XXX_Unmarshal(b []byte) error

type ResolvedView

type ResolvedView struct {
	// Resolved DimTags of ViewSpec Dimensions.
	DimTags []DimTag `protobuf:"varint,1,rep,packed,name=dim_tags,json=dimTags,proto3,casttype=DimTag" json:"dim_tags,omitempty"`
	// Resolved MetTags of ViewSpec Metrics.
	MetTags []MetTag `protobuf:"varint,2,rep,packed,name=met_tags,json=metTags,proto3,casttype=MetTag" json:"met_tags,omitempty"`
}

func (*ResolvedView) Descriptor

func (*ResolvedView) Descriptor() ([]byte, []int)

func (*ResolvedView) ProtoMessage

func (*ResolvedView) ProtoMessage()

func (*ResolvedView) ProtoSize

func (m *ResolvedView) ProtoSize() (n int)

func (*ResolvedView) Reset

func (m *ResolvedView) Reset()

func (*ResolvedView) String

func (m *ResolvedView) String() string

func (*ResolvedView) VerboseEqual

func (this *ResolvedView) VerboseEqual(that interface{}) error

func (*ResolvedView) XXX_DiscardUnknown

func (m *ResolvedView) XXX_DiscardUnknown()

func (*ResolvedView) XXX_Marshal

func (m *ResolvedView) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ResolvedView) XXX_Merge

func (m *ResolvedView) XXX_Merge(src proto.Message)

func (*ResolvedView) XXX_Size

func (m *ResolvedView) XXX_Size() int

func (*ResolvedView) XXX_Unmarshal

func (m *ResolvedView) XXX_Unmarshal(b []byte) error

type Schema

type Schema struct {
	Extract ExtractFns
	Spec    SchemaSpec

	Mappings       map[MapTag]MappingSpec
	Dimensions     map[DimTag]DimensionSpec
	Metrics        map[MetTag]MetricSpec
	Relations      map[RelTag]RelationSpec
	ReservedMVTags map[MVTag]struct{}
	Views          map[MVTag]MaterializedViewSpec

	MapTags map[string]MapTag
	DimTags map[string]DimTag
	MetTags map[string]MetTag
	RelTags map[string]RelTag
	MVTags  map[string]MVTag
}

Schema composes ExtractFns with a validated, indexed SchemaSpec.

func NewSchema

func NewSchema(optionalExtractors *ExtractFns, spec SchemaSpec) (Schema, error)

NewSchema returns a Schema over the given Spec and optional ExtractFns. Deep checking of specification referential integrity is performed, and if ExtractFns are provided, specifications are checked for consistency against registered extractors as well.

func (*Schema) DequeDimension

func (schema *Schema) DequeDimension(b []byte, dim DimTag) (rem []byte, err error)

DequeDimension of DimTag |dim| from |b|, returning the byte remainder.

func (*Schema) ExtractAndMarshalDimensions

func (schema *Schema) ExtractAndMarshalDimensions(b []byte, dims []DimTag, row RelationRow) []byte

ExtractAndMarshalDimension extracts ordered dimensions |dims| from the RelationRow and appends their encoding to |b|, returning the result.

func (*Schema) FoldMetrics

func (schema *Schema) FoldMetrics(mets []MetTag, aggs []Aggregate, row RelationRow)

FoldMetrics extracts metrics |mets| from the RelationRow and folds it into Aggregates |aggs|, which must have already been initialized.

func (*Schema) InitAggregates

func (schema *Schema) InitAggregates(mets []MetTag, aggs []Aggregate)

InitAggregates |aggs| in-place for each of metrics |met|. If an index aggs[i] is non-nil it must have been previously initialized for mets[i], and will be zero'd for reuse.

func (*Schema) MarshalMetrics

func (schema *Schema) MarshalMetrics(b []byte, mets []MetTag, aggs []Aggregate) []byte

MarshalMetric appends the encoding of |agg| (which must be of metric type |met|) to |b|, returning the result.

func (*Schema) ReduceMetrics

func (schema *Schema) ReduceMetrics(b []byte, mets []MetTag, aggs []Aggregate) ([]byte, error)

ReduceMetrics decodes Aggregates of metrics |mets| from |b|, and reduces each into |aggs| (which must have already been initialized). The remainder of |b| is returned.

func (*Schema) ResolveQuery

func (schema *Schema) ResolveQuery(spec QuerySpec) (ResolvedQuery, error)

ResolveQuery maps a QuerySpec through the Schema into a ResolvedQuery.

func (*Schema) UnmarshalDimensions

func (schema *Schema) UnmarshalDimensions(b []byte, dims []DimTag, fn func(Field) error) error

UnmarshalDimensions of DimTags |dims| from |b|, invoking |fn| for each un-marshaled Field. It may return a decoding error, an error returned by |fn|, or an error if the input |b| has any unconsumed remainder.

func (*Schema) UnmarshalMetrics

func (schema *Schema) UnmarshalMetrics(b []byte, mets []MetTag, fn func(Aggregate) error) error

UnmarshalMetrics of MetTags |mets| from |b|, invoking |fn| for each un-marshaled Aggregate. It may return a decoding error, an error returned by |fn|, or an error if the input |b| has any unconsumed remainder.

type SchemaClient

type SchemaClient interface {
	// GetSchema retrieves the current SchemaSpec.
	GetSchema(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetSchemaResponse, error)
	// UpdateSchema updates the SchemaSpec to a new value.
	UpdateSchema(ctx context.Context, in *UpdateSchemaRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

SchemaClient is the client API for Schema service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSchemaClient

func NewSchemaClient(cc *grpc.ClientConn) SchemaClient

type SchemaServer

type SchemaServer interface {
	// GetSchema retrieves the current SchemaSpec.
	GetSchema(context.Context, *empty.Empty) (*GetSchemaResponse, error)
	// UpdateSchema updates the SchemaSpec to a new value.
	UpdateSchema(context.Context, *UpdateSchemaRequest) (*empty.Empty, error)
}

SchemaServer is the server API for Schema service.

type SchemaSpec

type SchemaSpec struct {
	Mappings         []MappingSpec          `protobuf:"bytes,1,rep,name=mappings,proto3" json:"mappings"`
	Dimensions       []DimensionSpec        `protobuf:"bytes,2,rep,name=dimensions,proto3" json:"dimensions"`
	Metrics          []MetricSpec           `protobuf:"bytes,3,rep,name=metrics,proto3" json:"metrics"`
	Relations        []RelationSpec         `protobuf:"bytes,4,rep,name=relations,proto3" json:"relations"`
	Views            []MaterializedViewSpec `protobuf:"bytes,5,rep,name=views,proto3" json:"views"`
	ReservedViewTags []ReservedMVTagSpec    `protobuf:"bytes,6,rep,name=reserved_view_tags,json=reservedViewTags,proto3" json:"reserved_view_tags"`
}

SchemaSpec defines a set of Relations and their Mappings, Dimensions, Metrics, and MaterializedViews. The complete Schema must be referentially consistent: any Mapping, Dimension or Metric used in a Relation or MaterializedView must be defined. Similarly, Dimensions referenced from Metrics must be defined, and of the proper associated type.

func (*SchemaSpec) Descriptor

func (*SchemaSpec) Descriptor() ([]byte, []int)

func (SchemaSpec) Marshal

func (x SchemaSpec) Marshal() ([]byte, error)

func (*SchemaSpec) ProtoMessage

func (*SchemaSpec) ProtoMessage()

func (*SchemaSpec) ProtoSize

func (m *SchemaSpec) ProtoSize() (n int)

func (*SchemaSpec) Reset

func (m *SchemaSpec) Reset()

func (*SchemaSpec) String

func (m *SchemaSpec) String() string

func (SchemaSpec) Unmarshal

func (x SchemaSpec) Unmarshal(b []byte) error

func (*SchemaSpec) XXX_DiscardUnknown

func (m *SchemaSpec) XXX_DiscardUnknown()

func (*SchemaSpec) XXX_Marshal

func (m *SchemaSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SchemaSpec) XXX_Merge

func (m *SchemaSpec) XXX_Merge(src proto.Message)

func (*SchemaSpec) XXX_Size

func (m *SchemaSpec) XXX_Size() int

func (*SchemaSpec) XXX_Unmarshal

func (m *SchemaSpec) XXX_Unmarshal(b []byte) error

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) ExecuteQuery

func (*UnimplementedQueryServer) ResolveQuery

type UnimplementedSchemaServer

type UnimplementedSchemaServer struct {
}

UnimplementedSchemaServer can be embedded to have forward compatible implementations.

func (*UnimplementedSchemaServer) GetSchema

func (*UnimplementedSchemaServer) UpdateSchema

type UpdateSchemaRequest

type UpdateSchemaRequest struct {
	// Expected Name of the Factable release instance.
	ExpectInstance string `protobuf:"bytes,1,opt,name=expect_instance,json=expectInstance,proto3" json:"expect_instance,omitempty"`
	// Expected ModRevision of the current SchemaSpec. Zero if the SchemaSpec
	// is being created for the first time.
	ExpectModRevision int64 `protobuf:"varint,2,opt,name=expect_mod_revision,json=expectModRevision,proto3" json:"expect_mod_revision,omitempty"`
	// Updated SchemaSpec to apply.
	Update SchemaSpec `protobuf:"bytes,3,opt,name=update,proto3" json:"update"`
}

UpdateSchemaRequest is the request of the UpdateSchema RPC.

func (*UpdateSchemaRequest) Descriptor

func (*UpdateSchemaRequest) Descriptor() ([]byte, []int)

func (*UpdateSchemaRequest) ProtoMessage

func (*UpdateSchemaRequest) ProtoMessage()

func (*UpdateSchemaRequest) ProtoSize

func (m *UpdateSchemaRequest) ProtoSize() (n int)

func (*UpdateSchemaRequest) Reset

func (m *UpdateSchemaRequest) Reset()

func (*UpdateSchemaRequest) String

func (m *UpdateSchemaRequest) String() string

func (*UpdateSchemaRequest) XXX_DiscardUnknown

func (m *UpdateSchemaRequest) XXX_DiscardUnknown()

func (*UpdateSchemaRequest) XXX_Marshal

func (m *UpdateSchemaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpdateSchemaRequest) XXX_Merge

func (m *UpdateSchemaRequest) XXX_Merge(src proto.Message)

func (*UpdateSchemaRequest) XXX_Size

func (m *UpdateSchemaRequest) XXX_Size() int

func (*UpdateSchemaRequest) XXX_Unmarshal

func (m *UpdateSchemaRequest) XXX_Unmarshal(b []byte) error

type ViewSpec

type ViewSpec struct {
	// Ordered Dimensions summarized by the ViewSpec.
	Dimensions []string `protobuf:"bytes,1,rep,name=dimensions,proto3" json:"dimensions,omitempty"`
	// Ordered Metrics aggregated by the ViewSpec.
	Metrics []string `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
}

ViewSpec defines a summarized view over a Relation, composing a subset of Relation dimensions with a set of derived Metrics.

func (*ViewSpec) Descriptor

func (*ViewSpec) Descriptor() ([]byte, []int)

func (*ViewSpec) ProtoMessage

func (*ViewSpec) ProtoMessage()

func (*ViewSpec) ProtoSize

func (m *ViewSpec) ProtoSize() (n int)

func (*ViewSpec) Reset

func (m *ViewSpec) Reset()

func (*ViewSpec) String

func (m *ViewSpec) String() string

func (*ViewSpec) XXX_DiscardUnknown

func (m *ViewSpec) XXX_DiscardUnknown()

func (*ViewSpec) XXX_Marshal

func (m *ViewSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ViewSpec) XXX_Merge

func (m *ViewSpec) XXX_Merge(src proto.Message)

func (*ViewSpec) XXX_Size

func (m *ViewSpec) XXX_Size() int

func (*ViewSpec) XXX_Unmarshal

func (m *ViewSpec) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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