Documentation ¶
Index ¶
Constants ¶
const OptimizedAnnotationLen = 16
OptimizedAnnotationLen specifies the limit of length of annotations for which we avoid allocations by using fixed backing memory where possible.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotation ¶
type Annotation []byte
Annotation represents information used to annotate datapoints.
type EncodedTags ¶ added in v0.11.0
type EncodedTags []byte
EncodedTags represents the encoded tags for the series.
type Segment ¶
type Segment struct { // Head is the head of the segment. Head checked.Bytes // Tail is the tail of the segment. Tail checked.Bytes // SegmentFlags declares whether to finalize when finalizing the segment. Flags SegmentFlags // contains filtered or unexported fields }
Segment represents a binary blob consisting of two byte slices and declares whether they should be finalized when the segment is finalized.
func NewSegment ¶
func NewSegment( head, tail checked.Bytes, checksum uint32, flags SegmentFlags, ) Segment
NewSegment will create a new segment and increment the refs to head and tail if they are non-nil. When finalized the segment will also finalize the byte slices if FinalizeBytes is passed.
func (*Segment) CalculateChecksum ¶ added in v0.15.0
CalculateChecksum calculates and sets the 32-bit checksum for this segment avoiding any allocations.
func (*Segment) Clone ¶ added in v0.6.0
func (s *Segment) Clone(pool pool.CheckedBytesPool) Segment
Clone will create a copy of this segment with an optional bytes pool.
func (*Segment) Equal ¶
Equal returns if this segment is equal to another. WARNING: This should only be used in code paths not executed often as it allocates bytes to concat each segment head and tail together before comparing the contents.
type SegmentFlags ¶
type SegmentFlags uint8
SegmentFlags describes the option to finalize or not finalize bytes in a Segment.
const ( // FinalizeNone specifies to finalize neither of the bytes FinalizeNone SegmentFlags = 1 << 0 // FinalizeHead specifies to finalize the head bytes FinalizeHead SegmentFlags = 1 << 1 // FinalizeTail specifies to finalize the tail bytes FinalizeTail SegmentFlags = 1 << 2 )
type Series ¶ added in v0.4.8
type Series struct { // UniqueIndex is the unique index assigned to this series (only valid // on a per-process basis). UniqueIndex uint64 // Namespace is the namespace the series belongs to. Namespace ident.ID // ID is the series identifier. ID ident.ID // EncodedTags are the series encoded tags, if set then call sites can // avoid needing to encoded the tags from the series tags provided. EncodedTags EncodedTags // Shard is the shard the series belongs to. Shard uint32 }
Series describes a series.