Merge pull request #1156 from jaffee/fix-container-comment

make container struct description more accurate
This commit is contained in:
Matthew Jaffee 2018-03-04 15:06:47 -06:00 committed by GitHub
commit e34fcbf568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1002,12 +1002,16 @@ const ArrayMaxSize = 4096
// RunMaxSize represents the maximum size of run length encoded containers.
const RunMaxSize = 2048
// container represents a container for uint32 integers.
// container represents a container for uint16 integers.
//
// These are used for storing the low bits. Containers are separated into three
// types depending on cardinality. For containers with less than 4,096 values,
// an array or RLE container is used, depending on the contents. For containers
// with more than 4,096 values, the values are encoded into bitmaps.
// These are used for storing the low bits of numbers in larger sets of uint64.
// The high bits are stored in a container's key which is tracked by a separate
// data structure. Integers in a container can be encoded in one of three ways -
// the encoding used is usually whichever is most compact, though any container
// type should be able to encode any set of integers safely. For containers with
// less than 4,096 values, an array is often used. Containers with long runs of
// integers would use run length encoding, and more random data usually uses
// bitmap encoding.
type container struct {
mapped bool // mapped directly to a byte slice when true
containerType byte // array, bitmap, or run