Documentation ¶
Index ¶
- Constants
- Variables
- func FastMarshalMultiRows(src []byte, rows []Row) ([]byte, error)
- func FastUnmarshalMultiRows(src []byte, rows []Row, tagPool []Tag, fieldPool []Field, ...) ([]Row, []Tag, []Field, []IndexOption, []byte, error)
- func FieldType2Val(fieldType int) (interface{}, error)
- func FieldTypeString(fieldType int32) string
- func GetBytesBuffer() []byte
- func GetStreamContext(r io.Reader) *streamContext
- func GetUnmarshalWork() *unmarshalWork
- func IsValidNumber(s string) bool
- func MakeGroupTagsKey(dims []string, tags PointTags, dst []byte) []byte
- func MakeIndexKey(name string, tags PointTags, dst []byte) []byte
- func MeasurementName(src []byte) ([]byte, []byte, error)
- func Parse2SeriesKey(key []byte, dst []byte) []byte
- func PutBytesBuffer(buf []byte)
- func PutStreamContext(ctx *streamContext)
- func ReadLinesBlockExt(r io.Reader, dstBuf, tailBuf []byte, maxLineLen, blockSize int) ([]byte, []byte, error)
- func ScheduleUnmarshalWork(uw UnmarshalWork)
- func StartUnmarshalWorkers()
- func StopUnmarshalWorkers()
- type CharType
- type Field
- type Fields
- type IndexOption
- type IndexOptions
- type PointRows
- type PointTags
- type Row
- func (r *Row) CheckValid() error
- func (r *Row) Clone(rr *Row)
- func (r *Row) Copy(p *Row)
- func (r *Row) FastMarshalBinary(dst []byte) ([]byte, error)
- func (r *Row) FastUnmarshalBinary(src []byte, tagpool []Tag, fieldpool []Field, indexOptionPool []IndexOption, ...) ([]byte, []Tag, []Field, []IndexOption, []byte, error)
- func (r *Row) Reset()
- func (r *Row) TagsSize() int
- func (r *Row) UnmarshalIndexKeys(indexkeypool []byte) []byte
- func (r *Row) UnmarshalShardKeyByTag(tags []string) error
- type Rows
- type State
- type Tag
- type UnmarshalWork
- type WritePointsIn
Constants ¶
const ( Field_Type_Unknown = 0 Field_Type_Int = 1 Field_Type_UInt = 2 Field_Type_Float = 3 Field_Type_String = 4 Field_Type_Boolean = 5 Field_Type_Tag = 6 Field_Type_Last = 7 )
const (
INDEXCOUNT = 1
)
Variables ¶
var ( // ErrPointMustHaveAField is returned when operating on a point that does not have any fields. ErrPointMustHaveAField = errno.NewError(errno.WritePointMustHaveAField) ErrPointInvalidTimeField = errno.NewError(errno.WritePointInvalidTimeField) // ErrInvalidPoint is returned when a point cannot be parsed correctly. ErrInvalidPoint = errno.NewError(errno.WriteInvalidPoint) ErrPointMustHaveAMeasurement = errno.NewError(errno.WritePointMustHaveAMeasurement) ErrPointShouldHaveAllShardKey = errno.NewError(errno.WritePointShouldHaveAllShardKey) )
var FieldTypeName = map[int]string{ Field_Type_Unknown: "Unknown", Field_Type_Int: "Integer", Field_Type_UInt: "Unsigned", Field_Type_Float: "Float", Field_Type_String: "String", Field_Type_Boolean: "Boolean", Field_Type_Tag: "Tag", Field_Type_Last: "Unknown", }
var NoTimestamp = int64(-100)
Functions ¶
func FastUnmarshalMultiRows ¶
func FieldType2Val ¶
func FieldTypeString ¶
func GetBytesBuffer ¶
func GetBytesBuffer() []byte
func GetStreamContext ¶
func GetUnmarshalWork ¶
func GetUnmarshalWork() *unmarshalWork
func IsValidNumber ¶
func MakeGroupTagsKey ¶
MakeGroupTagsKey converts a tag set to bytes for use as a lookup key.
func MeasurementName ¶
MeasurementName extract measurement from series key, return measurement, tail, error
func Parse2SeriesKey ¶
Parse2SeriesKey parse encoded index key to line protocol series key encoded index key format: [total len][ms len][ms][tagk1 len][tagk1 val]...] parse to line protocol format: mst,tagkey1=tagv1,tagk2=tagv2...
func PutBytesBuffer ¶
func PutBytesBuffer(buf []byte)
func PutStreamContext ¶
func PutStreamContext(ctx *streamContext)
func ReadLinesBlockExt ¶
func ScheduleUnmarshalWork ¶
func ScheduleUnmarshalWork(uw UnmarshalWork)
ScheduleUnmarshalWork schedules uw to run in the worker pool.
It is expected that StartUnmarshalWorkers is already called.
func StartUnmarshalWorkers ¶
func StartUnmarshalWorkers()
StartUnmarshalWorkers starts unmarshal workers.
func StopUnmarshalWorkers ¶
func StopUnmarshalWorkers()
StopUnmarshalWorkers stops unmarshal workers.
No more calles to ScheduleUnmarshalWork are allowed after callsing stopUnmarshalWorkers
Types ¶
type IndexOption ¶
type IndexOptions ¶
type IndexOptions []IndexOption
func (IndexOptions) Len ¶
func (opt IndexOptions) Len() int
func (IndexOptions) Less ¶
func (opt IndexOptions) Less(i, j int) bool
func (IndexOptions) Swap ¶
func (opt IndexOptions) Swap(i, j int)
type PointRows ¶
type PointRows struct { Rows []Row // contains filtered or unexported fields }
Rows contains parsed influx rows.
type Row ¶
type Row struct { Name string Version uint16 Tags PointTags Fields Fields ShardKey []byte Timestamp int64 IndexKey []byte SeriesId uint64 IndexOptions IndexOptions }
Row is a single influx row.
func (*Row) CheckValid ¶
func (*Row) FastUnmarshalBinary ¶
func (*Row) UnmarshalIndexKeys ¶
func (*Row) UnmarshalShardKeyByTag ¶
type UnmarshalWork ¶
type UnmarshalWork interface {
// Unmarshal must implement CPU-bound unmarshal work.
Unmarshal()
}
UnmarshalWork is a unit of unmarshal work.
type WritePointsIn ¶
type WritePointsIn struct {
Prs []Row
}