Documentation ¶
Index ¶
- Constants
- Variables
- func AddAllColumnsInColumnsRequest(cols map[string]struct{}, columnsRequest *ColumnsRequest)
- func AddAllColumnsInExpr(cols map[string]struct{}, expr FieldGetter)
- func AddAllColumnsInGroupByRequest(cols map[string]struct{}, groupByRequest *GroupByRequest)
- func AddAllColumnsInLetColumnsRequest(cols map[string]struct{}, letColumnsRequest *LetColumnsRequest)
- func AddAllColumnsInMeasureAggs(cols map[string]struct{}, measureAggs []*MeasureAggregator)
- func AddAllColumnsInOutputTransforms(cols map[string]struct{}, outputTransforms *OutputTransforms)
- func AddAllColumnsInStreamStatsOptions(cols map[string]struct{}, streamStatsOptions *StreamStatsOptions)
- func AddAllColumnsInTransactionArguments(cols map[string]struct{}, transactionArguments *TransactionArguments)
- func CheckUnsupportedFunctions(post *QueryAggregators) error
- func CompareSortValueSlices(a []SortValue, b []SortValue, ascending []int) (int, error)
- func CreateHllFromBytes(rawHll []byte) (*hll.Hll, error)
- func CreateNewHll() *sutils.GobbableHll
- func ExtractRangeFilterFromSearch(leftSearch *SearchExpressionInput, filterOp FilterOperator, ...) (map[string]string, FilterOperator, bool)
- func GetAllColumnsFromCondition(cond *SearchCondition) (map[string]bool, bool)
- func GetAllColumnsFromNode(node *SearchNode) (map[string]bool, bool)
- func GetBsuFnameFromSegKey(segkey string) string
- func GetBucketKey(BucketKey interface{}, keyIndex int) string
- func GetFieldsFromSortElements(sortEles []*SortElement) []string
- func GetMeasureAggregatorStrEncColumns(measureAggs []*MeasureAggregator) []string
- func GetRenameGroupByCols(aggGroupByCols []string, agg *QueryAggregators) []string
- func HasValueColRequestInMeasureAggs(measureAggs []*MeasureAggregator) bool
- func MatchAndExtractGroups(str string, rexExp *regexp.Regexp) (map[string]string, error)
- func RemoveUnusedGroupByCols(aggs *QueryAggregators, aggGroupByCols []string) []string
- func StoreError(errorStore map[string]*SearchErrorInfo, errMsg string, logLevel log.Level, ...) map[string]*SearchErrorInfo
- type ASTNode
- type Aggregation
- type AggregationResult
- type AggregationType
- type AllSegStatsJSON
- type AllSegStoreSummary
- func (sum *AllSegStoreSummary) DecrementTotalMetricsSegmentCount()
- func (sum *AllSegStoreSummary) DecrementTotalSegKeyCount()
- func (sum *AllSegStoreSummary) DecrementTotalTableCount()
- func (sum *AllSegStoreSummary) IncrementTotalMetricsSegmentCount()
- func (sum *AllSegStoreSummary) IncrementTotalSegmentCount()
- func (sum *AllSegStoreSummary) IncrementTotalTableCount()
- func (sum *AllSegStoreSummary) SetInMemoryBlockMicroIndexCount(count uint64)
- func (sum *AllSegStoreSummary) SetInMemoryBlockMicroIndexSizeMB(size uint64)
- func (sum *AllSegStoreSummary) SetInMemoryMetricsSearchmetadataCount(val uint64)
- func (sum *AllSegStoreSummary) SetInMemoryMetricsSsmSizeMB(val uint64)
- func (sum *AllSegStoreSummary) SetInMemorySearchmetadataCount(count uint64)
- func (sum *AllSegStoreSummary) SetInMemorySsmSizeMB(val uint64)
- type AppendCmdOption
- type AppendCmdOptions
- type AppendRequest
- type AvgStat
- type BinCmdOptions
- type BinOptions
- type BinSpanLength
- type BinSpanOptions
- type BlockInfo
- type BlockMetadataHolder
- type BlockSearchHelper
- type BlockSummary
- type BlockTracker
- type BoolExpr
- func (self *BoolExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure) (bool, error)
- func (self *BoolExpr) EvaluateForInputLookup(fieldToValue map[string]utils.CValueEnclosure) (bool, error)
- func (self *BoolExpr) GetFields() []string
- func (self *BoolExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
- type BoolOperator
- type BucketHolder
- type BucketResult
- type Cluster
- type CmiContainer
- type ColSizeInfo
- type ColumnsRequest
- type ConcatAtom
- type ConcatExpr
- type Condition
- type ConditionExpr
- type ConditionValuePair
- type Data
- type DedupExpr
- type DedupOptions
- type Downsampler
- type EvalFuncChecker
- type EventCountExpr
- type Expression
- type ExpressionFilter
- type ExpressionInput
- type FieldGetter
- type FileType
- type FillNullExpr
- type FilterBucket
- type FilterCondition
- type FilterCriteria
- type FilterInput
- type FilterStringExpr
- type FormatResultsRequest
- type Function
- type GenTimes
- type GenerateEvent
- type GroupByRequest
- type HeadExpr
- type HostMetaData
- type IncludeValue
- type InputLookup
- type Label
- type LetColumnsRequest
- type LimitExpr
- type LimitScoreMode
- type LogSpan
- type MBlockSummary
- type MatchDictArrayRequest
- type MatchFilter
- func (match *MatchFilter) GetAllBlockBloomKeysToSearch(dualCaseCheckEnabled bool, isCaseInsensitive bool) (map[string]bool, map[string]string, bool, LogicalOperator)
- func (m *MatchFilter) GetQueryInfo() *QueryInfo
- func (m *MatchFilter) GetRegexp() (*regexp.Regexp, error)
- func (mf *MatchFilter) IsMatchAll() bool
- func (m *MatchFilter) SetRegexp(compileRegex *regexp.Regexp)
- type MatchFilterType
- type MathEvaluator
- type MeasureAggregator
- type MemoryTracker
- type MetricQueryAgg
- type MetricQueryAggBlockType
- type MetricsMeta
- type MetricsQuery
- type MetricsQueryProcessingMetrics
- func (qm *MetricsQueryProcessingMetrics) IncrementNumMetricsSegmentsSearched(records uint64)
- func (qm *MetricsQueryProcessingMetrics) IncrementNumSeriesSearched(records uint64)
- func (qm *MetricsQueryProcessingMetrics) IncrementNumTSGFilesLoaded(records uint64)
- func (qm *MetricsQueryProcessingMetrics) IncrementNumTSOFilesLoaded(records uint64)
- func (qm *MetricsQueryProcessingMetrics) SetTimeLoadingTSGFiles(ttime time.Duration)
- func (qm *MetricsQueryProcessingMetrics) SetTimeLoadingTSOFiles(ttime time.Duration)
- type MetricsQueryRequest
- type MetricsQueryResponse
- type MetricsQueryResponsePromQl
- type MetricsSearchRequest
- type MultiColLetRequest
- type MultiValueColLetRequest
- type MultiValueExpr
- type MultiValueExprMode
- type NodeAggregation
- type NodeResult
- type Numbers
- type NumericExpr
- type NumericExprMode
- type NumericStats
- type OTSDBMetricsQueryExpDownsampler
- type OTSDBMetricsQueryExpFilter
- type OTSDBMetricsQueryExpMetric
- type OTSDBMetricsQueryExpOutput
- type OTSDBMetricsQueryExpRequest
- type OTSDBMetricsQueryExpTags
- type OTSDBMetricsQueryExpTime
- type OTSDBMetricsQueryExpressions
- type OrderByAggregator
- type OutputTransforms
- type PipeCommandType
- type QueryAggregators
- func (qa *QueryAggregators) AllColumnsByTimeRangeIsRequired() bool
- func (qa *QueryAggregators) AttachColumnsRequestToFillNullExprInChain(colRequest *ColumnsRequest)
- func (qa *QueryAggregators) CanLimitBuckets() bool
- func (qa *QueryAggregators) CheckForColRequestAndAttachToFillNullExprInChain()
- func (qa *QueryAggregators) GetAllColsInAggsIfStatsPresent() map[string]struct{}
- func (qa *QueryAggregators) GetAllColsInChainUpToFirstStatsBlock(cols map[string]struct{})
- func (qa *QueryAggregators) GetSortLimit() uint64
- func (qa *QueryAggregators) HasAppendInChain() bool
- func (qa *QueryAggregators) HasBinBlock() bool
- func (qa *QueryAggregators) HasBinInChain() bool
- func (qa *QueryAggregators) HasColumnsRequest() bool
- func (qa *QueryAggregators) HasDedupBlock() bool
- func (qa *QueryAggregators) HasDedupBlockInChain() bool
- func (qa *QueryAggregators) HasFillNullExpr() bool
- func (qa *QueryAggregators) HasFillNullExprInChain() bool
- func (qa *QueryAggregators) HasGenerateEvent() bool
- func (qa *QueryAggregators) HasGeneratedEventsWithoutSearch() bool
- func (qa *QueryAggregators) HasGroupByOrMeasureAggsInBlock() bool
- func (qa *QueryAggregators) HasGroupByOrMeasureAggsInChain() bool
- func (qa *QueryAggregators) HasInChain(hasInCur queryAggregatorsBoolFunc) bool
- func (qa *QueryAggregators) HasListFunc() bool
- func (qa *QueryAggregators) HasQueryAggergatorBlock() bool
- func (qa *QueryAggregators) HasQueryAggergatorBlockInChain() bool
- func (qa *QueryAggregators) HasRexBlockInChainWithStats() bool
- func (qa *QueryAggregators) HasRexBlockInQA() bool
- func (qa *QueryAggregators) HasSortBlock() bool
- func (qa *QueryAggregators) HasSortBlockInChain() bool
- func (qa *QueryAggregators) HasStatsBlock() bool
- func (qa *QueryAggregators) HasStatsBlockInChain() bool
- func (qa *QueryAggregators) HasStreamStats() bool
- func (qa *QueryAggregators) HasStreamStatsInChain() bool
- func (qa *QueryAggregators) HasTail() bool
- func (qa *QueryAggregators) HasTailInChain() bool
- func (qa *QueryAggregators) HasTransactionArguments() bool
- func (qa *QueryAggregators) HasTransactionArgumentsInChain() bool
- func (qa *QueryAggregators) HasValueColRequest() bool
- func (qa *QueryAggregators) HasValuesFunc() bool
- func (qa *QueryAggregators) IsAggsEmpty() bool
- func (qa *QueryAggregators) IsStatisticBlockEmpty() bool
- func (qa *QueryAggregators) IsStatsAggPresentInChain() bool
- func (qa *QueryAggregators) UsedByTimechart() bool
- type QueryArithmetic
- type QueryContext
- type QueryCount
- type QueryInfo
- type QueryProcessingMetrics
- func (qm *QueryProcessingMetrics) IncrementNumBlocksToRawSearch(records uint64)
- func (qm *QueryProcessingMetrics) IncrementNumBlocksWithMatch(nBlocks uint64)
- func (qm *QueryProcessingMetrics) IncrementNumRecordsNoMatch(nBlocks uint64)
- func (qm *QueryProcessingMetrics) IncrementNumRecordsWithMatch(nBlocks uint64)
- func (qm *QueryProcessingMetrics) SetNumBlocksInSegFile(records uint64)
- func (qm *QueryProcessingMetrics) SetNumBlocksToRawSearch(records uint64)
- func (qm *QueryProcessingMetrics) SetNumRecordsMatched(records uint64)
- func (qm *QueryProcessingMetrics) SetNumRecordsToRawSearch(records uint64)
- func (qm *QueryProcessingMetrics) SetNumRecordsUnmatched(records uint64)
- type QueryType
- type RangeBucket
- type RangeStat
- type RenameExpr
- func (self *RenameExpr) CheckIfMatch(colName string) bool
- func (self *RenameExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure, fieldName string) (string, error)
- func (self *RenameExpr) GetFields() []string
- func (self *RenameExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
- func (self *RenameExpr) ProcessRenameRegexExpression(colName string) (string, error)
- func (self *RenameExpr) RemoveBucketHolderGroupByColumnsByIndex(bucketHolder *BucketHolder, groupByCols []string, indexToRemove []int)
- func (self *RenameExpr) RemoveBucketResGroupByColumnsByIndex(bucketResult *BucketResult, indexToRemove []int)
- func (self *RenameExpr) RemoveColsByIndex(strs []string, indexToRemove []int) []string
- type RenameExprMode
- type Result
- type RexExpr
- type RowColOptions
- type RunningStreamStatsResults
- type RunningStreamStatsWindowElement
- type SPathExpr
- type SearchCondition
- type SearchErrorInfo
- type SearchExpression
- func (searchExp *SearchExpression) GetAllBlockBloomKeysToSearch(dualCaseCheckEnabled bool, isCaseInsensitive bool) (map[string]bool, map[string]string, bool, error)
- func (searchExp *SearchExpression) GetExpressionType() SearchQueryType
- func (se *SearchExpression) GetQueryInfo() *QueryInfo
- func (searchExp *SearchExpression) IsMatchAll() bool
- func (ef *SearchExpression) IsTimeRangeFilter() bool
- type SearchExpressionInput
- type SearchInfo
- type SearchMetadataHolder
- type SearchNode
- type SearchNodeType
- type SearchQuery
- func (query *SearchQuery) ExtractRangeFilterFromQuery(qid uint64) (map[string]string, FilterOperator, bool)
- func (query *SearchQuery) GetAllBlockBloomKeysToSearch() (map[string]bool, map[string]string, bool, LogicalOperator)
- func (query *SearchQuery) GetAllColumnsInQuery() (map[string]bool, bool)
- func (n *SearchQuery) GetQueryInfo() SearchNodeType
- func (q *SearchQuery) GetQueryType() SearchNodeType
- func (q *SearchQuery) IsMatchAll() bool
- type SearchQueryType
- type SegMeta
- type SegSetData
- type SegSetDataWithStrFname
- type SegSetFile
- type SegStats
- func (ss *SegStats) CreateHllFromBytes(rawHll []byte) error
- func (ss *SegStats) CreateNewHll()
- func (ss *SegStats) GetHllBytes() []byte
- func (ss *SegStats) GetHllBytesInPlace(bytes []byte) []byte
- func (ss *SegStats) GetHllCardinality() uint64
- func (ss *SegStats) GetHllDataSize() int
- func (ss *SegStats) Init(rawSegStatJson []byte) error
- func (ss *SegStats) InsertIntoHll(value []byte)
- func (ss *SegStats) Merge(other *SegStats)
- func (ss *SegStats) ToJSON() (*SegStatsJSON, error)
- type SegStatsJSON
- type SegType
- type SegmentByTimeAndColSizes
- type SegmentSearchRequest
- func (ssr *SegmentSearchRequest) CleanSearchMetadata()
- func (ssr *SegmentSearchRequest) GetMaxSearchMemorySize(parallelismPerFile int64, bitsetMinSize uint16) uint64
- func (ssr *SegmentSearchRequest) JoinColumnInfo(toJoin *SegmentSearchRequest)
- func (ssr *SegmentSearchRequest) JoinRequest(toJoin *SegmentSearchRequest, op LogicalOperator)
- type ShowColumns
- type ShowFilter
- type ShowRequest
- type SingleAgg
- type SingleColLetRequest
- type SortElement
- type SortExpr
- type SortRequest
- type SortValue
- type SpanLength
- type SpanOptions
- type SplitByClause
- type StatisticExpr
- func (self *StatisticExpr) GetFields() []string
- func (self *StatisticExpr) OverrideGroupByCol(bucketResult *BucketResult, resTotal uint64) error
- func (self *StatisticExpr) RemoveFieldsNotInExprForBucketRes(bucketResult *BucketResult) error
- func (self *StatisticExpr) SetCountToStatRes(statRes map[string]utils.CValueEnclosure, elemCount uint64)
- func (self *StatisticExpr) SetPercToStatRes(statRes map[string]utils.CValueEnclosure, elemCount uint64, resTotal uint64)
- func (self *StatisticExpr) SortBucketResult(results *[]*BucketResult) error
- type StatisticFunctionMode
- type StatisticOptions
- type StatsFuncChecker
- type StatsOptions
- type StreamStatsOptions
- type StringExpr
- type StringExprMode
- type StringStats
- type TMLimitResult
- type TS_TYPE
- type TableInfo
- type TagValueIndex
- type TagValueType
- type TagsFilter
- type TailExpr
- type TcOptions
- type TextExpr
- type TimeBucket
- type TimechartExpr
- type TransactionArguments
- type TransactionGroupState
- type ValueBucket
- type ValueExpr
- func (self *ValueExpr) EvaluateToFloat(fieldToValue map[string]utils.CValueEnclosure) (float64, error)
- func (self *ValueExpr) EvaluateToMultiValue(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
- func (self *ValueExpr) EvaluateToString(fieldToValue map[string]utils.CValueEnclosure) (string, error)
- func (expr *ValueExpr) EvaluateValueExpr(fieldToValue map[string]utils.CValueEnclosure) (interface{}, string, error)
- func (self *ValueExpr) EvaluateValueExprAsString(fieldToValue map[string]utils.CValueEnclosure) (string, error)
- func (self *ValueExpr) GetFields() []string
- func (self *ValueExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
- type ValueExprMode
- type ValueOrder
- type VectorMatchCardinality
- type VectorMatching
- type VtableCounts
Constants ¶
const ( SFMTop = iota SFMRare )
const ( REMPhrase = iota //Rename with a phrase REMRegex //Rename fields with similar names using a wildcard REMOverride //Rename to a existing field )
const ( LSMBySum = iota // If only a single aggregation is specified, the score is based on the sum of the values in the aggregation LSMByFreq // Otherwise the score is based on the frequency of the by field's val )
const ( VEMNumericExpr = iota // Only NumricExpr is valid VEMStringExpr // Only StringExpr is valid VEMConditionExpr // Only ConditionExpr is valud VEMBooleanExpr // Only BooleanExpr is valid VEMMultiValueExpr // Only MultiValueExpr is valid )
const ( SEMRawString = iota // only used when mode is RawString SEMRawStringList // only used when mode is RawStringList SEMField // only used when mode is Field SEMConcatExpr // only used when mode is Concat SEMTextExpr // only used when mode is TextExpr SEMFieldList // only used when mode is FieldList )
const ( NEMNumber = iota // only used when mode is a Number NEMLenString // only used when mode is a str (used for len()) NEMNumberField // only used when mode is Field (Field can be evaluated to a float) NEMLenField // only used when mode is Field (Field can not be evaluated to a float, used for len()) NEMNumericExpr // only used when mode is a NumericExpr )
const ( MVEMMultiValueExpr = iota // only used when mode is a MultiValueExpr MVEMField )
const ( TS_Type8 = iota + 1 TS_Type16 TS_Type32 TS_Type64 )
const ( InvalidCmd = iota SegmentStatsCmd GroupByCmd RRCCmd )
const MAX_SEGMETA_FSIZE = 10_000_000 // 10 MB
const SIZE_OF_BSUM = 18
const SIZE_OF_BlockInfo = 14 // 2 + 4 + 8 bytes
const SIZE_OF_MBSUM = 10 // 2 + 4 + 4
Variables ¶
var HllSettings = hll.Settings{ Log2m: 16, Regwidth: 5, ExplicitThreshold: hll.AutoExplicitThreshold, SparseEnabled: true, }
Functions ¶
func AddAllColumnsInColumnsRequest ¶
func AddAllColumnsInColumnsRequest(cols map[string]struct{}, columnsRequest *ColumnsRequest)
func AddAllColumnsInExpr ¶
func AddAllColumnsInExpr(cols map[string]struct{}, expr FieldGetter)
func AddAllColumnsInGroupByRequest ¶
func AddAllColumnsInGroupByRequest(cols map[string]struct{}, groupByRequest *GroupByRequest)
func AddAllColumnsInLetColumnsRequest ¶
func AddAllColumnsInLetColumnsRequest(cols map[string]struct{}, letColumnsRequest *LetColumnsRequest)
func AddAllColumnsInMeasureAggs ¶
func AddAllColumnsInMeasureAggs(cols map[string]struct{}, measureAggs []*MeasureAggregator)
func AddAllColumnsInOutputTransforms ¶
func AddAllColumnsInOutputTransforms(cols map[string]struct{}, outputTransforms *OutputTransforms)
func AddAllColumnsInStreamStatsOptions ¶
func AddAllColumnsInStreamStatsOptions(cols map[string]struct{}, streamStatsOptions *StreamStatsOptions)
func AddAllColumnsInTransactionArguments ¶
func AddAllColumnsInTransactionArguments(cols map[string]struct{}, transactionArguments *TransactionArguments)
func CheckUnsupportedFunctions ¶
func CheckUnsupportedFunctions(post *QueryAggregators) error
func CompareSortValueSlices ¶
The `ascending` slice should have the same length as `a` and `b`. Moreover, each element of `ascending` should be either +1 or -1; +1 means higher values get sorted higher, and -1 means lower values get sorted higher.
func CreateHllFromBytes ¶
func CreateNewHll ¶
func CreateNewHll() *sutils.GobbableHll
Creates a new segmentio Hll with the defined HllSettings.
func ExtractRangeFilterFromSearch ¶
func ExtractRangeFilterFromSearch(leftSearch *SearchExpressionInput, filterOp FilterOperator, rightSearch *SearchExpressionInput, qid uint64) (map[string]string, FilterOperator, bool)
Given a left and right SearchInputs with filterOp, extract out range filters Returns a map from column to value, the final operator, and a bool telling if a range filter has been found for these. False value means the search inputs have no range filters (may have swapped from original if right has column and left and literal)
func GetAllColumnsFromCondition ¶
func GetAllColumnsFromCondition(cond *SearchCondition) (map[string]bool, bool)
Get all columns that occur across a list of *SearchQuery returns all columns and if any of the columns contains wildcards
func GetAllColumnsFromNode ¶
func GetAllColumnsFromNode(node *SearchNode) (map[string]bool, bool)
func GetBsuFnameFromSegKey ¶
func GetBucketKey ¶
func GetFieldsFromSortElements ¶
func GetFieldsFromSortElements(sortEles []*SortElement) []string
func GetMeasureAggregatorStrEncColumns ¶
func GetMeasureAggregatorStrEncColumns(measureAggs []*MeasureAggregator) []string
func GetRenameGroupByCols ¶
func GetRenameGroupByCols(aggGroupByCols []string, agg *QueryAggregators) []string
Rename field A to field B. If A and B are groupby columns, field B should be removed from groupby columns, and rename A to B
func HasValueColRequestInMeasureAggs ¶
func HasValueColRequestInMeasureAggs(measureAggs []*MeasureAggregator) bool
func MatchAndExtractGroups ¶
func RemoveUnusedGroupByCols ¶
func RemoveUnusedGroupByCols(aggs *QueryAggregators, aggGroupByCols []string) []string
For Rename or top/rare block, we may need to delete some groupby columns while processing them
func StoreError ¶
func StoreError(errorStore map[string]*SearchErrorInfo, errMsg string, logLevel log.Level, err error) map[string]*SearchErrorInfo
Types ¶
type ASTNode ¶
type ASTNode struct { AndFilterCondition *Condition // A condition to query. Condition must return true for log line to pass OrFilterCondition *Condition // Condition must return true for log line to pass ExclusionFilterCondition *Condition // Condition must return false for log line to pass TimeRange *dtu.TimeRange // Time range for node micro index / raw search ActiveFileSearch bool // Lookup unrotated segfiles BucketLimit int }
Node used to query data in a segment file. A line matches a node if it matches all conditions in AndFilterConditions, any in OrFilterCriteria, and none in ExclusionFilterCriteria
type Aggregation ¶
type Aggregation struct { AggregatorFunction utils.AggregateFunctions //aggregator function FuncConstant float64 GroupByFields []string // group by fields will be sorted }
func (Aggregation) IsAggregateFromAllTimeseries ¶
func (agg Aggregation) IsAggregateFromAllTimeseries() bool
func (Aggregation) ShallowClone ¶
func (agg Aggregation) ShallowClone() *Aggregation
type AggregationResult ¶
type AggregationResult struct { IsDateHistogram bool // is this a date histogram Results []*BucketResult // histogram results }
type AggregationType ¶
type AggregationType uint8
Defines the different types of bucketing aggregations for processing of results
const ( TimeHistogram AggregationType = iota GroupBy )
type AllSegStatsJSON ¶
type AllSegStatsJSON struct {
AllSegStats map[string]*SegStatsJSON
}
type AllSegStoreSummary ¶
type AllSegStoreSummary struct { TotalSegmentCount uint64 TotalMetricsSegmentCount uint64 TotalTableCount uint64 InMemoryCMICount uint64 InMemorySearchMetadataCount uint64 InMemoryBlockMicroIndexSizeMB uint64 InMemorySsmSizeMB uint64 InMemoryMetricsSearchMetadataCount uint64 InMemoryMetricsBSumSizeMB uint64 }
func (*AllSegStoreSummary) DecrementTotalMetricsSegmentCount ¶
func (sum *AllSegStoreSummary) DecrementTotalMetricsSegmentCount()
func (*AllSegStoreSummary) DecrementTotalSegKeyCount ¶
func (sum *AllSegStoreSummary) DecrementTotalSegKeyCount()
func (*AllSegStoreSummary) DecrementTotalTableCount ¶
func (sum *AllSegStoreSummary) DecrementTotalTableCount()
func (*AllSegStoreSummary) IncrementTotalMetricsSegmentCount ¶
func (sum *AllSegStoreSummary) IncrementTotalMetricsSegmentCount()
func (*AllSegStoreSummary) IncrementTotalSegmentCount ¶
func (sum *AllSegStoreSummary) IncrementTotalSegmentCount()
func (*AllSegStoreSummary) IncrementTotalTableCount ¶
func (sum *AllSegStoreSummary) IncrementTotalTableCount()
func (*AllSegStoreSummary) SetInMemoryBlockMicroIndexCount ¶
func (sum *AllSegStoreSummary) SetInMemoryBlockMicroIndexCount(count uint64)
func (*AllSegStoreSummary) SetInMemoryBlockMicroIndexSizeMB ¶
func (sum *AllSegStoreSummary) SetInMemoryBlockMicroIndexSizeMB(size uint64)
func (*AllSegStoreSummary) SetInMemoryMetricsSearchmetadataCount ¶
func (sum *AllSegStoreSummary) SetInMemoryMetricsSearchmetadataCount(val uint64)
func (*AllSegStoreSummary) SetInMemoryMetricsSsmSizeMB ¶
func (sum *AllSegStoreSummary) SetInMemoryMetricsSsmSizeMB(val uint64)
func (*AllSegStoreSummary) SetInMemorySearchmetadataCount ¶
func (sum *AllSegStoreSummary) SetInMemorySearchmetadataCount(count uint64)
func (*AllSegStoreSummary) SetInMemorySsmSizeMB ¶
func (sum *AllSegStoreSummary) SetInMemorySsmSizeMB(val uint64)
type AppendCmdOption ¶
type AppendCmdOption struct { OptionType string Value interface{} }
type AppendCmdOptions ¶
type AppendRequest ¶
type BinCmdOptions ¶
type BinOptions ¶
type BinOptions struct {
SpanOptions *SpanOptions
}
type BinSpanLength ¶
type BinSpanOptions ¶
type BinSpanOptions struct { BinSpanLength *BinSpanLength LogSpan *LogSpan }
type BlockMetadataHolder ¶
type BlockSearchHelper ¶
type BlockSearchHelper struct {
// contains filtered or unexported fields
}
a helper struct to keep track to the blocks search status. This struct will be used to re-use slices of matched time stamps it is important to know that the slice is re-used, so callers would need to copy the values if needed else, will leak memory
func InitAllBlockSearchHelpers ¶
func InitAllBlockSearchHelpers(fileParallelism int64) []*BlockSearchHelper
func InitBlockSearchHelper ¶
func InitBlockSearchHelper() *BlockSearchHelper
func (*BlockSearchHelper) AddMatchedRecord ¶
func (h *BlockSearchHelper) AddMatchedRecord(recNum uint)
func (*BlockSearchHelper) ClearBit ¶
func (h *BlockSearchHelper) ClearBit(recNum uint)
func (*BlockSearchHelper) DoesRecordMatch ¶
func (h *BlockSearchHelper) DoesRecordMatch(recNum uint) bool
func (*BlockSearchHelper) GetAllMatchedRecords ¶
func (h *BlockSearchHelper) GetAllMatchedRecords() *pqmr.PQMatchResults
func (*BlockSearchHelper) ResetBlockHelper ¶
func (h *BlockSearchHelper) ResetBlockHelper()
keep allocated slice
type BlockSummary ¶
If new member is added to BlockSum, make sure to reset it's value in resetwipblock()
func (*BlockSummary) Copy ¶
func (bs *BlockSummary) Copy() *BlockSummary
returns a deep copy of the block summary
func (*BlockSummary) GetSize ¶
func (bs *BlockSummary) GetSize() uint64
type BlockTracker ¶
type BlockTracker struct {
// contains filtered or unexported fields
}
Helper struct to keep track of which blocks to check
func InitEntireFileBlockTracker ¶
func InitEntireFileBlockTracker() *BlockTracker
func InitExclusionBlockTracker ¶
func InitExclusionBlockTracker(spqmr *pqmr.SegmentPQMRResults) *BlockTracker
func (*BlockTracker) ShouldProcessBlock ¶
func (bt *BlockTracker) ShouldProcessBlock(blkNum uint16) bool
type BoolExpr ¶
type BoolExpr struct { IsTerminal bool // Only used when IsTerminal is true. LeftValue *ValueExpr RightValue *ValueExpr ValueOp string // Only = or != for strings; can also be <, <=, >, >= for numbers. ValueList []*ValueExpr //Use for in(<value>, <list>) // Only used when IsTerminal is false. For a unary BoolOp, RightExpr should be nil. LeftBool *BoolExpr RightBool *BoolExpr BoolOp BoolOperator }
These structs are used to organize boolean, string, and numeric expressions. The expressions can contain fields. To evaluate one of these expressions, use GetFields() to find all the fields used directly or indirectly by the expression, then create a fieldToValue map specifying the value for each of these fields, and call Evaluate(fieldToValue).
func (*BoolExpr) Evaluate ¶
Evaluate this BoolExpr to a boolean, replacing each field in the expression with the value specified by fieldToValue. Each field listed by GetFields() must be in fieldToValue.
func (*BoolExpr) EvaluateForInputLookup ¶
func (self *BoolExpr) EvaluateForInputLookup(fieldToValue map[string]utils.CValueEnclosure) (bool, error)
This evaluation is specific for inputlookup command. Only =, != , <, >, <=, >= operators are supported for strings and numbers. Strings and numbers are compared as strings. Strings are compared lexicographically and are case-insensitive. Wildcards can be used to match a string with a pattern. Only * is supported.
func (*BoolExpr) GetNullFields ¶
type BoolOperator ¶
type BoolOperator uint8
const ( BoolOpNot BoolOperator = iota BoolOpAnd BoolOpOr )
type BucketHolder ¶
type BucketResult ¶
type BucketResult struct { ElemCount uint64 // total number of elements in bucket StatRes map[string]utils.CValueEnclosure // results of statistic functions BucketKey interface{} // bucket key GroupByKeys []string }
func (*BucketResult) GetBucketValueForGivenField ¶
func (br *BucketResult) GetBucketValueForGivenField(fieldName string) (interface{}, int, bool)
GetBucketValueForGivenField returns the value of the bucket for the given field name. It checks for the field in the statistic results and group by keys. If the field is not found, it returns nil. The first return value is the value of the field. The second return value is the index of the field in the group by keys. The third return value is a boolean indicating if the field was found in the Statistic results. For Statistic results, the index is -1. and Bool is true. For GroupBy keys, the index is the index of the field in the group by keys; given that the Bucket key is a List Type. and Bool is false. Otherwise, the index is -1 and Bool is false.
func (*BucketResult) SetBucketValueForGivenField ¶
func (br *BucketResult) SetBucketValueForGivenField(fieldName string, value interface{}, index int, isStatRes bool) error
Can only be used for GroupBy keys. SetBucketValueForGivenField sets the value of the bucket for the given field name. If the BucketKey is a Array or Slice type, then it sets the value at the given index. And will also convert the BucketKey to a []interface{} type if it is not already.
type CmiContainer ¶
type CmiContainer struct { CmiType uint8 Loaded bool Bf *bloom.BloomFilter Ranges map[string]*Numbers }
a holder struct for holding a cmi for a single block. Based on CmiType, either Bf or Ranges will be defined
type ColSizeInfo ¶
type ColSizeInfo struct { CmiSize uint64 `json:"cmiSize"` CsgSize uint64 `json:"csgSize"` ConsistentCvalSize uint32 `json:"cValSize"` // The size of the column value, given that the size is consistent across all records. The value is set to `MaxUint32` if the column values length is not consistent. }
type ColumnsRequest ¶
type ColumnsRequest struct { RenameColumns map[string]string // maps original column name to new column name ExcludeColumns []string // names of columns to exclude IncludeColumns []string // names of columns to include IncludeValues []*IncludeValue // values of columns to include. Maps column name to index in column RenameAggregationColumns map[string]string // values of aggregations to rename Logfmt bool // true if logfmt request Next *ColumnsRequest }
type ConcatAtom ¶
type ConcatExpr ¶
type ConcatExpr struct {
Atoms []*ConcatAtom
}
func (*ConcatExpr) Evaluate ¶
func (self *ConcatExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure) (string, error)
Concatenate all the atoms in this ConcatExpr, replacing all fields with the values specified by fieldToValue. Each field listed by GetFields() must be in fieldToValue.
func (*ConcatExpr) GetFields ¶
func (self *ConcatExpr) GetFields() []string
func (*ConcatExpr) GetNullFields ¶
func (self *ConcatExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
type Condition ¶
type Condition struct { FilterCriteria []*FilterCriteria // raw conditions to check NestedNodes []*ASTNode // nested conditions to check }
A condition struct defines the FilterConditions and ASTNodes that exist as a part of a single condition
func (*Condition) JoinCondition ¶
type ConditionExpr ¶
type ConditionExpr struct { Op string //if, case, coalesce BoolExpr *BoolExpr TrueValue *ValueExpr //if bool expr is true, take this value FalseValue *ValueExpr ConditionValuePairs []*ConditionValuePair ValueList []*ValueExpr }
func (*ConditionExpr) EvaluateCondition ¶
func (expr *ConditionExpr) EvaluateCondition(fieldToValue map[string]utils.CValueEnclosure) (interface{}, error)
Field may come from BoolExpr or ValueExpr
func (*ConditionExpr) GetFields ¶
func (self *ConditionExpr) GetFields() []string
Append all the fields in ConditionExpr
func (*ConditionExpr) GetNullFields ¶
func (self *ConditionExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
type ConditionValuePair ¶
type DedupExpr ¶
type DedupExpr struct { Limit uint64 FieldList []string // Must have FieldList DedupOptions *DedupOptions DedupSortEles []*SortElement DedupSortAscending []int // Derived from DedupSortEles.SortByAsc values. // DedupCombinations maps combinations to a map mapping the record index // (of all included records for this combination) to the sort values for // that record. For example, if Limit is 3, each inner map will have at // most 3 entries and will store the index and sort values of the top 3 // records for that combination. DedupCombinations map[string]map[int][]SortValue PrevCombination string DedupRecords map[string]map[string]interface{} NumProcessedSegments uint64 // contains filtered or unexported fields }
func (*DedupExpr) AcquireProcessedSegmentsLock ¶
func (self *DedupExpr) AcquireProcessedSegmentsLock()
func (*DedupExpr) ReleaseProcessedSegmentsLock ¶
func (self *DedupExpr) ReleaseProcessedSegmentsLock()
type DedupOptions ¶
type Downsampler ¶
type Downsampler struct { Interval int Unit string CFlag bool Aggregator Aggregation }
func (*Downsampler) GetIntervalTimeInSeconds ¶
func (ds *Downsampler) GetIntervalTimeInSeconds() uint32
type EvalFuncChecker ¶
type EvalFuncChecker struct{}
func (EvalFuncChecker) IsUnsupported ¶
func (c EvalFuncChecker) IsUnsupported(funcName string) bool
type EventCountExpr ¶
type Expression ¶
type Expression struct { LeftInput *ExpressionInput // left expression input for operator ExpressionOp ArithmeticOperator // operator, used if complex expression that relates keys RightInput *ExpressionInput // right expression input for operator }
expressions are used for SegReaders to parse and search segment files If expressionOp == nil, only leftInput is not nil else, only one of left/right ExpressionInput literal or columnName will be non empty
- right expressionInput may not exist if op only needs one input (i.e. NOT_NULL)
i.e field2 * 0.2, is Expression{leftInput=ExpressionInput{columnName=field2}, op=Multiply, rightInput=ExpressionInput{literal=0.2}} for just literal 39, Expression{leftInput=ExpressionInput{literal=39}}
func (*Expression) IsTimeExpression ¶
func (exp *Expression) IsTimeExpression() bool
type ExpressionFilter ¶
type ExpressionFilter struct { LeftInput *FilterInput // left input to filterOperator FilterOperator utils.FilterOperator // how to logField in logline (i.e logField=filterString, logField >= filterValue) RightInput *FilterInput // right input to filterOperator }
ExpressionFilter denotes a single expression to search for in a log record
func (*ExpressionFilter) GetAllColumns ¶
func (e *ExpressionFilter) GetAllColumns() map[string]bool
func (*ExpressionFilter) IsTimeRange ¶
func (e *ExpressionFilter) IsTimeRange() bool
type ExpressionInput ¶
type ExpressionInput struct { ColumnValue *DtypeEnclosure // column value: "0", "abc", "abcd*", "0.213". This value will be normalized to Lower Case if the search is case insensitive. OriginalColumnValue *DtypeEnclosure // original column value. Similar to Column Value, but is only created when dualCaseCheck is enabled and the search is case insensitive ColumnName string // column name for expression: "col1", "col2", ... "colN" }
only one field will be non-nil literal can either be a string or a json.Number
type FieldGetter ¶
type FieldGetter interface {
GetFields() []string
}
type FillNullExpr ¶
type FillNullExpr struct { Value string // value to fill nulls with. Default 0 FieldList []string // list of fields to fill nulls with Records map[string]map[string]interface{} FinalCols map[string]bool ColumnsRequest *ColumnsRequest }
func (*FillNullExpr) GetFields ¶
func (fillNullExpr *FillNullExpr) GetFields() []string
type FilterBucket ¶
type FilterBucket struct { FilterCriteria []*FilterCondition CatchAllBucket bool Count uint64 // limit number of resulting histograms }
type FilterCondition ¶
type FilterCondition struct { Criteria *FilterCriteria Name string }
type FilterCriteria ¶
type FilterCriteria struct { MatchFilter *MatchFilter // match filter to check multiple words in a column ExpressionFilter *ExpressionFilter // expression filter to check a single expression in a column FilterIsCaseInsensitive bool // if the filter is case sensitive }
Top level filter criteria condition that define either a MatchFilter or ExpressionFilter. Only one will be defined, never both
func (*FilterCriteria) GetAllColumns ¶
func (f *FilterCriteria) GetAllColumns() map[string]bool
func (*FilterCriteria) IsTimeRange ¶
func (f *FilterCriteria) IsTimeRange() bool
type FilterInput ¶
type FilterInput struct { SubTree *ASTNode // root of ASTNode SubtreeResult string // result of processing subtree Expression *Expression // expression for filterInput }
Input for filter operator can either be the result of a ASTNode or an expression either subtree or expression is defined, but never both and never neither
type FilterStringExpr ¶
type FormatResultsRequest ¶
type FormatResultsRequest struct { MVSeparator string // separator for multi-value fields. Default= "OR" MaxResults uint64 // max number of results to return EmptyString string // string to return if no results are found. Default= "NOT()" RowColOptions *RowColOptions // options for row column }
formats the results into a single result and places that result into a new field called search.
type Function ¶
type Function struct { MathFunction utils.MathFunctions RangeFunction utils.RangeFunctions //range function to apply, only one of these will be non nil ValueList []string TimeWindow float64 //E.g: rate(metrics[1m]), extract 1m and convert to seconds Step float64 //E.g: rate(metrics[5m:1m]), extract 1m and convert to seconds TimeFunction utils.TimeFunctions }
func (Function) ShallowClone ¶
type GenTimes ¶
type GenTimes struct { StartTime uint64 EndTime uint64 Interval *SpanLength }
type GenerateEvent ¶
type GroupByRequest ¶
type GroupByRequest struct { MeasureOperations []*MeasureAggregator GroupByColumns []string AggName string // name of aggregation BucketCount int }
type HeadExpr ¶
type HeadExpr struct { MaxRows uint64 Keeplast bool Null bool RowsAdded uint64 // number of rows added to the result. This is used in conjunction with MaxRows. BoolExpr *BoolExpr SegmentRecords map[string]map[string]interface{} ResultRecords []map[string]interface{} ResultRecordKeys []string Done bool NumProcessedSegments uint64 }
type HostMetaData ¶
type HostMetaData struct {
MetaFileName string `json:"metaFileName"`
}
type IncludeValue ¶
type InputLookup ¶
type LetColumnsRequest ¶
type LetColumnsRequest struct { MultiColsRequest *MultiColLetRequest SingleColRequest *SingleColLetRequest ValueColRequest *ValueExpr RexColRequest *RexExpr StatisticColRequest *StatisticExpr RenameColRequest *RenameExpr DedupColRequest *DedupExpr SortColRequest *SortExpr NewColName string MultiValueColRequest *MultiValueColLetRequest FormatResults *FormatResultsRequest // formats the results into a single result and places that result into a new field called search. EventCountRequest *EventCountExpr // To count the number of events in an index BinRequest *BinCmdOptions FillNullRequest *FillNullExpr AppendRequest *AppendRequest }
Only NewColName and one of the other fields should have a value
type LimitExpr ¶
type LimitExpr struct { IsTop bool // True: keeps the N highest scoring distinct values of the split-by field Num int LimitScoreMode LimitScoreMode }
type LimitScoreMode ¶
type LimitScoreMode uint8
type MBlockSummary ¶
NOTE: Change the value oF SIZE_OF_MBSUM each time this struct is updated
func (*MBlockSummary) FlushSummary ¶
func (mbs *MBlockSummary) FlushSummary(fName string) ([]byte, error)
Format of block summary file [version - 1 byte][blk num - 2 bytes][high ts - 4 bytes][low ts - 4 bytes]
func (*MBlockSummary) Reset ¶
func (mbs *MBlockSummary) Reset()
func (*MBlockSummary) UpdateTimeRange ¶
func (mbs *MBlockSummary) UpdateTimeRange(ts uint32)
type MatchDictArrayRequest ¶
type MatchDictArrayRequest struct { MatchKey []byte MatchValue *utils.DtypeEnclosure }
type MatchFilter ¶
type MatchFilter struct { MatchColumn string // column to search for MatchWords [][]byte // all words to search for. The values will be normalized to Lower case if the query is case insensitive MatchWordsOriginal [][]byte // all original words to search for. Will be set only if dualcasecheck is enabled and query is case insensitive. MatchOperator utils.LogicalOperator // how to combine matchWords MatchPhrase []byte //whole string to search for in case of MatchPhrase query. The value will be normalized to Lower case if the query is case insensitive MatchPhraseOriginal []byte //original string to search for in case of MatchPhrase query. Will be set only if dualcasecheck is enabled and query is case insensitive. MatchDictArray *MatchDictArrayRequest //array to search for in case of jaeger query MatchType MatchFilterType NegateMatch bool RegexpString string // Do not manually set this. Use SetRegexp(). This is only public to allow for GOB encoding MatchFilter. // contains filtered or unexported fields }
MatchFilter searches for all words in matchWords in the column matchColumn The matchOperator defines if all or any of the matchWords need to be present
func (*MatchFilter) GetAllBlockBloomKeysToSearch ¶
func (*MatchFilter) GetQueryInfo ¶
func (m *MatchFilter) GetQueryInfo() *QueryInfo
func (*MatchFilter) IsMatchAll ¶
func (mf *MatchFilter) IsMatchAll() bool
we expect a matchColumn == * AND matchWords == *
func (*MatchFilter) SetRegexp ¶
func (m *MatchFilter) SetRegexp(compileRegex *regexp.Regexp)
type MatchFilterType ¶
type MatchFilterType uint8
const ( MATCH_WORDS MatchFilterType = iota + 1 MATCH_PHRASE MATCH_DICT_ARRAY )
type MathEvaluator ¶
type MathEvaluator struct { MathCol string `json:"mathCol,omitempty"` MathFunc utils.MathFunctions `json:"mathFunc,omitempty"` StrEnc string `json:"strEnc,omitempty"` ValueColRequest *ValueExpr `json:"valueCol,omitempty"` }
type MeasureAggregator ¶
type MeasureAggregator struct { MeasureCol string `json:"measureCol,omitempty"` MeasureFunc utils.AggregateFunctions `json:"measureFunc,omitempty"` StrEnc string `json:"strEnc,omitempty"` ValueColRequest *ValueExpr `json:"valueColRequest,omitempty"` OverrodeMeasureAgg *MeasureAggregator `json:"overrideFunc,omitempty"` Param string }
func (*MeasureAggregator) String ¶
func (ma *MeasureAggregator) String() string
type MemoryTracker ¶
type MemoryTracker struct { TotalAllocatableBytes uint64 // total bytes that can be allocated. This should not include CmiRuntimeAllocatedBytes CmiInMemoryAllocatedBytes uint64 CmiRuntimeAllocatedBytes uint64 SegSearchRequestedBytes uint64 SegWriterUsageBytes uint64 SegStoreSummary *AllSegStoreSummary SsmInMemoryAllocatedBytes uint64 MetricsSegmentMaxSize uint64 }
type MetricQueryAgg ¶
type MetricQueryAgg struct { AggBlockType MetricQueryAggBlockType AggregatorBlock *Aggregation FunctionBlock *Function Next *MetricQueryAgg }
type MetricQueryAggBlockType ¶
type MetricQueryAggBlockType int
const ( AggregatorBlock MetricQueryAggBlockType = iota + 1 FunctionBlock )
type MetricsMeta ¶
type MetricsMeta struct { MSegmentDir string `json:"mSegmentDir"` NumBlocks uint16 `json:"numBlocks"` BytesReceivedCount uint64 `json:"bytesReceivedCount"` OnDiskBytes uint64 `json:"onDiskBytes"` TagKeys map[string]bool `json:"tagKeys"` EarliestEpochSec uint32 `json:"earliestEpochSec"` LatestEpochSec uint32 `json:"latestEpochSec"` TTreeDir string `json:"TTreeDir"` DatapointCount uint64 `json:"approximateDatapointCount"` OrgId uint64 `json:"orgid"` }
type MetricsQuery ¶
type MetricsQuery struct { MetricName string // metric name to query for. MetricOperator utils.TagOperator // operator to apply on metric name MetricNameRegexPattern string // regex pattern to apply on metric name QueryHash uint64 // hash of the query HashedMName uint64 PqlQueryType parser.ValueType // promql query type Aggregator Aggregation Function Function Downsampler Downsampler TagsFilters []*TagsFilter // all tags filters to apply TagIndicesToKeep map[int]struct{} // indices of tags to keep in the result SelectAllSeries bool //flag to select all series - for promQl MQueryAggs *MetricQueryAgg OrgId uint64 // organization id ExitAfterTagsSearch bool // flag to exit after raw tags search TagValueSearchOnly bool // flag to search only tag values GetAllLabels bool // flag to get all label sets for each time series Groupby bool // flag to group by tags GroupByMetricName bool // flag to group by metric name // contains filtered or unexported fields }
Struct to represent a single metrics query request.
func (*MetricsQuery) GetNumStarFilters ¶
func (mq *MetricsQuery) GetNumStarFilters() int
func (*MetricsQuery) GetNumValueFilters ¶
func (mq *MetricsQuery) GetNumValueFilters() uint32
func (*MetricsQuery) IsRegexOnMetricName ¶
func (mQuery *MetricsQuery) IsRegexOnMetricName() bool
func (*MetricsQuery) ReorderTagFilters ¶
func (mq *MetricsQuery) ReorderTagFilters()
Fixes the order of tags filters to be in the following order: 1. other tag filters 2. * tag filters
type MetricsQueryProcessingMetrics ¶
type MetricsQueryProcessingMetrics struct { UpdateLock *sync.Mutex NumMetricsSegmentsSearched uint64 NumTSOFilesLoaded uint64 NumTSGFilesLoaded uint64 NumSeriesSearched uint64 TimeLoadingTSOFiles time.Duration TimeLoadingTSGFiles time.Duration }
func (*MetricsQueryProcessingMetrics) IncrementNumMetricsSegmentsSearched ¶
func (qm *MetricsQueryProcessingMetrics) IncrementNumMetricsSegmentsSearched(records uint64)
func (*MetricsQueryProcessingMetrics) IncrementNumSeriesSearched ¶
func (qm *MetricsQueryProcessingMetrics) IncrementNumSeriesSearched(records uint64)
func (*MetricsQueryProcessingMetrics) IncrementNumTSGFilesLoaded ¶
func (qm *MetricsQueryProcessingMetrics) IncrementNumTSGFilesLoaded(records uint64)
func (*MetricsQueryProcessingMetrics) IncrementNumTSOFilesLoaded ¶
func (qm *MetricsQueryProcessingMetrics) IncrementNumTSOFilesLoaded(records uint64)
func (*MetricsQueryProcessingMetrics) SetTimeLoadingTSGFiles ¶
func (qm *MetricsQueryProcessingMetrics) SetTimeLoadingTSGFiles(ttime time.Duration)
func (*MetricsQueryProcessingMetrics) SetTimeLoadingTSOFiles ¶
func (qm *MetricsQueryProcessingMetrics) SetTimeLoadingTSOFiles(ttime time.Duration)
type MetricsQueryRequest ¶
type MetricsQueryRequest struct { TimeRange dtu.MetricsTimeRange MetricsQuery MetricsQuery }
Struct to represent the metrics query request and its corresponding timerange
type MetricsQueryResponse ¶
type MetricsSearchRequest ¶
type MultiColLetRequest ¶
type MultiColLetRequest struct { LeftCName string Oper utils.LogicalAndArithmeticOperator RightCName string }
type MultiValueColLetRequest ¶
type MultiValueColLetRequest struct { Command string // name of the command: makemv, mvcombine, mvexpand, etc. ColName string DelimiterString string // delimiter string to split the column value. default is " " (single space) IsRegex bool AllowEmpty bool // if true, empty strings are allowed in the split values. default is false Setsv bool // if true, split values are combined into a single value. default is false Limit int64 }
type MultiValueExpr ¶
type MultiValueExpr struct { MultiValueExprMode MultiValueExprMode Op string Condition *BoolExpr // To filter out values that do not meet the criteria within a multivalue field NumericExprParams []*NumericExpr StringExprParams []*StringExpr MultiValueExprParams []*MultiValueExpr ValueExprParams []*ValueExpr InferTypes bool // To specify that the mv_to_json_array function should attempt to infer JSON data types when it converts field values into array elements. FieldName string }
func (*MultiValueExpr) Evaluate ¶
func (self *MultiValueExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
func (*MultiValueExpr) GetFields ¶
func (self *MultiValueExpr) GetFields() []string
type MultiValueExprMode ¶
type MultiValueExprMode uint8
type NodeAggregation ¶
type NodeAggregation struct { AggregationFunctions utils.AggregateFunctions // function to apply on results of children (e.g. min, max) AggregationColumns []string // column names to aggregate on (i.e avg over which column name?) }
type NodeResult ¶
type NodeResult struct { AllRecords []*utils.RecordResultContainer ErrList []error // Need to eventually replace ErrList with GlobalSearchErrors to prevent duplicate errors GlobalSearchErrors map[string]*SearchErrorInfo // maps global error from error message -> error info Histogram map[string]*AggregationResult TotalResults *QueryCount VectorResultValue float64 RenameColumns map[string]string SegEncToKey map[uint16]string TotalRRCCount uint64 MeasureFunctions []string `json:"measureFunctions,omitempty"` MeasureResults []*BucketHolder `json:"measure,omitempty"` GroupByCols []string `json:"groupByCols,omitempty"` Qtype string `json:"qtype,omitempty"` BucketCount int `json:"bucketCount,omitempty"` PerformAggsOnRecs bool // if true, perform aggregations on records that are returned from rrcreader.go RecsAggsType PipeCommandType // To determine Whether it is GroupByType or MeasureAggsType GroupByRequest *GroupByRequest MeasureOperations []*MeasureAggregator NextQueryAgg *QueryAggregators RecsAggsBlockResults interface{} // Evaluates to *blockresults.BlockResults RecsAggsColumnKeysMap map[string][]interface{} // map of column name to column keys for GroupBy Recs RecsAggsProcessedSegments uint64 RecsRunningSegStats []*SegStats TransactionEventRecords map[string]map[string]interface{} TransactionsProcessed map[string]map[string]interface{} ColumnsOrder map[string]int RawSearchFinished bool CurrentSearchResultCount int AllSearchColumnsByTimeRange map[string]bool FinalColumns map[string]bool AllColumnsInAggs map[string]struct{} RemoteLogs []map[string]interface{} }
A helper struct to keep track of errors and results together In cases of partial failures, both logLines and errList can be defined
func (*NodeResult) ApplyScroll ¶
func (nr *NodeResult) ApplyScroll(scroll int)
func (*NodeResult) StoreGlobalSearchError ¶
func (nodeRes *NodeResult) StoreGlobalSearchError(errMsg string, logLevel log.Level, err error)
type Numbers ¶
type NumericExpr ¶
type NumericExpr struct { NumericExprMode NumericExprMode IsTerminal bool // Only used when IsTerminal is true. ValueIsField bool Value string // Only used when IsTerminal is false. Op string // Including arithmetic, mathematical and text functions ops Left *NumericExpr Right *NumericExpr Val *StringExpr RelativeTime utils.RelativeTimeExpr }
func (*NumericExpr) Evaluate ¶
func (self *NumericExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure) (float64, error)
Evaluate this NumericExpr to a float, replacing each field in the expression with the value specified by fieldToValue. Each field listed by GetFields() must be in fieldToValue.
func (*NumericExpr) GetFields ¶
func (self *NumericExpr) GetFields() []string
func (*NumericExpr) GetNullFields ¶
func (self *NumericExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
type NumericExprMode ¶
type NumericExprMode uint8
type NumericStats ¶
type NumericStats struct { Min utils.NumTypeEnclosure `json:"min,omitempty"` Max utils.NumTypeEnclosure `json:"max,omitempty"` Sum utils.NumTypeEnclosure `json:"sum,omitempty"` Dtype utils.SS_DTYPE `json:"Dtype,omitempty"` // Dtype shared across min,max, and sum }
func (*NumericStats) Merge ¶
func (ss *NumericStats) Merge(other *NumericStats)
type OTSDBMetricsQueryExpFilter ¶
type OTSDBMetricsQueryExpFilter struct { Tags []OTSDBMetricsQueryExpTags `json:"tags"` Id string `json:"id"` }
type OTSDBMetricsQueryExpRequest ¶
type OTSDBMetricsQueryExpRequest struct { Time OTSDBMetricsQueryExpTime `json:"time"` Filters []OTSDBMetricsQueryExpFilter `json:"filters"` Metrics []OTSDBMetricsQueryExpMetric `json:"metrics"` Expressions []OTSDBMetricsQueryExpressions `json:"expressions"` Outputs []OTSDBMetricsQueryExpOutput `json:"outputs"` }
type OTSDBMetricsQueryExpTime ¶
type OTSDBMetricsQueryExpTime struct { Start interface{} `json:"start"` End interface{} `json:"end"` Timezone string `json:"timezone"` Aggregator string `json:"aggregator"` Downsampler OTSDBMetricsQueryExpDownsampler `json:"downsampler"` }
type OrderByAggregator ¶
type OutputTransforms ¶
type OutputTransforms struct { HarcodedCol []string RenameHardcodedColumns map[string]string OutputColumns *ColumnsRequest // post processing on output columns LetColumns *LetColumnsRequest // let columns processing on output columns FilterRows *BoolExpr // discard rows failing some condition TailRequest *TailExpr HeadRequest *HeadExpr }
type PipeCommandType ¶
type PipeCommandType uint8
const ( OutputTransformType PipeCommandType = iota + 1 MeasureAggsType GroupByType TransactionType VectorArithmeticExprType GenerateEventType )
type QueryAggregators ¶
type QueryAggregators struct { PipeCommandType PipeCommandType OutputTransforms *OutputTransforms MeasureOperations []*MeasureAggregator MathOperations []*MathEvaluator VectorArithmeticExpr *NumericExpr TimeHistogram *TimeBucket // Request for time histograms GroupByRequest *GroupByRequest // groupby aggregation request Sort *SortRequest // how to sort resulting data EarlyExit bool // should query early exit BucketLimit int ShowRequest *ShowRequest TableName string TransactionArguments *TransactionArguments StatsOptions *StatsOptions StreamStatsOptions *StreamStatsOptions GenerateEvent *GenerateEvent Next *QueryAggregators Limit int }
Update this function: GetAllColsInAggsIfStatsPresent() to return all columns in the query aggregators if stats are present. This function should return all columns in the query aggregators if stats are present.
func InitDefaultQueryAggregations ¶
func InitDefaultQueryAggregations() *QueryAggregators
Init default query aggregators. By default, a descending sort is added
func (*QueryAggregators) AllColumnsByTimeRangeIsRequired ¶
func (qa *QueryAggregators) AllColumnsByTimeRangeIsRequired() bool
To determine whether to fetch all the columns by time range. Currently, it is only used in the case of FillNullExpr
func (*QueryAggregators) AttachColumnsRequestToFillNullExprInChain ¶
func (qa *QueryAggregators) AttachColumnsRequestToFillNullExprInChain(colRequest *ColumnsRequest)
func (*QueryAggregators) CanLimitBuckets ¶
func (qa *QueryAggregators) CanLimitBuckets() bool
func (*QueryAggregators) CheckForColRequestAndAttachToFillNullExprInChain ¶
func (qa *QueryAggregators) CheckForColRequestAndAttachToFillNullExprInChain()
func (*QueryAggregators) GetAllColsInAggsIfStatsPresent ¶
func (qa *QueryAggregators) GetAllColsInAggsIfStatsPresent() map[string]struct{}
returns all columns in the query aggregators if stats are present. Update this function whenever a new struct or a new Column Field is added to the query aggregators.
func (*QueryAggregators) GetAllColsInChainUpToFirstStatsBlock ¶
func (qa *QueryAggregators) GetAllColsInChainUpToFirstStatsBlock(cols map[string]struct{})
func (*QueryAggregators) GetSortLimit ¶
func (qa *QueryAggregators) GetSortLimit() uint64
func (*QueryAggregators) HasAppendInChain ¶
func (qa *QueryAggregators) HasAppendInChain() bool
func (*QueryAggregators) HasBinBlock ¶
func (qa *QueryAggregators) HasBinBlock() bool
func (*QueryAggregators) HasBinInChain ¶
func (qa *QueryAggregators) HasBinInChain() bool
func (*QueryAggregators) HasColumnsRequest ¶
func (qa *QueryAggregators) HasColumnsRequest() bool
func (*QueryAggregators) HasDedupBlock ¶
func (qa *QueryAggregators) HasDedupBlock() bool
func (*QueryAggregators) HasDedupBlockInChain ¶
func (qa *QueryAggregators) HasDedupBlockInChain() bool
func (*QueryAggregators) HasFillNullExpr ¶
func (qa *QueryAggregators) HasFillNullExpr() bool
func (*QueryAggregators) HasFillNullExprInChain ¶
func (qa *QueryAggregators) HasFillNullExprInChain() bool
func (*QueryAggregators) HasGenerateEvent ¶
func (qa *QueryAggregators) HasGenerateEvent() bool
func (*QueryAggregators) HasGeneratedEventsWithoutSearch ¶
func (qa *QueryAggregators) HasGeneratedEventsWithoutSearch() bool
func (*QueryAggregators) HasGroupByOrMeasureAggsInBlock ¶
func (qa *QueryAggregators) HasGroupByOrMeasureAggsInBlock() bool
func (*QueryAggregators) HasGroupByOrMeasureAggsInChain ¶
func (qa *QueryAggregators) HasGroupByOrMeasureAggsInChain() bool
func (*QueryAggregators) HasInChain ¶
func (qa *QueryAggregators) HasInChain(hasInCur queryAggregatorsBoolFunc) bool
func (*QueryAggregators) HasListFunc ¶
func (qa *QueryAggregators) HasListFunc() bool
func (*QueryAggregators) HasQueryAggergatorBlock ¶
func (qa *QueryAggregators) HasQueryAggergatorBlock() bool
To determine whether it contains certain specific AggregatorBlocks, such as: Rename Block, Rex Block, FilterRows, MaxRows...
func (*QueryAggregators) HasQueryAggergatorBlockInChain ¶
func (qa *QueryAggregators) HasQueryAggergatorBlockInChain() bool
func (*QueryAggregators) HasRexBlockInChainWithStats ¶
func (qa *QueryAggregators) HasRexBlockInChainWithStats() bool
func (*QueryAggregators) HasRexBlockInQA ¶
func (qa *QueryAggregators) HasRexBlockInQA() bool
func (*QueryAggregators) HasSortBlock ¶
func (qa *QueryAggregators) HasSortBlock() bool
func (*QueryAggregators) HasSortBlockInChain ¶
func (qa *QueryAggregators) HasSortBlockInChain() bool
func (*QueryAggregators) HasStatsBlock ¶
func (qa *QueryAggregators) HasStatsBlock() bool
func (*QueryAggregators) HasStatsBlockInChain ¶
func (qa *QueryAggregators) HasStatsBlockInChain() bool
func (*QueryAggregators) HasStreamStats ¶
func (qa *QueryAggregators) HasStreamStats() bool
func (*QueryAggregators) HasStreamStatsInChain ¶
func (qa *QueryAggregators) HasStreamStatsInChain() bool
func (*QueryAggregators) HasTail ¶
func (qa *QueryAggregators) HasTail() bool
func (*QueryAggregators) HasTailInChain ¶
func (qa *QueryAggregators) HasTailInChain() bool
func (*QueryAggregators) HasTransactionArguments ¶
func (qa *QueryAggregators) HasTransactionArguments() bool
func (*QueryAggregators) HasTransactionArgumentsInChain ¶
func (qa *QueryAggregators) HasTransactionArgumentsInChain() bool
func (*QueryAggregators) HasValueColRequest ¶
func (qa *QueryAggregators) HasValueColRequest() bool
To determine whether it contains ValueColRequest
func (*QueryAggregators) HasValuesFunc ¶
func (qa *QueryAggregators) HasValuesFunc() bool
To determine whether it contains Aggregate Func: Values()
func (*QueryAggregators) IsAggsEmpty ¶
func (qa *QueryAggregators) IsAggsEmpty() bool
func (*QueryAggregators) IsStatisticBlockEmpty ¶
func (qa *QueryAggregators) IsStatisticBlockEmpty() bool
func (*QueryAggregators) IsStatsAggPresentInChain ¶
func (qa *QueryAggregators) IsStatsAggPresentInChain() bool
func (*QueryAggregators) UsedByTimechart ¶
func (qa *QueryAggregators) UsedByTimechart() bool
type QueryArithmetic ¶
type QueryArithmetic struct { OperationId uint64 LHS uint64 RHS uint64 LHSExpr *QueryArithmetic RHSExpr *QueryArithmetic ConstantOp bool Operation utils.LogicalAndArithmeticOperator ReturnBool bool // If a comparison operator, return 0/1 rather than filtering. Constant float64 // maps groupid to a map of ts to value. This aggregates DsResults based on the aggregation function Results map[string]map[uint32]float64 OperatedState bool //true if operation has been executed VectorMatching *VectorMatching }
Struct to represent the metrics arithmetic request and its corresponding timerange
type QueryContext ¶
type QueryContext struct { TableInfo *TableInfo SizeLimit uint64 Scroll int Orgid uint64 RawQuery string }
New struct for passin query params
func InitQueryContext ¶
func (*QueryContext) GetNumTables ¶
func (qc *QueryContext) GetNumTables() int
gets the number of tables that will be queried
type QueryCount ¶
type QueryCount struct { TotalCount uint64 // total number of Op utils.FilterOperator EarlyExit bool // if early exit was requested or not }
type QueryProcessingMetrics ¶
type QueryProcessingMetrics struct { NumRecordsMatched uint64 NumBlocksWithMatch uint64 NumBlocksToRawSearch uint64 NumBlocksInSegment uint64 NumRecordsToRawSearch uint64 NumRecordsUnmatched uint64 }
func (*QueryProcessingMetrics) IncrementNumBlocksToRawSearch ¶
func (qm *QueryProcessingMetrics) IncrementNumBlocksToRawSearch(records uint64)
func (*QueryProcessingMetrics) IncrementNumBlocksWithMatch ¶
func (qm *QueryProcessingMetrics) IncrementNumBlocksWithMatch(nBlocks uint64)
func (*QueryProcessingMetrics) IncrementNumRecordsNoMatch ¶
func (qm *QueryProcessingMetrics) IncrementNumRecordsNoMatch(nBlocks uint64)
func (*QueryProcessingMetrics) IncrementNumRecordsWithMatch ¶
func (qm *QueryProcessingMetrics) IncrementNumRecordsWithMatch(nBlocks uint64)
func (*QueryProcessingMetrics) SetNumBlocksInSegFile ¶
func (qm *QueryProcessingMetrics) SetNumBlocksInSegFile(records uint64)
func (*QueryProcessingMetrics) SetNumBlocksToRawSearch ¶
func (qm *QueryProcessingMetrics) SetNumBlocksToRawSearch(records uint64)
func (*QueryProcessingMetrics) SetNumRecordsMatched ¶
func (qm *QueryProcessingMetrics) SetNumRecordsMatched(records uint64)
func (*QueryProcessingMetrics) SetNumRecordsToRawSearch ¶
func (qm *QueryProcessingMetrics) SetNumRecordsToRawSearch(records uint64)
func (*QueryProcessingMetrics) SetNumRecordsUnmatched ¶
func (qm *QueryProcessingMetrics) SetNumRecordsUnmatched(records uint64)
type RangeBucket ¶
type RenameExpr ¶
type RenameExpr struct { RenameExprMode RenameExprMode OriginalPattern string NewPattern string }
func (*RenameExpr) CheckIfMatch ¶
func (self *RenameExpr) CheckIfMatch(colName string) bool
Check if colName match the OriginalPattern
func (*RenameExpr) Evaluate ¶
func (self *RenameExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure, fieldName string) (string, error)
func (*RenameExpr) GetFields ¶
func (self *RenameExpr) GetFields() []string
func (*RenameExpr) GetNullFields ¶
func (self *RenameExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
func (*RenameExpr) ProcessRenameRegexExpression ¶
func (self *RenameExpr) ProcessRenameRegexExpression(colName string) (string, error)
Check if colName matches the specified pattern and replace wildcards to generate a new colName.
func (*RenameExpr) RemoveBucketHolderGroupByColumnsByIndex ¶
func (self *RenameExpr) RemoveBucketHolderGroupByColumnsByIndex(bucketHolder *BucketHolder, groupByCols []string, indexToRemove []int)
Remove unused GroupByVals in Bucket Holder
func (*RenameExpr) RemoveBucketResGroupByColumnsByIndex ¶
func (self *RenameExpr) RemoveBucketResGroupByColumnsByIndex(bucketResult *BucketResult, indexToRemove []int)
func (*RenameExpr) RemoveColsByIndex ¶
func (self *RenameExpr) RemoveColsByIndex(strs []string, indexToRemove []int) []string
type RenameExprMode ¶
type RenameExprMode uint8
type RowColOptions ¶
type RowColOptions struct { RowPrefix string // prefix for row. Default= "(" ColumnPrefix string // prefix for column. Default= "(" ColumnSeparator string // separator for column. Default= "AND" ColumnEnd string // end for column. Default= ")" RowSeparator string // separator for row. Default= "OR" RowEnd string // end for row. Default= ")" }
type RunningStreamStatsResults ¶
type RunningStreamStatsResults struct { Window *sutils.GobbableList CurrResult utils.CValueEnclosure NumProcessedRecords uint64 // kept for global stats where window = 0 SecondaryWindow *sutils.GobbableList // use secondary window for range RangeStat *RangeStat CardinalityMap map[string]int CardinalityHLL *sutils.GobbableHll ValuesMap map[string]struct{} }
type RunningStreamStatsWindowElement ¶
type RunningStreamStatsWindowElement struct { Index int Value utils.CValueEnclosure TimeInMilli uint64 }
type SPathExpr ¶
type SPathExpr struct { InputColName string // default is set to _raw Path string // the path to the field from which the values need to be extracted. IsPathFieldName bool // If true, the path is the field name and the value is the field value OutputColName string // the name of the column in the output table to which the extracted values will be written. By Default it is set the same as the path. }
To extract information from the structured data formats XML and JSON.
type SearchCondition ¶
type SearchCondition struct { SearchQueries []*SearchQuery SearchNode []*SearchNode }
func (*SearchCondition) AddQueryInfo ¶
func (c *SearchCondition) AddQueryInfo() SearchNodeType
type SearchExpression ¶
type SearchExpression struct { LeftSearchInput *SearchExpressionInput FilterOp FilterOperator RightSearchInput *SearchExpressionInput SearchInfo *SearchInfo }
A flattened expression used for searching leftSearchInput will always be defined, rightSearchInput may not be depending on filterOp
func (*SearchExpression) GetAllBlockBloomKeysToSearch ¶
func (searchExp *SearchExpression) GetAllBlockBloomKeysToSearch(dualCaseCheckEnabled bool, isCaseInsensitive bool) (map[string]bool, map[string]string, bool, error)
returns a map with keys, a boolean, and error the map will contain only non wildcarded keys, if bool is true, the searchExpression contained a wildcard
func (*SearchExpression) GetExpressionType ¶
func (searchExp *SearchExpression) GetExpressionType() SearchQueryType
func (*SearchExpression) GetQueryInfo ¶
func (se *SearchExpression) GetQueryInfo() *QueryInfo
func (*SearchExpression) IsMatchAll ¶
func (searchExp *SearchExpression) IsMatchAll() bool
func (*SearchExpression) IsTimeRangeFilter ¶
func (ef *SearchExpression) IsTimeRangeFilter() bool
type SearchExpressionInput ¶
type SearchExpressionInput struct { ColumnName string // columnName to search for ComplexRelation *Expression // complex relations that have columns defined in both sides ColumnValue *DtypeEnclosure // column value: "0", "abc", "abcd*", "0.213". This value will be normalized to Lower Case if the search is case insensitive. OriginalColumnValue *DtypeEnclosure // original column value. Similar to Column Value, but is only created when dualCaseCheck is enabled and the search is case insensitive }
A flattened expression input used for searching TODO: flatten SearchExpressionInput with just []byte input
type SearchInfo ¶
type SearchInfo struct { ColEncoding []byte QValDte *DtypeEnclosure }
type SearchMetadataHolder ¶
type SearchMetadataHolder struct { BlockSummaries []*BlockSummary BlockSummariesFile string SearchTotalMemory uint64 // total memory that this search would take, BlockSummaries + raw search buffers }
type SearchNode ¶
type SearchNode struct { AndSearchConditions *SearchCondition OrSearchConditions *SearchCondition ExclusionSearchConditions *SearchCondition NodeType SearchNodeType // type of search request }
func (*SearchNode) AddQueryInfoForNode ¶
func (r *SearchNode) AddQueryInfoForNode() SearchNodeType
func (*SearchNode) GetAllColumnsToSearch ¶
func (node *SearchNode) GetAllColumnsToSearch() (map[string]bool, bool)
type SearchNodeType ¶
type SearchNodeType uint8
******************************************* ******************************************* ******************************************* **************** NOTE ********************* any time you add a new element in the searchnode structs or in their sub structs, make sure to adjust the snhasher.go code to update the hashids, else PQS will incorrectly compute the hash id
Also DO NOT change the order of the struct fields, if you do then you have to adjust the order in snhasher.go as well, however in that case the first time when the new code will run, it will create new pqid values for existing queries
******************************************* ******************************************* *******************************************
const ( MatchAllQuery SearchNodeType = iota // query only needs to know a record's time range, no raw values ColumnValueQuery // query needs to know >0 non-timestamp column values InvalidQuery // an invalid query (e.g. invalid column name) )
func EditQueryTypeForInvalidColumn ¶
func EditQueryTypeForInvalidColumn(originalType SearchNodeType) SearchNodeType
type SearchQuery ¶
type SearchQuery struct { ExpressionFilter *SearchExpression MatchFilter *MatchFilter SearchType SearchQueryType // type of query QueryInfo *QueryInfo // query info FilterIsCaseInsensitive bool // whether the filter is case sensitive }
A Search query is either an expression or match filter Never will both be defined
func GetSearchQueryFromFilterCriteria ¶
func GetSearchQueryFromFilterCriteria(criteria *FilterCriteria, qid uint64) *SearchQuery
func (*SearchQuery) ExtractRangeFilterFromQuery ¶
func (query *SearchQuery) ExtractRangeFilterFromQuery(qid uint64) (map[string]string, FilterOperator, bool)
func (*SearchQuery) GetAllBlockBloomKeysToSearch ¶
func (query *SearchQuery) GetAllBlockBloomKeysToSearch() (map[string]bool, map[string]string, bool, LogicalOperator)
returns map[string]bool, bool, LogicalOperator map is all non-wildcard block bloom keys, bool is if any keyword contained a wildcard, LogicalOperator is if any/all of map keys need to exist
func (*SearchQuery) GetAllColumnsInQuery ¶
func (query *SearchQuery) GetAllColumnsInQuery() (map[string]bool, bool)
extract all columns from SearchQuery returns a map[string]bool, where key is the column name returns a bool that indicates whether a full wildcard is present (only "*")
func (*SearchQuery) GetQueryInfo ¶
func (n *SearchQuery) GetQueryInfo() SearchNodeType
func (*SearchQuery) GetQueryType ¶
func (q *SearchQuery) GetQueryType() SearchNodeType
func (*SearchQuery) IsMatchAll ¶
func (q *SearchQuery) IsMatchAll() bool
type SearchQueryType ¶
type SearchQueryType uint8
const ( MatchAll SearchQueryType = iota // match all data MatchWords // match words in a single column MatchWordsAllColumns // match words in any column SimpleExpression // simple expression has one column name an operator and a value to compare RegexExpression // regex expression has one column and a regex string column value RegexExpressionAllColumns // apply RegexExpression on all columns SimpleExpressionAllColumns // apply SimpleExpression on all columns ComplexExpression // complex expression relates multiple columns MatchDictArraySingleColumn MatchDictArrayAllColumns )
type SegMeta ¶
type SegMeta struct { SegmentKey string `json:"segmentKey"` EarliestEpochMS uint64 `json:"earliestEpochMs,omitempty"` LatestEpochMS uint64 `json:"latestEpochMs,omitempty"` SegbaseDir string `json:"segbaseDir,omitempty"` VirtualTableName string `json:"virtualTableName"` RecordCount int `json:"recordCount,omitempty"` BytesReceivedCount uint64 `json:"bytesReceivedCount,omitempty"` OnDiskBytes uint64 `json:"onDiskBytes,omitempty"` ColumnNames map[string]*ColSizeInfo `json:"columnNames,omitempty"` AllPQIDs map[string]bool `json:"pqids,omitempty"` NumBlocks uint16 `json:"numBlocks,omitempty"` OrgId uint64 `json:"orgid,omitempty"` }
type SegSetData ¶
type SegSetDataWithStrFname ¶
type SegSetFile ¶
type SegStats ¶
type SegStats struct { IsNumeric bool Count uint64 Hll *sutils.GobbableHll NumStats *NumericStats StringStats *StringStats Records []*utils.CValueEnclosure }
func (*SegStats) CreateHllFromBytes ¶
func (*SegStats) CreateNewHll ¶
func (ss *SegStats) CreateNewHll()
func (*SegStats) GetHllBytes ¶
func (*SegStats) GetHllBytesInPlace ¶
func (*SegStats) GetHllCardinality ¶
func (*SegStats) GetHllDataSize ¶
func (*SegStats) InsertIntoHll ¶
func (*SegStats) ToJSON ¶
func (ss *SegStats) ToJSON() (*SegStatsJSON, error)
convert SegStats to SegStatsJSON
type SegStatsJSON ¶
type SegStatsJSON struct { IsNumeric bool Count uint64 RawHll []byte NumStats *NumericStats StringStats *StringStats }
json exportable struct for segstats
func (*SegStatsJSON) ToStats ¶
func (ssj *SegStatsJSON) ToStats() (*SegStats, error)
type SegmentSearchRequest ¶
type SegmentSearchRequest struct { SegmentKey string SearchMetadata *SearchMetadataHolder AllBlocksToSearch map[uint16]*BlockMetadataHolder // maps all blocks needed to search to the BlockMetadataHolder needed to read VirtualTableName string AllPossibleColumns map[string]bool // all possible columns for the segKey LatestEpochMS uint64 // latest epoch time - used for query planning SType SegType CmiPassedCnames map[uint16]map[string]bool // maps blkNum -> colName -> true that have passed the cmi check HasMatchedRrc bool // flag to denote matches, so that we decide whether to send a websocket update ConsistentCValLenMap map[string]uint32 // map of column name to consistent column value length }
a struct for raw search to apply search on specific blocks within a file
func (*SegmentSearchRequest) CleanSearchMetadata ¶
func (ssr *SegmentSearchRequest) CleanSearchMetadata()
function used to nil out block sum and colmeta
func (*SegmentSearchRequest) GetMaxSearchMemorySize ¶
func (ssr *SegmentSearchRequest) GetMaxSearchMemorySize(parallelismPerFile int64, bitsetMinSize uint16) uint64
even if only one block will be searched and parallelism=10, we will spawn 10 buffers, although 9 wont be used TODO: more accurate block summaries and colmeta sizing
func (*SegmentSearchRequest) JoinColumnInfo ¶
func (ssr *SegmentSearchRequest) JoinColumnInfo(toJoin *SegmentSearchRequest)
merges toJoin.SearchColumns with ssr.SearchColumns
func (*SegmentSearchRequest) JoinRequest ¶
func (ssr *SegmentSearchRequest) JoinRequest(toJoin *SegmentSearchRequest, op LogicalOperator)
*
Logical operator only dictates how the block numbers should be resolved the CMIPassed names will always be unioned.
*
type ShowColumns ¶
type ShowColumns struct {
InTable string
}
type ShowFilter ¶
type ShowFilter struct {
Like string
}
type ShowRequest ¶
type ShowRequest struct { ShowTables bool ShowFilter *ShowFilter ShowTable string ColumnsRequest *ShowColumns }
type SingleAgg ¶
type SingleAgg struct {
MeasureOperations []*MeasureAggregator
}
type SingleColLetRequest ¶
type SingleColLetRequest struct { CName string Oper utils.LogicalAndArithmeticOperator Value *utils.DtypeEnclosure }
type SortElement ¶
type SortExpr ¶
type SortExpr struct { SortEles []*SortElement Limit uint64 SortAscending []int SortRecords map[string]map[string]interface{} NumProcessedSegments uint64 // contains filtered or unexported fields }
func (*SortExpr) AcquireProcessedSegmentsLock ¶
func (self *SortExpr) AcquireProcessedSegmentsLock()
func (*SortExpr) ReleaseProcessedSegmentsLock ¶
func (self *SortExpr) ReleaseProcessedSegmentsLock()
type SortRequest ¶
type SortRequest struct { ColName string // column name to sort on Ascending bool // if true, result is in ascending order. Else, result is in descending order }
How to sort results
type SortValue ¶
type SpanLength ¶
type SpanOptions ¶
type SpanOptions struct { DefaultSettings bool SpanLength *SpanLength }
type SplitByClause ¶
type StatisticExpr ¶
type StatisticExpr struct { StatisticFunctionMode StatisticFunctionMode Limit string StatisticOptions *StatisticOptions FieldList []string //Must have FieldList ByClause []string }
func (*StatisticExpr) GetFields ¶
func (self *StatisticExpr) GetFields() []string
func (*StatisticExpr) OverrideGroupByCol ¶
func (self *StatisticExpr) OverrideGroupByCol(bucketResult *BucketResult, resTotal uint64) error
func (*StatisticExpr) RemoveFieldsNotInExprForBucketRes ¶
func (self *StatisticExpr) RemoveFieldsNotInExprForBucketRes(bucketResult *BucketResult) error
Only display fields which in StatisticExpr
func (*StatisticExpr) SetCountToStatRes ¶
func (self *StatisticExpr) SetCountToStatRes(statRes map[string]utils.CValueEnclosure, elemCount uint64)
func (*StatisticExpr) SetPercToStatRes ¶
func (self *StatisticExpr) SetPercToStatRes(statRes map[string]utils.CValueEnclosure, elemCount uint64, resTotal uint64)
func (*StatisticExpr) SortBucketResult ¶
func (self *StatisticExpr) SortBucketResult(results *[]*BucketResult) error
type StatisticFunctionMode ¶
type StatisticFunctionMode uint8
type StatisticOptions ¶
type StatsFuncChecker ¶
type StatsFuncChecker struct{}
func (StatsFuncChecker) IsUnsupported ¶
func (c StatsFuncChecker) IsUnsupported(funcName utils.AggregateFunctions) bool
type StatsOptions ¶
type StreamStatsOptions ¶
type StreamStatsOptions struct { AllNum bool Current bool Global bool ResetOnChange bool Window uint64 ResetBefore *BoolExpr ResetAfter *BoolExpr TimeWindow *BinSpanLength // expensive for large data and window size // maps index of measureAgg -> bucket key -> RunningStreamStatsResults RunningStreamStats map[int]map[string]*RunningStreamStatsResults // contains segment records recordKey -> record SegmentRecords map[string]map[string]interface{} NumProcessedRecords uint64 }
type StringExpr ¶
type StringExpr struct { StringExprMode StringExprMode RawString string // only used when mode is RawString StringList []string // only used when mode is RawStringList FieldName string // only used when mode is Field ConcatExpr *ConcatExpr // only used when mode is Concat TextExpr *TextExpr // only used when mode is TextExpr FieldList []string // only used when you want fields in the string from the parser }
func (*StringExpr) Evaluate ¶
func (self *StringExpr) Evaluate(fieldToValue map[string]utils.CValueEnclosure) (string, error)
func (*StringExpr) GetFields ¶
func (self *StringExpr) GetFields() []string
func (*StringExpr) GetNullFields ¶
func (self *StringExpr) GetNullFields(fieldToValue map[string]utils.CValueEnclosure) ([]string, error)
type StringExprMode ¶
type StringExprMode uint8
type StringStats ¶
func (*StringStats) Merge ¶
func (ss *StringStats) Merge(other *StringStats)
type TMLimitResult ¶
type TMLimitResult struct { ValIsInLimit map[string]bool GroupValScoreMap map[string]*utils.CValueEnclosure Hll *toputils.GobbableHll StrSet map[string]struct{} OtherCValArr []*utils.CValueEnclosure }
This structure is used to store values which are not within limit. And These values will be merged into the 'other' category.
type TableInfo ¶
type TableInfo struct {
// contains filtered or unexported fields
}
Helper struct to keep track of raw and expanded tables
func (*TableInfo) GetKibanaIndices ¶
func (*TableInfo) GetNumIndices ¶
func (*TableInfo) GetQueryTables ¶
func (*TableInfo) GetRawRequest ¶
type TagValueIndex ¶
type TagValueIndex struct {
// contains filtered or unexported fields
}
type TagValueType ¶
type TagValueType string
const ( StarValue TagValueType = "*" ValueString TagValueType = "string" )
Values for TagValueType
type TagsFilter ¶
type TagsFilter struct { TagKey string RawTagValue interface{} //change it to utils.DtypeEnclosure later HashTagValue uint64 TagOperator utils.TagOperator LogicalOperator utils.LogicalOperator NotInitialGroup bool }
Represents a single tag filter for a metric query
func (*TagsFilter) IsRegex ¶
func (tf *TagsFilter) IsRegex() bool
type TcOptions ¶
type TcOptions struct { BinOptions *BinOptions UseNull bool UseOther bool NullStr string OtherStr string }
type TextExpr ¶
type TextExpr struct { IsTerminal bool Op string //lower, ltrim, rtrim Param *StringExpr StrToRemove string Delimiter *StringExpr MultiValueExpr *MultiValueExpr ValueList []*StringExpr StartIndex *NumericExpr LengthExpr *NumericExpr Val *ValueExpr Cluster *Cluster // generates a cluster label SPathExpr *SPathExpr // To extract information from the structured data formats XML and JSON. Regex *toputils.GobbableRegex }
func (*TextExpr) EvaluateText ¶
func (*TextExpr) GetNullFields ¶
type TimeBucket ¶
type TimeBucket struct { IntervalMillis uint64 // size of each histogram bucket in millis StartTime uint64 // start time of histogram EndTime uint64 // end time of histogram AggName string // name of aggregation Timechart *TimechartExpr }
type TimechartExpr ¶
type TimechartExpr struct { TcOptions *TcOptions BinOptions *BinOptions SingleAgg *SingleAgg ByField string // group by this field inside each time range bucket (timechart) LimitExpr *LimitExpr }
type TransactionArguments ¶
type TransactionArguments struct { SortedRecordsSlice []map[string]interface{} OpenTransactionsState map[string]*TransactionGroupState OpenTransactionEvents map[string][]map[string]interface{} Fields []string StartsWith *FilterStringExpr EndsWith *FilterStringExpr }
type TransactionGroupState ¶
type ValueBucket ¶
type ValueBucket struct { BucketKey string // columnName for which to create buckets on MinBucketSize uint64 // min count per bucket Count uint64 // limit number of resulting histograms CatchAll bool ValueOrder *ValueOrder // how to return filter buckets }
type ValueExpr ¶
type ValueExpr struct { ValueExprMode ValueExprMode FloatValue float64 NumericExpr *NumericExpr StringExpr *StringExpr ConditionExpr *ConditionExpr BooleanExpr *BoolExpr MultiValueExpr *MultiValueExpr }
See ValueExprMode type definition for which fields are valid for each mode.
func (*ValueExpr) EvaluateToFloat ¶
func (self *ValueExpr) EvaluateToFloat(fieldToValue map[string]utils.CValueEnclosure) (float64, error)
Try evaluating this ValueExpr to a float value, replacing each field in the expression with the value specified by fieldToValue. Each field listed by GetFields() must be in fieldToValue.
A ValueExpr can be evaluated to a string or float, so if this fails you may want to call ValueExpr.EvaluateToString().
func (*ValueExpr) EvaluateToMultiValue ¶
func (*ValueExpr) EvaluateToString ¶
func (self *ValueExpr) EvaluateToString(fieldToValue map[string]utils.CValueEnclosure) (string, error)
Try evaluating this ValueExpr to a string value, replacing each field in the expression with the value specified by fieldToValue. Each field listed by GetFields() must be in fieldToValue.
A ValueExpr can be evaluated to a string or float, so if this fails you may want to call ValueExpr.EvaluateToFloat().
func (*ValueExpr) EvaluateValueExpr ¶
func (expr *ValueExpr) EvaluateValueExpr(fieldToValue map[string]utils.CValueEnclosure) (interface{}, string, error)
This function will first try to evaluate the ValueExpr to a float. If that fails, it will try to evaluate it to a string. If that fails, it will return an error.
func (*ValueExpr) EvaluateValueExprAsString ¶
func (self *ValueExpr) EvaluateValueExprAsString(fieldToValue map[string]utils.CValueEnclosure) (string, error)
In this case, if we can not evaluate numeric expr to a float, we should evaluate it as a str
func (*ValueExpr) GetNullFields ¶
type ValueExprMode ¶
type ValueExprMode uint8
type ValueOrder ¶
type ValueOrder struct {
Ascending bool // should results be given in ascending order or descending. (true = ascending, false = descending)
}
type VectorMatchCardinality ¶
type VectorMatchCardinality int
VectorMatchCardinality describes the cardinality relationship of two Vectors in a binary operation.
const ( CardOneToOne VectorMatchCardinality = iota CardManyToOne CardOneToMany CardManyToMany )
type VectorMatching ¶
type VectorMatching struct { // The cardinality of the two Vectors. Cardinality VectorMatchCardinality // MatchingLabels contains the labels which define equality of a pair of // elements from the Vectors. MatchingLabels []string // On includes the given label names from matching, // rather than excluding them. On bool }
VectorMatching describes how elements from two Vectors in a binary operation are supposed to be matched.