本文整理汇总了Golang中github.com/influxdb/influxdb/parser.QuerySpec.IsAscending方法的典型用法代码示例。如果您正苦于以下问题:Golang QuerySpec.IsAscending方法的具体用法?Golang QuerySpec.IsAscending怎么用?Golang QuerySpec.IsAscending使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/influxdb/influxdb/parser.QuerySpec
的用法示例。
在下文中一共展示了QuerySpec.IsAscending方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: executeMergeQuery
func (self *Shard) executeMergeQuery(querySpec *parser.QuerySpec, processor engine.Processor, t parser.FromClauseType) error {
seriesAndColumns := querySpec.SelectQuery().GetReferencedColumns()
iterators := make([]*PointIterator, len(seriesAndColumns))
streams := make([]engine.StreamQuery, len(iterators))
i := 0
var err error
for s, c := range seriesAndColumns {
c, iterators[i], err = self.getPointIteratorForSeries(querySpec, s.Name, c)
if err != nil {
log.Error(err)
return err
}
defer iterators[i].Close()
aliases := querySpec.SelectQuery().GetTableAliases(s.Name)
if len(aliases) > 1 {
return fmt.Errorf("Cannot have the same table joined more than once")
}
streams[i] = PointIteratorStream{
pi: iterators[i],
name: aliases[0],
fields: c,
}
i++
}
h := engine.NewSeriesHeap(querySpec.IsAscending())
merger := engine.NewCME("Shard", streams, h, processor, t == parser.FromClauseMerge)
if _, err := merger.Update(); err != nil {
return err
}
return nil
}
示例2: GetShardsForQuery
func (self *ClusterConfiguration) GetShardsForQuery(querySpec *parser.QuerySpec) Shards {
shards := self.getShardsToMatchQuery(querySpec)
shards = self.getShardRange(querySpec, shards)
if querySpec.IsAscending() {
SortShardsByTimeAscending(shards)
}
return shards
}
示例3: GetShardsForQuery
func (self *ClusterConfiguration) GetShardsForQuery(querySpec *parser.QuerySpec) (Shards, error) {
shards, err := self.getShardsToMatchQuery(querySpec)
if err != nil {
return nil, err
}
log.Debug("Querying %d shards for query", len(shards))
shards = self.getShardRange(querySpec, shards)
if querySpec.IsAscending() {
SortShardsByTimeAscending(shards)
}
return shards, nil
}