Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToValue(k int64, v interface{}) tsm.Value
- func DecodeKeyValue(field string, dec *FieldCodec, k, v []byte) (int64, interface{})
- func MeasurementFromSeriesKey(key string) string
- type BoolValue
- type Cursor
- type Database
- type EngineFormat
- type Field
- type FieldCodec
- func (f *FieldCodec) DecodeByID(targetID uint8, b []byte) (interface{}, error)
- func (f *FieldCodec) DecodeByName(name string, b []byte) (interface{}, error)
- func (f *FieldCodec) DecodeFields(b []byte) (map[uint8]interface{}, error)
- func (f *FieldCodec) DecodeFieldsWithNames(b []byte) (map[string]interface{}, error)
- func (f *FieldCodec) EncodeFields(values map[string]interface{}) ([]byte, error)
- func (f *FieldCodec) FieldByName(name string) *Field
- func (f *FieldCodec) FieldIDByName(s string) (uint8, error)
- func (f *FieldCodec) Fields() (a []*Field)
- type FloatValue
- type Int64Value
- 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 StringValue
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 ConvertToValue ¶
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 Cursor ¶
type Cursor interface { SeekTo(seek int64) (key int64, value interface{}) Next() (key int64, value interface{}) }
Cursor represents an iterator over a series.
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) DecodeFields ¶
func (f *FieldCodec) DecodeFields(b []byte) (map[uint8]interface{}, error)
DecodeFields decodes a byte slice into a set of field ids and values.
func (*FieldCodec) DecodeFieldsWithNames ¶
func (f *FieldCodec) DecodeFieldsWithNames(b []byte) (map[string]interface{}, error)
DecodeFieldsWithNames decodes a byte slice into a set of field names and values
func (*FieldCodec) EncodeFields ¶
func (f *FieldCodec) EncodeFields(values map[string]interface{}) ([]byte, error)
EncodeFields converts a map of values with string keys to a byte slice of field IDs and values.
If a field exists in the codec, but its type is different, an error is returned. If a field is not present in the codec, the system panics.
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.
func (*FieldCodec) Fields ¶
func (f *FieldCodec) Fields() (a []*Field)
type FloatValue ¶
func (*FloatValue) Size ¶
func (f *FloatValue) Size() int
func (*FloatValue) String ¶
func (f *FloatValue) String() string
func (*FloatValue) Time ¶
func (f *FloatValue) Time() time.Time
func (*FloatValue) UnixNano ¶
func (f *FloatValue) UnixNano() int64
func (*FloatValue) Value ¶
func (f *FloatValue) Value() interface{}
type Int64Value ¶
func (*Int64Value) Size ¶
func (v *Int64Value) Size() int
func (*Int64Value) String ¶
func (f *Int64Value) String() string
func (*Int64Value) Time ¶
func (v *Int64Value) Time() time.Time
func (*Int64Value) UnixNano ¶
func (v *Int64Value) UnixNano() int64
func (*Int64Value) Value ¶
func (v *Int64Value) Value() interface{}
type MeasurementFields ¶
type MeasurementFields struct { Fields map[string]*Field `json:"fields"` Codec *FieldCodec }
MeasurementFields is a mapping from measurements to its fields.
func (*MeasurementFields) MarshalBinary ¶
func (m *MeasurementFields) MarshalBinary() ([]byte, error)
MarshalBinary encodes the object to a binary format.
func (*MeasurementFields) UnmarshalBinary ¶
func (m *MeasurementFields) UnmarshalBinary(buf []byte) error
UnmarshalBinary decodes the object from a binary format.
type Series ¶
Series represents a series in the shard.
func (*Series) MarshalBinary ¶
MarshalBinary encodes the object to a binary format.
func (*Series) UnmarshalBinary ¶
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)
type StringValue ¶
func (*StringValue) Size ¶
func (v *StringValue) Size() int
func (*StringValue) String ¶
func (f *StringValue) String() string
func (*StringValue) Time ¶
func (v *StringValue) Time() time.Time
func (*StringValue) UnixNano ¶
func (v *StringValue) UnixNano() int64
func (*StringValue) Value ¶
func (v *StringValue) Value() interface{}