Documentation
¶
Overview ¶
Offers up a recipe built on Gossie to make dealing with time indexes simple.
Index ¶
- type Item
- type Iterator
- type Marshaler
- type SecondaryIndexer
- type TimeSeries
- func (ts *TimeSeries) Delete(writer gossie.Writer, item interface{}) error
- func (ts *TimeSeries) Iterator(start, end time.Time, from, secondaryIndex string) Iterator
- func (ts *TimeSeries) Map(writer gossie.Writer, item, lastRead interface{}) error
- func (ts *TimeSeries) ReversedIterator(start, end time.Time, from, secondaryIndex string) Iterator
- func (ts *TimeSeries) RowKeyAndColumnName(item interface{}) ([]byte, []byte)
- func (ts *TimeSeries) UnboundedIterator(secondaryIndex string) (Iterator, error)
- type Ttler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents something fetched from timeseries
type Iterator ¶
Iterator represents a slice of our time series that can be looped through, loading on-demand
type SecondaryIndexer ¶
type SecondaryIndexer func(i interface{}) (index string)
SecondaryIndexer turns each item into a secondary index ID
type TimeSeries ¶
type TimeSeries struct {
Ks, Cf string
// RowGranularity defines how small or large our row sizes are (how much time each represents)
RowGranularity time.Duration
// Marshaler is used to turn a an interface{} into a UID and time (for each item)
Marshaler Marshaler
// Secondary indexer is either nil (if none) or a function to extract the secondary
// index ID from each item
SecondaryIndexer SecondaryIndexer
// IndexCf defines whether we should keep an overall index of the data (meaning we can skip rows on read and also do open-ended iterators)
IndexCf string
// Ttler is a function for calculating a TTL to apply to written columns
Ttler Ttler
}
TimeSeries represents a single C* time series index on some data
func (*TimeSeries) Delete ¶
func (ts *TimeSeries) Delete(writer gossie.Writer, item interface{}) error
Delete an item from the timeseries (remove the column entirely)
func (*TimeSeries) Iterator ¶
func (ts *TimeSeries) Iterator(start, end time.Time, from, secondaryIndex string) Iterator
Iterator yields a new iterator that will loop through all time series Items within the specified range - loading from C* on-demand
func (*TimeSeries) Map ¶
func (ts *TimeSeries) Map(writer gossie.Writer, item, lastRead interface{}) error
Map will write in any mutations needed to maintain this timeseries index based on the current item and the lastRead item
func (*TimeSeries) ReversedIterator ¶
func (ts *TimeSeries) ReversedIterator(start, end time.Time, from, secondaryIndex string) Iterator
ReversedIterator yields a new iterator that will loop through all time series Items within the specified range - loading from C* on-demand - in reverse order
func (*TimeSeries) RowKeyAndColumnName ¶
func (ts *TimeSeries) RowKeyAndColumnName(item interface{}) ([]byte, []byte)
func (*TimeSeries) UnboundedIterator ¶
func (ts *TimeSeries) UnboundedIterator(secondaryIndex string) (Iterator, error)
UnboundedIterator yields a new iterator that will loop through every item within a time series