zetasketch

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default_AggregatorStateProto_EncodingVersion = int32(1)
)

Default values for AggregatorStateProto fields.

Variables

View Source
var (
	AggregatorType_name = map[int32]string{
		100: "SUM",
		112: "HYPERLOGLOG_PLUS_UNIQUE",
	}
	AggregatorType_value = map[string]int32{
		"SUM":                     100,
		"HYPERLOGLOG_PLUS_UNIQUE": 112,
	}
)

Enum value maps for AggregatorType.

View Source
var (
	DefaultOpsType_Id_name = map[int32]string{
		0:  "UNKNOWN",
		1:  "INT8",
		2:  "INT16",
		3:  "INT32",
		4:  "INT64",
		5:  "UINT8",
		6:  "UINT16",
		7:  "UINT32",
		8:  "UINT64",
		9:  "FLOAT",
		10: "DOUBLE",
		11: "BYTES_OR_UTF8_STRING",
	}
	DefaultOpsType_Id_value = map[string]int32{
		"UNKNOWN":              0,
		"INT8":                 1,
		"INT16":                2,
		"INT32":                3,
		"INT64":                4,
		"UINT8":                5,
		"UINT16":               6,
		"UINT32":               7,
		"UINT64":               8,
		"FLOAT":                9,
		"DOUBLE":               10,
		"BYTES_OR_UTF8_STRING": 11,
	}
)

Enum value maps for DefaultOpsType_Id.

View Source
var (
	// Meant to be used on Id values, which represent types. Specifies the
	// unsigned counterpart to the type.
	//
	// optional zetasketch.DefaultOpsType.Id unsigned_counterpart = 132643189;
	E_DefaultOpsType_UnsignedCounterpart = &file_aggregator_proto_extTypes[0]
)

Extension fields to descriptorpb.EnumValueOptions.

View Source
var (
	// This field id should match AggregatorType.HYPERLOGLOG_PLUS_UNIQUE
	//
	// optional zetasketch.UniqueStatsProto hyperloglog_plus_unique_stats = 112;
	E_HyperloglogPlusUniqueStats = &file_hllplus_unique_proto_extTypes[0]
)

Extension fields to AggregatorStatsProto.

View Source
var (
	// This field id should match AggregatorType.HYPERLOGLOG_PLUS_UNIQUE
	//
	// optional zetasketch.HyperLogLogPlusUniqueStateProto hyperloglogplus_unique_state = 112;
	E_HyperloglogplusUniqueState = &file_hllplus_unique_proto_extTypes[1]
)

Extension fields to AggregatorStateProto.

View Source
var File_aggregator_proto protoreflect.FileDescriptor
View Source
var File_hllplus_unique_proto protoreflect.FileDescriptor
View Source
var File_unique_stats_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AggregatorStateProto

type AggregatorStateProto struct {

	// The type of the aggregator.
	Type      *AggregatorType `protobuf:"varint,1,req,name=type,enum=zetasketch.AggregatorType" json:"type,omitempty"`
	NumValues *int64          `protobuf:"varint,2,req,name=num_values,json=numValues" json:"num_values,omitempty"`
	// Version of the encoded internal state. On a per-aggregator basis, set this
	// field to indicate that the format of the aggregator encoding has changed
	// such that the library has to decide how to decode. Do NOT change the
	// default value, as this affects all aggregators.
	EncodingVersion *int32 `protobuf:"varint,3,opt,name=encoding_version,json=encodingVersion,def=1" json:"encoding_version,omitempty"`
	// Specifies the value type for the aggregation.
	//
	// If the value type is one supported by the DefaultOps<T> template, and that
	// set of operations (or a compatible implementation) was used, then this will
	// be a value of the DefaultOpsType.Id enum.
	//
	// Otherwise, this is a globally unique number corresponding to the value and
	// Ops implementation (e.g. the CL number in which the implementation is
	// defined). Values for custom types should be greater than 1000. Implementors
	// should consider registering a name for their custom type in
	// custom-value-type.proto, to facilitate easier discovery and better error
	// messages when conflicting types are merged.
	ValueType *int32 `protobuf:"varint,4,opt,name=value_type,json=valueType" json:"value_type,omitempty"`
	// contains filtered or unexported fields
}

Serialized state of an aggregator. Add additional fields here only if they make sense for all algorithms and if it doesn't make sense to expose them to the users of the library, e.g. encoding version.

func (*AggregatorStateProto) Descriptor deprecated

func (*AggregatorStateProto) Descriptor() ([]byte, []int)

Deprecated: Use AggregatorStateProto.ProtoReflect.Descriptor instead.

func (*AggregatorStateProto) GetEncodingVersion

