compress

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Overview

Copyright (c) 2018-2020 Blockwatch Data Inc. Author: alex@blockwatch.cc

Original from: InfluxData, MIT https://github.com/influxdata/influxdb

Copyright (c) 2018-2022 Blockwatch Data Inc. Author: stefan@blockwatch.cc

Copyright (c) 2018-2020 Blockwatch Data Inc. Author: alex@blockwatch.cc

Original from: InfluxData, MIT https://github.com/influxdata/influxdb

Copyright (c) 2018-2022 Blockwatch Data Inc. Author: alex@blockwatch.cc

Original from: InfluxData, MIT https://github.com/influxdata/influxdb

Copyright (c) 2018-2020 Blockwatch Data Inc. Author: alex@blockwatch.cc

Original From: InfluxData, MIT https://github.com/influxdata/influxdb

Index

Constants

View Source
const (
	// same as in block
	DefaultMaxPointsPerBlock = 1 << 16
)

Variables

This section is empty.

Functions

func ArrayDecodeAllInt16

func ArrayDecodeAllInt16(b []byte, dst []int16) ([]int16, error)

func ArrayDecodeAllInt32

func ArrayDecodeAllInt32(b []byte, dst []int32) ([]int32, error)

func ArrayDecodeAllInt64

func ArrayDecodeAllInt64(b []byte, dst []int64) ([]int64, error)

func ArrayDecodeAllInt8

func ArrayDecodeAllInt8(b []byte, dst []int8) ([]int8, error)

func ArrayDecodeAllUint16

func ArrayDecodeAllUint16(b []byte, dst []uint16) ([]uint16, error)

func ArrayDecodeAllUint32

func ArrayDecodeAllUint32(b []byte, dst []uint32) ([]uint32, error)

func ArrayDecodeAllUint64

func ArrayDecodeAllUint64(b []byte, dst []uint64) ([]uint64, error)

func ArrayDecodeAllUint8

func ArrayDecodeAllUint8(b []byte, dst []uint8) ([]uint8, error)

func ArrayEncodeAllInt16

func ArrayEncodeAllInt16(src []int16, w io.Writer) (int, error)

func ArrayEncodeAllInt32

func ArrayEncodeAllInt32(src []int32, w io.Writer) (int, error)

func ArrayEncodeAllInt64

func ArrayEncodeAllInt64(src []int64, w io.Writer) (int, error)

func ArrayEncodeAllInt8

func ArrayEncodeAllInt8(src []int8, w io.Writer) (int, error)

func ArrayEncodeAllUint16

func ArrayEncodeAllUint16(src []uint16, w io.Writer) (int, error)

func ArrayEncodeAllUint32

func ArrayEncodeAllUint32(src []uint32, w io.Writer) (int, error)

func ArrayEncodeAllUint64

func ArrayEncodeAllUint64(src []uint64, w io.Writer) (int, error)

func ArrayEncodeAllUint8

func ArrayEncodeAllUint8(src []uint8, w io.Writer) (int, error)

func BitsetDecodeAll

func BitsetDecodeAll(b []byte, dst *vec.Bitset) (*vec.Bitset, error)

func BitsetEncodeAll

func BitsetEncodeAll(src *vec.Bitset, w io.Writer) (int, error)

func BitsetEncodedSize

func BitsetEncodedSize(b *vec.Bitset) int

func Delta8DecodeUint64

func Delta8DecodeUint64(data []uint64)

func Delta8EncodeUint64

func Delta8EncodeUint64(data []uint64) uint64

func Float32ArrayEncodedSize

func Float32ArrayEncodedSize(src []float32) int

upper bound

func Float64ArrayEncodedSize

func Float64ArrayEncodedSize(src []float64) int

upper bound

func FloatArrayDecodeAll

func FloatArrayDecodeAll(b []byte, buf []float64) ([]float64, error)

func FloatArrayEncodeAll

func FloatArrayEncodeAll(src []float64, w io.Writer) (int, error)

FloatArrayEncodeAll encodes src into b, returning b and any error encountered. The returned slice may be of a different length and capactity to b.

Currently only the float compression scheme used in Facebook's Gorilla is supported, so this method implements a batch oriented version of that.

func HasNegUint64

func HasNegUint64(data []uint64) bool

func Int128ArrayEncodedSize

func Int128ArrayEncodedSize(src vec.Int128LLSlice) int

upper bound, may store uncompressed 64bit strides

func Int16ArrayEncodedSize

func Int16ArrayEncodedSize(src []int16) int

upper bound, s8b may inflate

func Int256ArrayEncodedSize

func Int256ArrayEncodedSize(src vec.Int256LLSlice) int

upper bound, may store uncompressed 64bit strides

func Int32ArrayEncodedSize

func Int32ArrayEncodedSize(src []int32) int

upper bound, s8b may inflate

func Int64ArrayEncodedSize

func Int64ArrayEncodedSize(src []int64) int

upper bound, may store uncompressed 64bit

func Int8ArrayEncodedSize

