cube

package
v0.0.0-...-75137db Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2013 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertTestCube

func InsertTestCube(c *Cube, d1 int, d2 int, A1 int, A2 int)

func NewPgBatchOperator

func NewPgBatchOperator(parse func(stream.Object) (Dimensions, Aggregates),
	downstreamProcessed stream.ProcessedNotifier) stream.Operator

Types

type Aggregate

type Aggregate interface {
	Merge(with Aggregate)
}

type Aggregates

type Aggregates interface{}

type CountAggregate

type CountAggregate int

func NewCountAggregate

func NewCountAggregate(n int) *CountAggregate

func (*CountAggregate) Merge

func (a *CountAggregate) Merge(with Aggregate)

type Cube

type Cube struct {
	Dimensions Dimensions
	Aggregates Aggregates
	// contains filtered or unexported fields
}

func NewCube

func NewCube(dimensions Dimensions, aggregates Aggregates) *Cube

func NewTestCube

func NewTestCube() *Cube

func (*Cube) Data

func (c *Cube) Data() map[Dimensions]Aggregates

func (Cube) GetAggregates

func (c Cube) GetAggregates() Aggregates

func (Cube) GetDimensions

func (c Cube) GetDimensions() Dimensions

func (*Cube) Insert

func (c *Cube) Insert(dimensions Dimensions, aggregates Aggregates)

func (*Cube) Visit

func (c *Cube) Visit(v func(Dimensions, Aggregates))

type CubeDescriber

type CubeDescriber interface {
	GetDimensions() Dimensions
	GetAggregates() Aggregates
}

type Cuber

type Cuber interface {
	Insert(dimensions Dimensions, aggregates Aggregates)
	Visit(func(Dimensions, Aggregates))
}

type Dimension

type Dimension interface{}

type Dimensions

type Dimensions interface{}

type HllAggregate

type HllAggregate struct {
	Hll *hll.Hll
}

@TODO -- expand this to work with HLLs

func NewHllAggregate

func NewHllAggregate(val string) *HllAggregate

func NewHllAggregateFromBytes

func NewHllAggregateFromBytes(val []byte) *HllAggregate

func (*HllAggregate) Merge

func (a *HllAggregate) Merge(with Aggregate)

type HllDimension

type HllDimension struct {
	Hll *hll.Hll
}

func NewHllDimension

func NewHllDimension(i *hll.Hll) *HllDimension

type IntDimension

type IntDimension int

func NewIntDimension

func NewIntDimension(i int) *IntDimension

type Partition

type Partition interface{}

func NewTimePartition

func NewTimePartition(t time.Time, td time.Duration) Partition

type PartitionVisitor

type PartitionVisitor interface {
	VisitPartitions(visitor func(Partition, Cuber))
}

type PartitionedCube

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

func NewPartitionedCube

func NewPartitionedCube(partitioner func(Dimensions) Partition) *PartitionedCube

func (*PartitionedCube) AddPartition

func (c *PartitionedCube) AddPartition(p Partition, upc Cuber)

func (*PartitionedCube) Insert

func (c *PartitionedCube) Insert(dimensions Dimensions, aggregates Aggregates)

func (*PartitionedCube) Merge

func (c *PartitionedCube) Merge(update *PartitionedCube)

func (*PartitionedCube) Visit

func (c *PartitionedCube) Visit(visitor func(Dimensions, Aggregates))

func (*PartitionedCube) VisitPartitions

func (c *PartitionedCube) VisitPartitions(visitor func(Partition, Cuber))

type RepartitionableCube

type RepartitionableCube interface {
	Cuber
	PartitionVisitor
	AddPartition(Partition, Cuber)
}

type RepartitionedCube

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

func NewRepartitionedCube

func NewRepartitionedCube(innerpartitioner func(d Dimensions) Partition,
	outerpartitioner func(inner Partition) (outer Partition)) *RepartitionedCube

func (*RepartitionedCube) Add

func (*RepartitionedCube) Insert

func (c *RepartitionedCube) Insert(dimensions Dimensions, aggregates Aggregates)

func (*RepartitionedCube) VisitPartitions

func (c *RepartitionedCube) VisitPartitions(visitor func(Partition, Cuber))

type StringDimension

type StringDimension string

func NewStringDimension

func NewStringDimension(i string) *StringDimension

type TestCubeAggregates

type TestCubeAggregates struct {
	A1 *CountAggregate `db:"a1"`
	A2 *CountAggregate `db:"a2"`
}

type TestCubeDimensions

type TestCubeDimensions struct {
	D1 IntDimension `db:"d1"`
	D2 IntDimension `db:"d2"`
}

type TimeDimension

type TimeDimension time.Time

func NewTimeDimension

func NewTimeDimension(t time.Time) *TimeDimension

func (*TimeDimension) Time

func (t *TimeDimension) Time() time.Time

func (*TimeDimension) Unix

func (t *TimeDimension) Unix() int64

type TimeIndexedDimensions

type TimeIndexedDimensions interface {
	TimeIndex() time.Time
}

type TimePartition

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

func (*TimePartition) Duration

func (tp *TimePartition) Duration() time.Duration

func (*TimePartition) Time

func (tp *TimePartition) Time() time.Time

type TimePartitionedCube

type TimePartitionedCube struct {
	*PartitionedCube
	// contains filtered or unexported fields
}

func NewTimePartitionedCube

func NewTimePartitionedCube(td time.Duration) *TimePartitionedCube

func (*TimePartitionedCube) FlushItems

func (c *TimePartitionedCube) FlushItems() *TimePartitionedCube

func (*TimePartitionedCube) HasItems

func (c *TimePartitionedCube) HasItems() bool

func (*TimePartitionedCube) Insert

func (c *TimePartitionedCube) Insert(dimensions Dimensions, aggregates Aggregates)

func (*TimePartitionedCube) NumPartitions

func (c *TimePartitionedCube) NumPartitions() int

func (*TimePartitionedCube) PopTopPartition

func (c *TimePartitionedCube) PopTopPartition() (Partition, Cuber)

type TimePartitionedCubeContainer

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

func (*TimePartitionedCubeContainer) Add

func (*TimePartitionedCubeContainer) Flush

func (cont *TimePartitionedCubeContainer) Flush(outch chan<- stream.Object) bool

func (*TimePartitionedCubeContainer) FlushAll

func (cont *TimePartitionedCubeContainer) FlushAll(outch chan<- stream.Object) bool

func (*TimePartitionedCubeContainer) HasItems

func (cont *TimePartitionedCubeContainer) HasItems() bool

type TimeRepartitionedCube

type TimeRepartitionedCube struct {
	*RepartitionedCube
	// contains filtered or unexported fields
}

func NewTimeRepartitionedCube

func NewTimeRepartitionedCube(originaltd time.Duration, newtd time.Duration) *TimeRepartitionedCube

func (*TimeRepartitionedCube) HasItems

func (c *TimeRepartitionedCube) HasItems() bool

Directories

Path Synopsis
pg
hll

Jump to

Keyboard shortcuts

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