func (x *AggregatorStateProto) GetEncodingVersion() int32

func (*AggregatorStateProto) GetNumValues

func (x *AggregatorStateProto) GetNumValues() int64

func (*AggregatorStateProto) GetType

func (x *AggregatorStateProto) GetType() AggregatorType

func (*AggregatorStateProto) GetValueType

func (x *AggregatorStateProto) GetValueType() int32

func (*AggregatorStateProto) ProtoMessage

func (*AggregatorStateProto) ProtoMessage()

func (*AggregatorStateProto) ProtoReflect

func (x *AggregatorStateProto) ProtoReflect() protoreflect.Message

func (*AggregatorStateProto) Reset

func (x *AggregatorStateProto) Reset()

func (*AggregatorStateProto) String

func (x *AggregatorStateProto) String() string

type AggregatorStatsProto

type AggregatorStatsProto struct {

	// Total number of values added to this aggregator.
	NumValues *int64 `protobuf:"varint,1,req,name=num_values,json=numValues" json:"num_values,omitempty"`
	// contains filtered or unexported fields
}

This message contains common "public" properties of an aggregation algorithm. Add additional fields here only if they make sense for all algorithms.

func (*AggregatorStatsProto) Descriptor deprecated

func (*AggregatorStatsProto) Descriptor() ([]byte, []int)

Deprecated: Use AggregatorStatsProto.ProtoReflect.Descriptor instead.

func (*AggregatorStatsProto) GetNumValues

func (x *AggregatorStatsProto) GetNumValues() int64

func (*AggregatorStatsProto) ProtoMessage

func (*AggregatorStatsProto) ProtoMessage()

func (*AggregatorStatsProto) ProtoReflect

func (x *AggregatorStatsProto) ProtoReflect() protoreflect.Message

func (*AggregatorStatsProto) Reset

func (x *AggregatorStatsProto) Reset()

func (*AggregatorStatsProto) String

func (x *AggregatorStatsProto) String() string

type AggregatorType

type AggregatorType int32

Enumeration of all supported aggregation algorithms. Values should start from 100.

const (
	// Sum all values added to the aggregator.
	AggregatorType_SUM AggregatorType = 100
	// Computes a cardinality estimation using the HyperLogLog++ algorithm.
	AggregatorType_HYPERLOGLOG_PLUS_UNIQUE AggregatorType = 112
)

func (AggregatorType) Descriptor

func (AggregatorType) Enum

func (x AggregatorType) Enum() *AggregatorType

func (AggregatorType) EnumDescriptor deprecated

func (AggregatorType) EnumDescriptor() ([]byte, []int)

Deprecated: Use AggregatorType.Descriptor instead.

func (AggregatorType) Number

func (AggregatorType) String

func (x AggregatorType) String() string

func (AggregatorType) Type

func (*AggregatorType) UnmarshalJSON deprecated

func (x *AggregatorType) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type AggregatorValueStatsProto

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

Additional metadata for each element in the result iterator.

func (*AggregatorValueStatsProto) Descriptor deprecated

func (*AggregatorValueStatsProto) Descriptor() ([]byte, []int)

Deprecated: Use AggregatorValueStatsProto.ProtoReflect.Descriptor instead.

func (*AggregatorValueStatsProto) ProtoMessage

func (*AggregatorValueStatsProto) ProtoMessage()

func (*AggregatorValueStatsProto) ProtoReflect

func (*AggregatorValueStatsProto) Reset

func (x *AggregatorValueStatsProto) Reset()

func (*AggregatorValueStatsProto) String

func (x *AggregatorValueStatsProto) String() string

type DefaultOpsType

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

Never instantiated, just for scoping an enum and associated options.

func (*DefaultOpsType) Descriptor deprecated

func (*DefaultOpsType) Descriptor() ([]byte, []int)

Deprecated: Use DefaultOpsType.ProtoReflect.Descriptor instead.

func (*DefaultOpsType) ProtoMessage

func (*DefaultOpsType) ProtoMessage()

func (*DefaultOpsType) ProtoReflect

func (x *DefaultOpsType) ProtoReflect() protoreflect.Message

func (*DefaultOpsType) Reset

func (x *DefaultOpsType) Reset()

func (*DefaultOpsType) String

func (x *DefaultOpsType) String() string

type DefaultOpsType_Id

type DefaultOpsType_Id int32

Each value corresponds to a C++ type T and its corresponding DefaultOps<T> instantiation. A ValueOps implementation returning something other than UNKNOWN for a given value is promising that the value of the type corresponding to the value, and that the Ops implementation performs identical operations as DefaultOps<T> for that type.

