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 GetNameWithVersion(name string, version uint32) string
- func GetOriginMstName(nameWithVer string) string
- func GetStreamContext(r io.Reader, maxLineSize int) *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, splittWithNull bool) []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) AllocField() *Field
- func (r *Row) AllocTag() *Tag
- func (r *Row) CheckDuplicateTag(idx int) error
- func (r *Row) CheckValid() error
- func (r *Row) Clone(rr *Row)
- func (r *Row) CloneTags(tags PointTags)
- 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) HasTagArray() bool
- func (r *Row) ReFill()
- func (r *Row) Reset()
- func (r *Row) ResizeFields(n int)
- func (r *Row) ResizeTags(n int)
- func (r *Row) ReuseSet()
- func (r *Row) SkipMarshalShardKey()
- func (r *Row) TagsSize() int
- func (r *Row) UnmarshalIndexKeys(indexkeypool []byte) []byte
- func (r *Row) UnmarshalShardKeyByDimOrTag(tags []string, dims []string) error
- func (r *Row) UnmarshalShardKeyByField(shardKeys []string) error
- func (r *Row) UnmarshalShardKeyByTag(tags []string) error
- func (r *Row) UnmarshalShardKeyByTagOp(tags []string) error
- type Rows
- type SeriesBytes
- type SeriesKey
- type State
- type Tag
- type TagKV
- 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
)
const (
MessageVersion = 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 ( NoTimestamp = int64(-100) ByteSplit = byte(0) StringSplit = string(ByteSplit) )
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", }
Functions ¶
func FastUnmarshalMultiRows ¶
func FieldType2Val ¶
func FieldTypeString ¶
func GetBytesBuffer ¶
func GetBytesBuffer() []byte
func GetNameWithVersion ¶
func GetOriginMstName ¶
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_name_with_version, 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_0001,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 ¶
func (*IndexOption) Reset ¶
func (opt *IndexOption) Reset()
type IndexOptions ¶
type IndexOptions []IndexOption
func (*IndexOptions) Len ¶
func (opts *IndexOptions) Len() int
func (*IndexOptions) Less ¶
func (opts *IndexOptions) Less(i, j int) bool
func (*IndexOptions) Reset ¶
func (opts *IndexOptions) Reset()
func (*IndexOptions) Swap ¶
func (opts *IndexOptions) Swap(i, j int)
type PointRows ¶
type PointRows struct { Rows []Row // contains filtered or unexported fields }
Rows contains parsed influx rows.
type PointTags ¶
type PointTags []Tag
func IndexKeyToTags ¶
func Parse2SeriesGroupKey ¶
func Parse2SeriesGroupKey(src []byte, dst []byte, dims []string) (PointTags, []byte, int, bool, error)
Parse2SeriesGroupKey support reuse same memory space for src with dst, can reduce half memory space compared with Parse2SeriesKey
func Parse2SeriesGroupKeyOfPromQuery ¶ added in v1.3.0
Parse2SeriesGroupKeyOfPromQuery support reuse same memory space for src with dst, can reduce half memory space compared with Parse2SeriesKey Parse2SeriesGroupKeyOfPromQuery not use dims
func (*PointTags) FindPointTag ¶
func (*PointTags) HasTagArray ¶ added in v1.3.0
type Row ¶
type Row struct { // if streamOnly is false, it means that the source table data of the stream will also be written, // otherwise the source table data of the stream will not be written StreamOnly bool Timestamp int64 SeriesId uint64 PrimaryId uint64 Name string // measurement name with version Tags PointTags Fields Fields IndexKey []byte ShardKey []byte StreamId []uint64 // it used to indicate that the data is shared by multiple streams IndexOptions IndexOptions ColumnToIndex map[string]int // it indicates the sorted tagKey, fieldKey and index mapping relationship ReadyBuildColumnToIndex bool // contains filtered or unexported fields }
Row is a single influx row.
func (*Row) AllocField ¶ added in v1.4.0
func (*Row) CheckDuplicateTag ¶
func (*Row) CheckValid ¶
func (*Row) FastUnmarshalBinary ¶
func (*Row) HasTagArray ¶ added in v1.3.0
func (*Row) ResizeFields ¶ added in v1.4.0
func (*Row) ResizeTags ¶ added in v1.4.0
func (*Row) SkipMarshalShardKey ¶ added in v1.3.0
func (r *Row) SkipMarshalShardKey()
func (*Row) UnmarshalIndexKeys ¶
func (*Row) UnmarshalShardKeyByDimOrTag ¶
func (*Row) UnmarshalShardKeyByField ¶
func (*Row) UnmarshalShardKeyByTag ¶
func (*Row) UnmarshalShardKeyByTagOp ¶
type SeriesBytes ¶ added in v1.4.0
type SeriesKey ¶ added in v1.3.0
func NewSeriesKey ¶ added in v1.3.0
func NewSeriesKey() *SeriesKey
func Parse2Series ¶ added in v1.3.0
Parse2Series parse encoded index key to line protocol series key encoded index key format: [total len][ms len][ms][tagk1 len][tagk1 val]...]
type UnmarshalWork ¶
type UnmarshalWork interface { // Unmarshal must implement CPU-bound unmarshal work. Unmarshal() Cancel(reason string) }
UnmarshalWork is a unit of unmarshal work.
type WritePointsIn ¶
type WritePointsIn struct {
Prs []Row
}