Documentation ¶
Index ¶
- Constants
- func CreateStatWindows(rz []qtree.Record, tCutoffStart int64, tStart int64, tEnd int64, w uint64) []qtree.StatRecord
- type ChangedRange
- type PQM
- func (pqm *PQM) Flush(ctx context.Context, id uuid.UUID) (maj uint64, min uint64, err bte.BTE)
- func (pqm *PQM) GetChangedRanges(ctx context.Context, id uuid.UUID, resolution uint8) ([]ChangedRange, bte.BTE, uint64, uint64)
- func (pqm *PQM) GetPSHandle(ctx context.Context) (*psHandle, bte.BTE)
- func (pqm *PQM) InitiateShutdown() chan struct{}
- func (pqm *PQM) Insert(ctx context.Context, id uuid.UUID, r []Record) (major, minor uint64, err bte.BTE)
- func (pqm *PQM) MergeNearestValue(ctx context.Context, id uuid.UUID, time int64, backwards bool, ...) (r Record, err bte.BTE, maj uint64, min uint64)
- func (pqm *PQM) MergeQueryStatisticalValuesStream(ctx context.Context, id uuid.UUID, start int64, end int64, pointwidth uint8, ...) (chan qtree.StatRecord, chan bte.BTE, uint64, uint64)
- func (pqm *PQM) MergeQueryValuesStream(ctx context.Context, id uuid.UUID, start int64, end int64, ...) (chan qtree.Record, chan bte.BTE, uint64, uint64)
- func (pqm *PQM) MergedQueryWindow(ctx context.Context, id uuid.UUID, start int64, end int64, width uint64, ...) (chan qtree.StatRecord, chan bte.BTE, uint64, uint64)
- func (pqm *PQM) MuxContents(ctx context.Context, id uuid.UUID) (major, minor uint64, contents []Record, err bte.BTE)
- func (pqm *PQM) QueryVersion(ctx context.Context, id uuid.UUID) (maj uint64, min uint64, err bte.BTE)
- type Quasar
- func (q *Quasar) CreateStream(ctx context.Context, uuid []byte, collection string, tags map[string]string, ...) bte.BTE
- func (q *Quasar) DeleteRange(ctx context.Context, id uuid.UUID, start int64, end int64) (uint64, uint64, bte.BTE)
- func (q *Quasar) Flush(ctx context.Context, id uuid.UUID) (uint64, uint64, bte.BTE)
- func (q *Quasar) GetClusterConfiguration() configprovider.ClusterConfiguration
- func (q *Quasar) GetKeyUsage(ctx context.Context, prefix string) (tags map[string]int, anns map[string]int, err bte.BTE)
- func (q *Quasar) GetStreamDescriptor(ctx context.Context, uuid []byte) (res *mprovider.LookupResult, err bte.BTE)
- func (q *Quasar) GetStreamVersion(ctx context.Context, uuid []byte) (major, minor uint64, err bte.BTE)
- func (q *Quasar) InitiateShutdown() chan struct{}
- func (q *Quasar) InsertValues(ctx context.Context, id uuid.UUID, r []qtree.Record) (maj, min uint64, err bte.BTE)
- func (q *Quasar) ListCollections(ctx context.Context, prefix string, startingFrom string, limit uint64) ([]string, bte.BTE)
- func (q *Quasar) LookupStreams(ctx context.Context, collection string, isCollectionPrefix bool, ...) (chan *mprovider.LookupResult, chan bte.BTE)
- func (q *Quasar) ObliterateStream(ctx context.Context, id []byte) bte.BTE
- func (q *Quasar) QueryChangedRanges(ctx context.Context, id uuid.UUID, startgen uint64, endgen uint64, ...) (chan ChangedRange, chan bte.BTE, uint64, uint64)
- func (q *Quasar) QueryNearestValue(ctx context.Context, id uuid.UUID, time int64, backwards bool, gen uint64) (qtree.Record, bte.BTE, uint64, uint64)
- func (q *Quasar) QueryStatisticalValuesStream(ctx context.Context, id uuid.UUID, start int64, end int64, gen uint64, ...) (chan qtree.StatRecord, chan bte.BTE, uint64, uint64)
- func (q *Quasar) QueryValuesStream(ctx context.Context, id uuid.UUID, start int64, end int64, gen uint64) (chan qtree.Record, chan bte.BTE, uint64, uint64)
- func (q *Quasar) QueryWindow(ctx context.Context, id uuid.UUID, start int64, end int64, gen uint64, ...) (chan qtree.StatRecord, chan bte.BTE, uint64, uint64)
- func (q *Quasar) Rez() *rez.RezManager
- func (q *Quasar) SetStreamAnnotations(ctx context.Context, uuid []byte, aver uint64, changes map[string]*string) bte.BTE
- func (q *Quasar) StorageProvider() bprovider.StorageProvider
- type Record
- type StatRecordSlice
- type StorageInterface
Constants ¶
const LatestGeneration = bstore.LatestGeneration
const MaxPQMBufferAge = 8 * time.Hour
TODO this should be more like a few hours Even a few minutes
const MaxPQMBufferSize = 32768
This number should be >2000 for decent storage efficiency. If it is too large then recovery of journals can take a long time
const MaximumTime = (48 << 56)
const MinimumTime = -(16 << 56)
Variables ¶
This section is empty.
Functions ¶
func CreateStatWindows ¶
func CreateStatWindows(rz []qtree.Record, tCutoffStart int64, tStart int64, tEnd int64, w uint64) []qtree.StatRecord
For all points in rz >= tCutoffStart and < tEnd, align into windows of width w starting from tStart END IS INCLUSIVE, so you need to subtract one for unaligned windows
Types ¶
type ChangedRange ¶
type PQM ¶
type PQM struct {
// contains filtered or unexported fields
}
func NewPQM ¶
func NewPQM(si StorageInterface) *PQM
func (*PQM) GetChangedRanges ¶
func (*PQM) InitiateShutdown ¶
func (pqm *PQM) InitiateShutdown() chan struct{}
Flush all open buffers
func (*PQM) MergeNearestValue ¶
func (*PQM) MergeQueryStatisticalValuesStream ¶
func (*PQM) MergeQueryValuesStream ¶
func (*PQM) MergedQueryWindow ¶
func (*PQM) MuxContents ¶
type Quasar ¶
type Quasar struct {
// contains filtered or unexported fields
}
func NewQuasar ¶
func NewQuasar(cfg configprovider.Configuration) (*Quasar, error)
func (*Quasar) CreateStream ¶
func (q *Quasar) CreateStream(ctx context.Context, uuid []byte, collection string, tags map[string]string, annotations map[string]string) bte.BTE
CreateStream makes a stream with the given uuid, collection and tags. Returns an error if the uuid already exists.
func (*Quasar) DeleteRange ¶
func (*Quasar) GetClusterConfiguration ¶
func (q *Quasar) GetClusterConfiguration() configprovider.ClusterConfiguration
func (*Quasar) GetKeyUsage ¶
func (q *Quasar) GetKeyUsage(ctx context.Context, prefix string) (tags map[string]int, anns map[string]int, err bte.BTE)
GetMetadataUsage returns the tags and annotations in use for a given collection prefix
func (*Quasar) GetStreamDescriptor ¶
func (q *Quasar) GetStreamDescriptor(ctx context.Context, uuid []byte) (res *mprovider.LookupResult, err bte.BTE)
Get a stream annotations and tags
func (*Quasar) GetStreamVersion ¶
func (q *Quasar) GetStreamVersion(ctx context.Context, uuid []byte) (major, minor uint64, err bte.BTE)
Get a stream annotations and tags
func (*Quasar) InitiateShutdown ¶
func (q *Quasar) InitiateShutdown() chan struct{}
func (*Quasar) InsertValues ¶
func (*Quasar) ListCollections ¶
func (q *Quasar) ListCollections(ctx context.Context, prefix string, startingFrom string, limit uint64) ([]string, bte.BTE)
ListCollections returns a list of collections beginning with prefix (which may be "") and starting from the given string. If number is > 0, only that many results will be returned. More can be obtained by re-calling ListCollections with a given startingFrom and number.
func (*Quasar) LookupStreams ¶
func (q *Quasar) LookupStreams(ctx context.Context, collection string, isCollectionPrefix bool, tags map[string]*string, annotations map[string]*string) (chan *mprovider.LookupResult, chan bte.BTE)
Return back all streams in all collections beginning with collection (or exactly equal if prefix is false) provided they have the given tags and annotations, where a nil entry in the map means has the tag but the value is irrelevant
func (*Quasar) ObliterateStream ¶
DeleteStream tombstones a stream
func (*Quasar) QueryChangedRanges ¶
func (q *Quasar) QueryChangedRanges(ctx context.Context, id uuid.UUID, startgen uint64, endgen uint64, resolution uint8) (chan ChangedRange, chan bte.BTE, uint64, uint64)
Resolution is how far down the tree to go when working out which blocks have changed. Higher resolutions are faster but will give you back coarser results.
func (*Quasar) QueryNearestValue ¶
func (*Quasar) QueryStatisticalValuesStream ¶
func (*Quasar) QueryValuesStream ¶
func (*Quasar) QueryWindow ¶
func (*Quasar) Rez ¶
func (q *Quasar) Rez() *rez.RezManager
func (*Quasar) SetStreamAnnotations ¶
func (q *Quasar) SetStreamAnnotations(ctx context.Context, uuid []byte, aver uint64, changes map[string]*string) bte.BTE
Sets the stream annotations. An entry with a nil string implies delete
func (*Quasar) StorageProvider ¶
func (q *Quasar) StorageProvider() bprovider.StorageProvider
type StatRecordSlice ¶
type StatRecordSlice []qtree.StatRecord
func (StatRecordSlice) Len ¶
func (srs StatRecordSlice) Len() int
func (StatRecordSlice) Less ¶
func (srs StatRecordSlice) Less(i, j int) bool
func (StatRecordSlice) Swap ¶
func (srs StatRecordSlice) Swap(i, j int)
type StorageInterface ¶
type StorageInterface interface { JP() jprovider.JournalProvider CP() configprovider.ClusterConfiguration //Unthrottled WritePrimaryStorage(ctx context.Context, id uuid.UUID, r []Record) (major uint64, err bte.BTE) //Appropriate locks will be held StreamMajorVersion(ctx context.Context, id uuid.UUID) (uint64, bte.BTE) }