const (
	DefaultOpsType_UNKNOWN DefaultOpsType_Id = 0
	// int8, DefaultOps<int8>
	// SerializeToString writes the single 2s-complement byte.
	DefaultOpsType_INT8 DefaultOpsType_Id = 1
	// int16, DefaultOps<int16>
	// SerializeToString writes the two little-endian 2s-complement bytes.
	DefaultOpsType_INT16 DefaultOpsType_Id = 2
	// int32, DefaultOps<int32>
	// SerializeToString uses varint encoding of the 2s complement in 32 bits -
	// i.e. the result for negative integers is 5 bytes long, not 10.
	DefaultOpsType_INT32 DefaultOpsType_Id = 3
	// int64, DefaultOps<int64>
	// SerializeToString uses varint encoding of the 2s complement.
	DefaultOpsType_INT64 DefaultOpsType_Id = 4
	// uint8, DefaultOps<uint8>
	// SerializeToString writes the single byte.
	DefaultOpsType_UINT8 DefaultOpsType_Id = 5
	// uint16, DefaultOps<uint16>
	// SerializeToString writes the two little-endian bytes.
	DefaultOpsType_UINT16 DefaultOpsType_Id = 6
	// uint32, DefaultOps<uint32>
	// SerializeToString uses varint encoding.
	DefaultOpsType_UINT32 DefaultOpsType_Id = 7
	// uint64, DefaultOps<uint64>
	// SerializeToString uses varint encoding.
	DefaultOpsType_UINT64 DefaultOpsType_Id = 8
	// float, DefaultOps<float>
	// SerializeToString encodes the 4 little endian IEEE754 bytes.
	DefaultOpsType_FLOAT DefaultOpsType_Id = 9
	// double, DefaultOps<double>
	// SerializeToString encodes the 8 little endian IEEE754 bytes.
	DefaultOpsType_DOUBLE DefaultOpsType_Id = 10
	// string, DefaultOps<string>
	// SerializeToString just copies the bytes.
	DefaultOpsType_BYTES_OR_UTF8_STRING DefaultOpsType_Id = 11
)

func (DefaultOpsType_Id) Descriptor

func (DefaultOpsType_Id) Enum

func (DefaultOpsType_Id) EnumDescriptor deprecated

func (DefaultOpsType_Id) EnumDescriptor() ([]byte, []int)

Deprecated: Use DefaultOpsType_Id.Descriptor instead.

func (DefaultOpsType_Id) Number

func (DefaultOpsType_Id) String

func (x DefaultOpsType_Id) String() string

func (DefaultOpsType_Id) Type

func (*DefaultOpsType_Id) UnmarshalJSON deprecated

func (x *DefaultOpsType_Id) UnmarshalJSON(b []byte) error

Deprecated: Do not use.

type HyperLogLogPlusUniqueStateProto

type HyperLogLogPlusUniqueStateProto struct {

	// Size of sparse list, i.e., how many different indexes are present in
	// "sparse_data".
	SparseSize *int32 `protobuf:"varint,2,opt,name=sparse_size,json=sparseSize" json:"sparse_size,omitempty"`
	// Precision / number of buckets for the normal representation.
	//
	// This field is used slightly differently across the v1 and v2 versions of
	// the algorithm (see the encoding_version field in the AggregatorStateProto):
	//
	//   * In v1 this field is the total number of buckets 2^p where "p" is the
	//     requested precision. Accepted values are powers of two in the [2^10,
	//     2^24] interval.
	//   * In v2 this field is the precision "p" directly. Accepted values are in
	//     the range [10, 24].
	//
	// Encoding the precision rather than the number of buckets allows us to save
	// 1-2 bytes which makes a fair difference when storing many small
	// cardinalities.
	//
	// Note that different implementations might choose to not support the whole
	// range of precisions from [10, 24].
	PrecisionOrNumBuckets *int32 `protobuf:"varint,3,opt,name=precision_or_num_buckets,json=precisionOrNumBuckets" json:"precision_or_num_buckets,omitempty"`
	// Precision / number of buckets for sparse representation.
	//
	// This field is used slightly differently across the v1 and v2 versions of
	// the algorithm (see the encoding_version field in the AggregatorStateProto):
	//
	//   * In v1 this field is 2^sp where "sp" is the sparse precision. Accepted
	//     values are powers of two in the [2^p, 2^25] interval.
	//   * In v2 this field represents the precision "sp" directly. Accepted
	//     values are in the range [p, 25].
	//
	// Encoding the precision rather than the number of buckets allows us to save
	// 2-3 bytes which makes a fair difference when storing many small
	// cardinalities.
	SparsePrecisionOrNumBuckets *int32 `` /* 142-byte string literal not displayed */
	// Normal data representation. If this field is populated, there are exactly
	// 2^p bytes in it.
	//
	// data[idx] represents rhoW for the substream with the given "idx". See the
	// the HLL++ paper (https://goo.gl/pc916Z) for a description of how "rhoW" and
	// "idx" are computed.
	Data []byte `protobuf:"bytes,5,opt,name=data" json:"data,omitempty"`
	// Sparse data representation.
	//
	// IMPORTANT: It is considered an error if the size of this field is bigger
	// than precision_or_num_buckets (v1), resp. 2^precision_or_num_buckets (v2).
	// The normal encoding should be used in this case since the memory usage
	// would be smaller.
	//
	// For a sorted list of unsigned integers representing sparse data encodings,
	// this field contains the varint encoding for the differences between
	// consecutive values in the list:
	//   list[0], list[1] - list[0], ... , list[n] - list[n - 1]
	// Note: if "encoding_version" of the enclosing AggregatorStateProto is 1, the
	// diffs are encoded as signed varints using ZigZag encoding and the
	// sparse encodings are the ones defined in the HLL++ paper
	// (https://goo.gl/pc916Z), i.e., different than the ones below.
	//
	// In v2, there are two encodings possible for a value in sparse data format:
	// enc(idx, rhoW) = 1) 1 << (max(sp, p+6)) | (idx >> (sp - p)) | rhoW
	//                    if the last sp - p bits of idx are all 0;
	//                  2) idx, otherwise.
	SparseData []byte `protobuf:"bytes,6,opt,name=sparse_data,json=sparseData" json:"sparse_data,omitempty"`
	// contains filtered or unexported fields
}

