Documentation ¶
Index ¶
- func Attribute(key string, val *qpu.Value) *qpu.Attribute
- func AttributePredicate(attr *qpu.Attribute, lb *qpu.Value, ub *qpu.Value) *qpu.AttributePredicate
- func ConfigRequest() *qpuapi.ConfigRequest
- func HasAttribute(attributes map[string]*qpu.Value, attrName string) bool
- func NewASTQuery(table string, ts *qpu.SnapshotTimePredicate, ...) *qpuapi.ASTQuery
- func NewQuery(qSQL *qpuapi.SQLQuery, qAST *qpuapi.ASTQuery) *qpuapi.Query
- func NewSQLQuery(query string) *qpuapi.SQLQuery
- func ObjectState(state map[string]*qpu.Value) *qpu.ObjectState
- func QueryPredicate() []*qpu.AttributePredicate
- func RequestStreamAck(sID int64) *qpuapi.RequestStreamRecord
- func RequestStreamRequest(query *qpuapi.Query, metadata map[string]string, sync bool) *qpuapi.RequestStreamRecord
- func ResponseStreamRecord(seqID int64, t qpuapi.ResponseStreamRecord_StreamRecordType, ...) *qpuapi.ResponseStreamRecord
- func SnapshotTime(t qpu.SnapshotTime_SnapshotTimeType, vc *qpu.Vectorclock, isClosed bool) *qpu.SnapshotTime
- func SnapshotTimePredicate(lb *qpu.SnapshotTime, ub *qpu.SnapshotTime) *qpu.SnapshotTimePredicate
- func ValueFlt(f float64) *qpu.Value
- func ValueInt(i int32) *qpu.Value
- func ValueStr(s string) *qpu.Value
- func Vectorclock(vc map[string]*timestamp.Timestamp) *qpu.Vectorclock
- type APIClient
- type APIProcessor
- type ASTQuery
- func (q ASTQuery) GetLimit() int64
- func (q ASTQuery) GetOrderBy() *qpuapi.OrderBy
- func (q ASTQuery) GetPredicate() []*qpu.AttributePredicate
- func (q ASTQuery) GetPredicateContains() ([]string, []string)
- func (q ASTQuery) GetProjection() []string
- func (q ASTQuery) GetTable() string
- func (q ASTQuery) GetTsPredicate() *qpu.SnapshotTimePredicate
- type AdjacentQPU
- type AggregationType
- type DatastoreAttributeType
- type DatastoreType
- type DownstreamQueryConf
- type LogOperation
- func (op LogOperation) GetAttributes() map[string]*qpu.Value
- func (op LogOperation) GetAttributesOld() map[string]*qpu.Value
- func (op LogOperation) GetObjectID() string
- func (op LogOperation) GetTable() string
- func (op LogOperation) GetTimestamp() *qpu.Vectorclock
- func (op LogOperation) HasOldState() bool
- func (op LogOperation) IsDelta() bool
- type OperatorType
- type QPU
- type QPUClass
- type QPUConfig
- type QPUConnection
- type QPUService
- type QPUState
- type QueryLogEntry
- type QueryRequest
- type QueryType
- type RequestStream
- type ResponseRecord
- func (r ResponseRecord) GetAttributes() map[string]*qpu.Value
- func (r ResponseRecord) GetAttributesOld() map[string]*qpu.Value
- func (r ResponseRecord) GetLogOp() LogOperation
- func (r ResponseRecord) GetRecordID() string
- func (r ResponseRecord) GetSequenceID() int64
- func (r ResponseRecord) GetType() (ResponseRecordType, error)
- type ResponseRecordType
- type ResponseStream
- type Schema
- func (s Schema) GetValue(attributes map[string]*qpu.Value, table, attrName string) (interface{}, error)
- func (s Schema) InterfaceToAttributes(table string, attributesStr map[string]interface{}) (map[string]*qpu.Value, error)
- func (s Schema) InterfaceToStr(table, attributeKey string, val interface{}) ([]byte, error)
- func (s Schema) InterfaceToString(table string, attributesStr map[string]interface{}) (map[string][]byte, error)
- func (s Schema) InterfaceToValue(table, attributeKey string, val interface{}) (*qpu.Value, error)
- func (s Schema) StrToAttributes(table string, attributesStr map[string]string) (map[string]*qpu.Value, error)
- func (s Schema) StrToValue(table, attributeKey, valueStr string) (*qpu.Value, error)
- type SchemaTable
- type StateType
- type WriteLogEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributePredicate ¶
AttributePredicate create a protos/utils/AttributePredicate object
func ConfigRequest ¶
func ConfigRequest() *qpuapi.ConfigRequest
ConfigRequest creates a protos/qpu/ConfigRequest object
func HasAttribute ¶
HasAttribute ...
func NewASTQuery ¶
func NewASTQuery(table string, ts *qpu.SnapshotTimePredicate, predicate []*qpu.AttributePredicate, projection []string, limit int64) *qpuapi.ASTQuery
NewASTQuery ...
func ObjectState ¶
func ObjectState(state map[string]*qpu.Value) *qpu.ObjectState
ObjectState creates a protos/qpu/State object
func RequestStreamAck ¶
func RequestStreamAck(sID int64) *qpuapi.RequestStreamRecord
RequestStreamAck creates a protos/qpu/RequestStream{Ack} object
func RequestStreamRequest ¶
func RequestStreamRequest(query *qpuapi.Query, metadata map[string]string, sync bool) *qpuapi.RequestStreamRecord
RequestStreamRequest creates a protos/qpu/RequestStream{Request} object
func ResponseStreamRecord ¶
func ResponseStreamRecord(seqID int64, t qpuapi.ResponseStreamRecord_StreamRecordType, logOp *qpu.LogOperation) *qpuapi.ResponseStreamRecord
ResponseStreamRecord ...
func SnapshotTime ¶
func SnapshotTime(t qpu.SnapshotTime_SnapshotTimeType, vc *qpu.Vectorclock, isClosed bool) *qpu.SnapshotTime
SnapshotTime creates a protos/utils/SnapshotTime object
func SnapshotTimePredicate ¶
func SnapshotTimePredicate(lb *qpu.SnapshotTime, ub *qpu.SnapshotTime) *qpu.SnapshotTimePredicate
SnapshotTimePredicate create a protos/utils/SnapshotTimePredicate object
func Vectorclock ¶
func Vectorclock(vc map[string]*timestamp.Timestamp) *qpu.Vectorclock
Vectorclock creates a protos/utils/Vectorclock object
Types ¶
type APIClient ¶
type APIClient interface { Query(QueryRequest) (ResponseStream, error) QueryUnary(string) (*qpuextapi.QueryResp, error) QuerySQL(string, map[string]string, bool) (ResponseStream, error) QuerySubscribe(string) (qpuapi.QPUAPI_QuerySubscribeClient, context.CancelFunc, error) CloseConnection() error GetConfig() (*qpuapi.ConfigResponse, error) }
APIClient ...
type APIProcessor ¶
type APIProcessor interface { Query(QueryRequest, RequestStream) error QueryUnary(QueryRequest, opentracing.Span) (*qpuextapi.QueryResp, error) QuerySubscribe(*qpuextapi.QueryReq, qpuapi.QPUAPI_QuerySubscribeServer) error GetConfig(context.Context, *qpuapi.ConfigRequest) (*qpuapi.ConfigResponse, error) }
APIProcessor ...
type ASTQuery ¶
ASTQuery ...
func (ASTQuery) GetPredicate ¶
func (q ASTQuery) GetPredicate() []*qpu.AttributePredicate
GetPredicate ...
func (ASTQuery) GetPredicateContains ¶
GetPredicateContains ...
func (ASTQuery) GetTsPredicate ¶
func (q ASTQuery) GetTsPredicate() *qpu.SnapshotTimePredicate
GetTsPredicate ...
type AdjacentQPU ¶
AdjacentQPU ...
type AggregationType ¶
type AggregationType int
AggregationType ...
const ( // Sum ... Sum AggregationType = iota )
type DatastoreAttributeType ¶
type DatastoreAttributeType int
DatastoreAttributeType ...
const ( // STR ... STR DatastoreAttributeType = iota // INT ... INT DatastoreAttributeType = iota // FLT ... FLT DatastoreAttributeType = iota )
type DatastoreType ¶
type DatastoreType int
DatastoreType ...
const ( // MYSQL is the enum value for a MySQL storage tier MYSQL DatastoreType = iota // S3 is the enum value for a S3 storage tier S3 DatastoreType = iota // MOCK is the enum value for a mocked storage tier MOCK DatastoreType = iota )
type DownstreamQueryConf ¶
DownstreamQueryConf ...
type LogOperation ¶
type LogOperation struct { Op *qpu.LogOperation InTs time.Time }
LogOperation ...
func LogOperationDelta ¶
func LogOperationDelta(recordID, table string, ts *qpu.Vectorclock, attributesOld map[string]*qpu.Value, attributesNew map[string]*qpu.Value, ) LogOperation
LogOperationDelta ...
func LogOperationState ¶
func LogOperationState(recordID, table string, ts *qpu.Vectorclock, atttributes map[string]*qpu.Value) LogOperation
LogOperationState creates a protos/utils/LogOperation object
func (LogOperation) GetAttributes ¶
func (op LogOperation) GetAttributes() map[string]*qpu.Value
GetAttributes ...
func (LogOperation) GetAttributesOld ¶
func (op LogOperation) GetAttributesOld() map[string]*qpu.Value
GetAttributesOld ...
func (LogOperation) GetTimestamp ¶
func (op LogOperation) GetTimestamp() *qpu.Vectorclock
GetTimestamp ...
type OperatorType ¶
type OperatorType int
OperatorType ...
const ( // DBDriver ... DBDriver OperatorType = iota // Aggregation ... Aggregation OperatorType = iota // Join ... Join OperatorType = iota // Index ... Index OperatorType = iota // InMemIndex ... InMemIndex OperatorType = iota // Cache ... Cache OperatorType = iota // Router ... Router OperatorType = iota )
type QPU ¶
type QPU struct { Class QPUClass Config *QPUConfig InputSchema Schema AdjacentQPUs []*AdjacentQPU State QPUState }
QPU ...
type QPUClass ¶
type QPUClass interface { ClientQuery(ASTQuery, string, opentracing.Span) (*qpuextapi.QueryResp, error) ProcessQuerySnapshot(ASTQuery, map[string]string, bool, opentracing.Span) (<-chan LogOperation, <-chan error) ProcessQuerySubscribe(ASTQuery, map[string]string, bool) (int, <-chan LogOperation, <-chan error) QuerySubscribe(ASTQuery, *qpuextapi.QueryReq) (chan LogOperation, chan bool, chan error) RemovePersistentQuery(string, int) GetConfig() *qpuapi.ConfigResponse }
QPUClass ...
type QPUConfig ¶
type QPUConfig struct { Operator OperatorType State StateType Port string Connections []QPUConnection StateBackend struct { Endpoint string Credentials struct { AccessKeyID string SecretAccessKey string } } DatastoreConfig struct { Type DatastoreType Endpoint string LogStreamEndpoint string DBName string Credentials struct { AccessKeyID string SecretAccessKey string } } IndexConfig struct { Table string AttributeName string AttributeType DatastoreAttributeType LBound *qpu.Value UBound *qpu.Value } AggregationConfig struct { AggregationFunc AggregationType GroupBy string AggregationAttribute string } JoinConfig struct { OutputTableAlias string JoinedAttributeAlias string JoinAttribute map[string]string } CacheConfig struct { Size int TTL int } Evaluation struct { Tracing bool LogTimestamps bool MeasureNotificationLatency bool MeasureDataTransfer bool } ProcessingConfig struct { API struct { MaxWorkers int MaxJobQueue int } Input struct { MaxWorkers int MaxJobQueue int } GrpcServers int } }
QPUConfig specifies the configuration structure of a QPU
type QPUConnection ¶
QPUConnection ...
type QPUState ¶
type QPUState interface { Init(string, string, string) error Insert(string, map[string]interface{}, map[string]*timestamp.Timestamp) error Update(string, map[string]interface{}, map[string]interface{}, map[string]*timestamp.Timestamp) error Get(string, []string, []string, string, int64, opentracing.Span) (<-chan map[string]interface{}, error) GetRow(string, []string, []string, opentracing.Span) *sql.Row Cleanup() }
QPUState ...
type QueryRequest ¶
type QueryRequest struct {
Req *qpuapi.QueryRequest
}
QueryRequest ...
func NewQueryRequest ¶
func NewQueryRequest(query *qpuapi.Query, md map[string]string, sync, measureDataTransfer bool) QueryRequest
NewQueryRequest ...
func (QueryRequest) GetMeasureDataTransfer ¶
func (r QueryRequest) GetMeasureDataTransfer() bool
GetMeasureDataTransfer ...
func (QueryRequest) GetMetadata ¶
func (r QueryRequest) GetMetadata() map[string]string
GetMetadata ...
type RequestStream ¶
type RequestStream struct {
Stream qpuapi.QPUAPI_QueryServer
}
RequestStream ...
func (RequestStream) Send ¶
func (s RequestStream) Send(seqID int64, recordType ResponseRecordType, logOp LogOperation) error
Send ...
type ResponseRecord ¶
type ResponseRecord struct { Rec *qpuapi.ResponseStreamRecord InTs time.Time }
ResponseRecord ...
func (ResponseRecord) GetAttributes ¶
func (r ResponseRecord) GetAttributes() map[string]*qpu.Value
GetAttributes ...
func (ResponseRecord) GetAttributesOld ¶
func (r ResponseRecord) GetAttributesOld() map[string]*qpu.Value
GetAttributesOld ...
func (ResponseRecord) GetSequenceID ¶
func (r ResponseRecord) GetSequenceID() int64
GetSequenceID ...
func (ResponseRecord) GetType ¶
func (r ResponseRecord) GetType() (ResponseRecordType, error)
GetType ...
type ResponseRecordType ¶
type ResponseRecordType int
ResponseRecordType ...
const ( // State ... State ResponseRecordType = iota // Delta ... Delta ResponseRecordType = iota // EndOfStream ... EndOfStream ResponseRecordType = iota )
type ResponseStream ¶
type ResponseStream struct { Stream qpuapi.QPUAPI_QueryClient CancelFunc context.CancelFunc }
ResponseStream ...
type Schema ¶
type Schema map[string]SchemaTable
Schema ...
func (Schema) GetValue ¶
func (s Schema) GetValue(attributes map[string]*qpu.Value, table, attrName string) (interface{}, error)
GetValue ...
func (Schema) InterfaceToAttributes ¶
func (s Schema) InterfaceToAttributes(table string, attributesStr map[string]interface{}) (map[string]*qpu.Value, error)
InterfaceToAttributes ...
func (Schema) InterfaceToStr ¶
InterfaceToStr ...
func (Schema) InterfaceToString ¶
func (s Schema) InterfaceToString(table string, attributesStr map[string]interface{}) (map[string][]byte, error)
InterfaceToString ...
func (Schema) InterfaceToValue ¶
InterfaceToValue ...
type SchemaTable ¶
type SchemaTable struct { Attributes map[string]DatastoreAttributeType DownstreamQuery DownstreamQueryConf }
SchemaTable ...