hll

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCounterNotSet = errors.New("hll counter is not set")

ErrCounterNotSet reports a nil HLL counter dependency.

Functions

func CountHLL

func CountHLL(client Operator, namespace, set string, by []string, union bool) (int64, error)

CountHLL calculates amount of unique transactions by passed keys.

func CountHLLBin

func CountHLLBin(client Operator, namespace, set, by string) (int64, error)

func CountHLLByBinName

func CountHLLByBinName(client Operator, namespace, set, by, hllBinName string) (int64, error)

func CountIntersection

func CountIntersection(client Operator, namespace, set string, by []string) (int64, error)

func CountUnion

func CountUnion(client Operator, namespace, set string, by []string) (int64, error)

Types

type CountMode added in v1.1.0

type CountMode string

CountMode identifies an HLL count operation.

const (
	// CountModeIntersection counts values present in all HLL bins.
	CountModeIntersection CountMode = "intersection"
	// CountModeUnion counts values present in any HLL bin.
	CountModeUnion CountMode = "union"
)

type CountOptions added in v1.1.0

type CountOptions struct {
	Namespace string
	Set       string
	Keys      []string
	Bin       string
	Mode      CountMode
}

CountOptions is the core-owned input for HLL count helpers.

type CountResult added in v1.1.0

type CountResult struct {
	Count int64
}

CountResult is the core-owned result for HLL count helpers.

type Counter added in v1.1.0

type Counter interface {
	Count(ctx context.Context, options CountOptions) (CountResult, error)
}

Counter is the core-owned HLL counting contract for new consumers.

type Operator

type Operator interface {
	Operate(*aerospike.WritePolicy, *aerospike.Key, ...*aerospike.Operation) (*aerospike.Record, aerospike.Error)
}

type OperatorCounter added in v1.1.0

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

OperatorCounter adapts legacy Aerospike HLL operations to the Counter contract.

func NewCounter added in v1.1.0

func NewCounter(operator Operator) *OperatorCounter

NewCounter wraps an Aerospike HLL operator with the core-owned Counter contract.

func (*OperatorCounter) Count added in v1.1.0

func (c *OperatorCounter) Count(ctx context.Context, options CountOptions) (CountResult, error)

Count calculates HLL cardinality through core-owned options.

Jump to

Keyboard shortcuts

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