Represents an HLL++ aggregator in either sparse or normal representation. For more details on the algorithm, the representations and the concepts please check the HLL++ paper (https://goo.gl/pc916Z).

func (*HyperLogLogPlusUniqueStateProto) Descriptor deprecated

func (*HyperLogLogPlusUniqueStateProto) Descriptor() ([]byte, []int)

Deprecated: Use HyperLogLogPlusUniqueStateProto.ProtoReflect.Descriptor instead.

func (*HyperLogLogPlusUniqueStateProto) GetData

func (x *HyperLogLogPlusUniqueStateProto) GetData() []byte

func (*HyperLogLogPlusUniqueStateProto) GetPrecisionOrNumBuckets

func (x *HyperLogLogPlusUniqueStateProto) GetPrecisionOrNumBuckets() int32

func (*HyperLogLogPlusUniqueStateProto) GetSparseData

func (x *HyperLogLogPlusUniqueStateProto) GetSparseData() []byte

func (*HyperLogLogPlusUniqueStateProto) GetSparsePrecisionOrNumBuckets

func (x *HyperLogLogPlusUniqueStateProto) GetSparsePrecisionOrNumBuckets() int32

func (*HyperLogLogPlusUniqueStateProto) GetSparseSize

func (x *HyperLogLogPlusUniqueStateProto) GetSparseSize() int32

func (*HyperLogLogPlusUniqueStateProto) ProtoMessage

func (*HyperLogLogPlusUniqueStateProto) ProtoMessage()

func (*HyperLogLogPlusUniqueStateProto) ProtoReflect

func (*HyperLogLogPlusUniqueStateProto) Reset

func (*HyperLogLogPlusUniqueStateProto) String

type UniqueStatsProto

type UniqueStatsProto struct {

	// The estimated number of unique elements in the input set.
	EstimatedCardinality *int64 `protobuf:"varint,1,opt,name=estimated_cardinality,json=estimatedCardinality" json:"estimated_cardinality,omitempty"`
	// The expected error of the estimation algorithm.
	ExpectedError *float64 `protobuf:"fixed64,2,opt,name=expected_error,json=expectedError" json:"expected_error,omitempty"`
	// contains filtered or unexported fields
}

func (*UniqueStatsProto) Descriptor deprecated

func (*UniqueStatsProto) Descriptor() ([]byte, []int)

Deprecated: Use UniqueStatsProto.ProtoReflect.Descriptor instead.

func (*UniqueStatsProto) GetEstimatedCardinality

func (x *UniqueStatsProto) GetEstimatedCardinality() int64

func (*UniqueStatsProto) GetExpectedError

func (x *UniqueStatsProto) GetExpectedError() float64

func (*UniqueStatsProto) ProtoMessage

func (*UniqueStatsProto) ProtoMessage()

func (*UniqueStatsProto) ProtoReflect

func (x *UniqueStatsProto) ProtoReflect() protoreflect.Message

func (*UniqueStatsProto) Reset

func (x *UniqueStatsProto) Reset()

func (*UniqueStatsProto) String

func (x *UniqueStatsProto) String() string

Jump to

Keyboard shortcuts

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