store

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bin

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

func NewBin

func NewBin(index int, count float64) (*Bin, error)

func (*Bin) Count

func (b *Bin) Count() float64

func (*Bin) Index

func (b *Bin) Index() int

type CollapsingHighestDenseStore

type CollapsingHighestDenseStore struct {
	DenseStore
	// contains filtered or unexported fields
}

func NewCollapsingHighestDenseStore

func NewCollapsingHighestDenseStore(maxNumBins int) *CollapsingHighestDenseStore

func (*CollapsingHighestDenseStore) Add

func (s *CollapsingHighestDenseStore) Add(index int)

func (*CollapsingHighestDenseStore) AddBin

func (s *CollapsingHighestDenseStore) AddBin(bin Bin)

func (*CollapsingHighestDenseStore) AddWithCount

func (s *CollapsingHighestDenseStore) AddWithCount(index int, count float64)

func (*CollapsingHighestDenseStore) Copy

func (*CollapsingHighestDenseStore) MergeWith

func (s *CollapsingHighestDenseStore) MergeWith(other Store)

type CollapsingLowestDenseStore

type CollapsingLowestDenseStore struct {
	DenseStore
	// contains filtered or unexported fields
}

CollapsingLowestDenseStore is a dynamically growing contiguous (non-sparse) store. The lower bins get combined so that the total number of bins do not exceed maxNumBins.

func NewCollapsingLowestDenseStore

func NewCollapsingLowestDenseStore(maxNumBins int) *CollapsingLowestDenseStore

func (*CollapsingLowestDenseStore) Add

func (s *CollapsingLowestDenseStore) Add(index int)

func (*CollapsingLowestDenseStore) AddBin

func (s *CollapsingLowestDenseStore) AddBin(bin Bin)

func (*CollapsingLowestDenseStore) AddWithCount

func (s *CollapsingLowestDenseStore) AddWithCount(index int, count float64)

func (*CollapsingLowestDenseStore) Copy

func (*CollapsingLowestDenseStore) MergeWith

func (s *CollapsingLowestDenseStore) MergeWith(other Store)

type DenseStore

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

DenseStore is a dynamically growing contiguous (non-sparse) store. The number of bins are bound only by the size of the slice that can be allocated.

func FromProto

func FromProto(pb *sketchpb.Store) *DenseStore

Returns an instance of DenseStore that contains the data in the provided protobuf representation.

func NewDenseStore

func NewDenseStore() *DenseStore

func (*DenseStore) Add

func (s *DenseStore) Add(index int)

func (*DenseStore) AddBin

func (s *DenseStore) AddBin(bin Bin)

func (*DenseStore) AddWithCount

func (s *DenseStore) AddWithCount(index int, count float64)

func (*DenseStore) Bins

func (s *DenseStore) Bins() <-chan Bin

func (*DenseStore) Copy

func (s *DenseStore) Copy() Store

func (*DenseStore) IsEmpty

func (s *DenseStore) IsEmpty() bool

func (*DenseStore) KeyAtRank

func (s *DenseStore) KeyAtRank(rank float64) int

Return the key for the value at rank

func (*DenseStore) MaxIndex

func (s *DenseStore) MaxIndex() (int, error)

func (*DenseStore) MergeWith

func (s *DenseStore) MergeWith(other Store)

func (*DenseStore) MinIndex

func (s *DenseStore) MinIndex() (int, error)

func (*DenseStore) ToProto

func (s *DenseStore) ToProto() *sketchpb.Store

func (*DenseStore) TotalCount

func (s *DenseStore) TotalCount() float64

type Store

type Store interface {
	Add(index int)
	AddBin(bin Bin)
	AddWithCount(index int, count float64)
	Bins() <-chan Bin
	Copy() Store
	IsEmpty() bool
	MaxIndex() (int, error)
	MinIndex() (int, error)
	TotalCount() float64
	KeyAtRank(rank float64) int
	MergeWith(store Store)
	ToProto() *sketchpb.Store
}

Jump to

Keyboard shortcuts

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