Documentation ¶
Index ¶
- Constants
- Variables
- func Count(ri RunIterator) (uint64, error)
- func EncodeRuns(rit RunIterator, buf []byte) ([]byte, error)
- func IsSet(ri RunIterator, x uint64) (bool, error)
- func SliceFromRuns(source RunIterator) ([]uint64, error)
- func ValidateRLE(buf []byte) error
- type BitIterator
- type RLE
- type Run
- type RunIterable
- type RunIterator
- func And(a, b RunIterator) (RunIterator, error)
- func DecodeRLE(buf []byte) (RunIterator, error)
- func Fill(iter RunIterator) (RunIterator, error)
- func JoinClose(it RunIterator, closeness uint64) (RunIterator, error)
- func NewFromZipfDist(seed int64, size int) RunIterator
- func Or(a, b RunIterator) (RunIterator, error)
- func RunsFromBits(source BitIterator) (RunIterator, error)
- func RunsFromSlice(slice []uint64) (RunIterator, error)
- func Subtract(a, b RunIterator) (RunIterator, error)
- func Union(iters ...RunIterator) (RunIterator, error)
- type RunSliceIterator
Constants ¶
View Source
const Version = 0
Variables ¶
View Source
var ( ErrWrongVersion = errors.New("invalid RLE+ version") ErrDecode = fmt.Errorf("invalid encoding for RLE+ version %d", Version) )
View Source
var ErrEndOfIterator = errors.New("end of iterator")
View Source
var ErrSameValRuns = errors.New("2 consecutive runs with the same value")
Functions ¶
func Count ¶
func Count(ri RunIterator) (uint64, error)
func EncodeRuns ¶
func EncodeRuns(rit RunIterator, buf []byte) ([]byte, error)
func SliceFromRuns ¶
func SliceFromRuns(source RunIterator) ([]uint64, error)
func ValidateRLE ¶ added in v0.2.3
ValidateRLE validates the RLE+ in buf does not overflow Uint64
Types ¶
type BitIterator ¶
func BitsFromRuns ¶
func BitsFromRuns(source RunIterator) (BitIterator, error)
func BitsFromSlice ¶
func BitsFromSlice(slice []uint64) BitIterator
type RLE ¶
type RLE struct {
// contains filtered or unexported fields
}
func (*RLE) MarshalJSON ¶
Encoded as an array of run-lengths, always starting with zeroes (absent values) E.g.: The set {0, 1, 2, 8, 9} is the bitfield 1110000011, and would be marshalled as [0, 3, 5, 2]
func (*RLE) RunIterator ¶
func (rle *RLE) RunIterator() (RunIterator, error)
func (*RLE) UnmarshalJSON ¶
type RunIterable ¶
type RunIterable interface {
RunIterator() (RunIterator, error)
}
type RunIterator ¶
func And ¶
func And(a, b RunIterator) (RunIterator, error)
func DecodeRLE ¶
func DecodeRLE(buf []byte) (RunIterator, error)
func Fill ¶
func Fill(iter RunIterator) (RunIterator, error)
Returns iterator with all bits up to the last bit set: in: 11100000111010001110000 out: 1111111111111111111
func JoinClose ¶
func JoinClose(it RunIterator, closeness uint64) (RunIterator, error)
func NewFromZipfDist ¶ added in v0.2.2
func NewFromZipfDist(seed int64, size int) RunIterator
func Or ¶
func Or(a, b RunIterator) (RunIterator, error)
func RunsFromBits ¶
func RunsFromBits(source BitIterator) (RunIterator, error)
func RunsFromSlice ¶
func RunsFromSlice(slice []uint64) (RunIterator, error)
func Subtract ¶
func Subtract(a, b RunIterator) (RunIterator, error)
func Union ¶ added in v0.1.0
func Union(iters ...RunIterator) (RunIterator, error)
Union returns the union of the passed iterators. Internally, this calls Or on the passed iterators, combining them with a binary tree of Ors.
type RunSliceIterator ¶
type RunSliceIterator struct { Runs []Run // contains filtered or unexported fields }
func (*RunSliceIterator) HasNext ¶
func (ri *RunSliceIterator) HasNext() bool
func (*RunSliceIterator) NextRun ¶
func (ri *RunSliceIterator) NextRun() (Run, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.