func Int8ArrayEncodedSize(src []int8) int

upper bound

func MaxUint64

func MaxUint64(data []uint64) uint64

func PackBytes

func PackBytes(src []uint64, nbytes int, buf []byte) ([]byte, error)

func ReintepretInt16ToUint16Slice

func ReintepretInt16ToUint16Slice(src []int16) []uint16

func ReintepretInt32ToUint32Slice

func ReintepretInt32ToUint32Slice(src []int32) []uint32

func ReintepretInt64ToUint64Slice

func ReintepretInt64ToUint64Slice(src []int64) []uint64

func ReintepretInt8ToUint8Slice

func ReintepretInt8ToUint8Slice(src []int8) []uint8

func ReintepretUint16ToInt16Slice

func ReintepretUint16ToInt16Slice(src []uint16) []int16

func ReintepretUint32ToInt32Slice

func ReintepretUint32ToInt32Slice(src []uint32) []int32

func ReintepretUint64ToInt64Slice

func ReintepretUint64ToInt64Slice(src []uint64) []int64

func ReintepretUint8ToInt8Slice

func ReintepretUint8ToInt8Slice(src []uint8) []int8

func TimeArrayDecodeAll

func TimeArrayDecodeAll(b []byte, dst []int64) ([]int64, error)

func TimeArrayEncodeAll

func TimeArrayEncodeAll(src []int64, w io.Writer) (int, error)

TimeArrayEncodeAll encodes src into b, returning b and any error encountered. The returned slice may be of a different length and capacity to b.

TimeArrayEncodeAll implements batch oriented versions of the six integer encoding types we support: uncompressed, simple8b and RLE and their zigzag encoded versions.

When timestamp values to be encoded are sorted, we use the first three algos, when unordered we perform zig-zag encoding to avoid large neg/pos numbers. This allows to still use simple8b even when timestamps are out of order.

When encoded, the values are first scaled then delta-encoded. The first value is the pre-scaled starting timestamp, subsequent values are the pre-scaled difference from the prior value.

Important: TimeArrayEncodeAll modifies the contents of src by using it as scratch space for delta encoded values. It is NOT SAFE to use src after passing it into TimeArrayEncodeAll.

func TimeArrayEncodedSize

func TimeArrayEncodedSize(src []int64) int

upper bound

func Uint16ArrayEncodedSize

func Uint16ArrayEncodedSize(src []uint16) int

upper bound

func Uint32ArrayEncodedSize

func Uint32ArrayEncodedSize(src []uint32) int

upper bound

func Uint64ArrayEncodedSize

func Uint64ArrayEncodedSize(src []uint64) int

upper bound, may store uncompressed 64bit

func Uint8ArrayEncodedSize

func Uint8ArrayEncodedSize(src []uint8) int

upper bound

func UnpackBytes

func UnpackBytes(src []byte, nbytes int, res []uint64) ([]uint64, error)

func UnsafeGetBytes

func UnsafeGetBytes(s string) []byte

go 1.20 versions

func UnsafeGetString

func UnsafeGetString(b []byte) string

func ZigZagDecode

func ZigZagDecode(v uint64) int64

func ZigZagDecodeUint16

func ZigZagDecodeUint16(v uint16) int16

ZigZagDecode converts a previously zigzag encoded uint64 back to a int64.

func ZigZagDecodeUint32

func ZigZagDecodeUint32(v uint32) int32

ZigZagDecode converts a previously zigzag encoded uint64 back to a int64.

func ZigZagDecodeUint64

func ZigZagDecodeUint64(v uint64) int64

ZigZagDecode converts a previously zigzag encoded uint64 back to a int64.

func ZigZagDecodeUint8

func ZigZagDecodeUint8(v uint8) int8

ZigZagDecode converts a previously zigzag encoded uint64 back to a int64.

func ZigZagEncode

func ZigZagEncode(x int64) uint64

ZigZagEncode converts a int64 to a uint64 by zig zagging negative and positive values across even and odd numbers. Eg. [0,-1,1,-2] becomes [0, 1, 2, 3].

func ZigZagEncodeInt16

func ZigZagEncodeInt16(x int16) uint16

func ZigZagEncodeInt32

func ZigZagEncodeInt32(x int32) uint32

func ZigZagEncodeInt64

func ZigZagEncodeInt64(x int64) uint64

func ZigZagEncodeInt8

func ZigZagEncodeInt8(x int8) uint8

func ZzDecodeInt64

func ZzDecodeInt64(data []int64)

func ZzDecodeUint64

func ZzDecodeUint64(data []uint64)

func ZzDeltaDecodeInt64

func ZzDeltaDecodeInt64(data []int64)

func ZzDeltaDecodeUint64

func ZzDeltaDecodeUint64(data []uint64)

func ZzDeltaEncodeUint64

func ZzDeltaEncodeUint64(data []uint64) uint64

func ZzEncodeUint64

func ZzEncodeUint64(data []uint64) uint64

Types

This section is empty.

Jump to

Keyboard shortcuts

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