Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeKeyValue(field string, dec *FieldCodec, k, v []byte) (int64, interface{})
- func MeasurementFromSeriesKey(key string) string
- type Database
- type EngineFormat
- type Field
- type FieldCodec
- type MeasurementFields
- type Series
- type ShardInfo
- type ShardInfos
- func (s ShardInfos) Databases() []string
- func (s ShardInfos) ExclusiveDatabases(exc []string) ShardInfos
- func (s ShardInfos) FilterFormat(fmt EngineFormat) ShardInfos
- func (s ShardInfos) Len() int
- func (s ShardInfos) Less(i, j int) bool
- func (s ShardInfos) Size() int64
- func (s ShardInfos) Swap(i, j int)
- type Value
Constants ¶
const ( B1 = iota BZ1 TSM1 )
Variables ¶
var ( // ErrFieldNotFound is returned when a field cannot be found. ErrFieldNotFound = errors.New("field not found") // ErrFieldUnmappedID is returned when the system is presented, during decode, with a field ID // there is no mapping for. ErrFieldUnmappedID = errors.New("field ID not mapped") )
Functions ¶
func DecodeKeyValue ¶
func DecodeKeyValue(field string, dec *FieldCodec, k, v []byte) (int64, interface{})
DecodeKeyValue decodes the key and value from bytes.
func MeasurementFromSeriesKey ¶
MeasurementFromSeriesKey returns the Measurement name for a given series.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database represents an entire database on disk.
func NewDatabase ¶
NewDatabase creates a database instance using data at path.
type EngineFormat ¶
type EngineFormat int
func (EngineFormat) String ¶
func (e EngineFormat) String() string
String returns the string format of the engine.
type Field ¶
type Field struct { ID uint8 `json:"id,omitempty"` Name string `json:"name,omitempty"` Type influxql.DataType `json:"type,omitempty"` }
Field represents an encoded field.
type FieldCodec ¶
type FieldCodec struct {
// contains filtered or unexported fields
}
FieldCodec provides encoding and decoding functionality for the fields of a given Measurement.
func NewFieldCodec ¶
func NewFieldCodec(fields map[string]*Field) *FieldCodec
NewFieldCodec returns a FieldCodec for the given Measurement. Must be called with a RLock that protects the Measurement.
func (*FieldCodec) DecodeByID ¶
func (f *FieldCodec) DecodeByID(targetID uint8, b []byte) (interface{}, error)
DecodeByID scans a byte slice for a field with the given ID, converts it to its expected type, and return that value.
func (*FieldCodec) DecodeByName ¶
func (f *FieldCodec) DecodeByName(name string, b []byte) (interface{}, error)
DecodeByName scans a byte slice for a field with the given name, converts it to its expected type, and return that value.
func (*FieldCodec) FieldByName ¶
func (f *FieldCodec) FieldByName(name string) *Field
FieldByName returns the field by its name. It will return a nil if not found
func (*FieldCodec) FieldIDByName ¶
func (f *FieldCodec) FieldIDByName(s string) (uint8, error)
FieldIDByName returns the ID for the given field.
type MeasurementFields ¶
type MeasurementFields struct { Fields map[string]*Field `json:"fields"` Codec *FieldCodec }
MeasurementFields is a mapping from measurements to its fields.
func (*MeasurementFields) UnmarshalBinary ¶
func (m *MeasurementFields) UnmarshalBinary(buf []byte) error
UnmarshalBinary decodes the object from a binary format.
type ShardInfo ¶
type ShardInfo struct { Database string RetentionPolicy string Path string Format EngineFormat Size int64 }
ShardInfo is the description of a shard on disk.
func (*ShardInfo) FormatAsString ¶
FormatAsString returns the format of the shard as a string.
type ShardInfos ¶
type ShardInfos []*ShardInfo
func (ShardInfos) Databases ¶
func (s ShardInfos) Databases() []string
Databases returns the sorted unique set of databases for the shards.
func (ShardInfos) ExclusiveDatabases ¶
func (s ShardInfos) ExclusiveDatabases(exc []string) ShardInfos
ExclusiveDatabases returns a copy of the ShardInfo, with shards associated with the given databases present. If the given set is empty, all databases are returned.
func (ShardInfos) FilterFormat ¶
func (s ShardInfos) FilterFormat(fmt EngineFormat) ShardInfos
FilterFormat returns a copy of the ShardInfos, with shards of the given format removed.
func (ShardInfos) Len ¶
func (s ShardInfos) Len() int
func (ShardInfos) Less ¶
func (s ShardInfos) Less(i, j int) bool
func (ShardInfos) Size ¶
func (s ShardInfos) Size() int64
Size returns the space on disk consumed by the shards.
func (ShardInfos) Swap ¶
func (s ShardInfos) Swap(i, j int)