本文整理汇总了Golang中parser.QuerySpec.Query方法的典型用法代码示例。如果您正苦于以下问题:Golang QuerySpec.Query方法的具体用法?Golang QuerySpec.Query怎么用?Golang QuerySpec.Query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parser.QuerySpec
的用法示例。
在下文中一共展示了QuerySpec.Query方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: runDropSeriesQuery
func (self *CoordinatorImpl) runDropSeriesQuery(querySpec *parser.QuerySpec, seriesWriter SeriesWriter) error {
user := querySpec.User()
db := querySpec.Database()
series := querySpec.Query().DropSeriesQuery.GetTableName()
if !user.IsClusterAdmin() && !user.IsDbAdmin(db) && !user.HasWriteAccess(series) {
return common.NewAuthorizationError("Insufficient permissions to drop series")
}
querySpec.RunAgainstAllServersInShard = true
return self.runQuerySpec(querySpec, seriesWriter)
}
示例2: executeDropSeriesQuery
func (self *Shard) executeDropSeriesQuery(querySpec *parser.QuerySpec, processor cluster.QueryProcessor) error {
database := querySpec.Database()
series := querySpec.Query().DropSeriesQuery.GetTableName()
err := self.dropSeries(database, series)
if err != nil {
return err
}
self.db.Compact()
return nil
}
示例3: runDropSeriesQuery
func (self *CoordinatorImpl) runDropSeriesQuery(querySpec *parser.QuerySpec, seriesWriter SeriesWriter) error {
user := querySpec.User()
db := querySpec.Database()
series := querySpec.Query().DropSeriesQuery.GetTableName()
if ok, err := self.permissions.AuthorizeDropSeries(user, db, series); !ok {
return err
}
querySpec.RunAgainstAllServersInShard = true
return self.runQuerySpec(querySpec, seriesWriter)
}
示例4: runDropSeriesQuery
func (self *CoordinatorImpl) runDropSeriesQuery(querySpec *parser.QuerySpec, seriesWriter SeriesWriter) error {
user := querySpec.User()
db := querySpec.Database()
series := querySpec.Query().DropSeriesQuery.GetTableName()
if ok, err := self.permissions.AuthorizeDropSeries(user, db, series); !ok {
return err
}
defer seriesWriter.Close()
fmt.Println("DROP series")
err := self.raftServer.DropSeries(db, series)
if err != nil {
return err
}
fmt.Println("DROP returning nil")
return nil
}
示例5: GetShards
func (self *ClusterConfiguration) GetShards(querySpec *parser.QuerySpec) []*ShardData {
self.shardsByIdLock.RLock()
defer self.shardsByIdLock.RUnlock()
if querySpec.IsDropSeriesQuery() {
seriesName := querySpec.Query().DropSeriesQuery.GetTableName()
if seriesName[0] < FIRST_LOWER_CASE_CHARACTER {
return self.longTermShards
}
return self.shortTermShards
}
shouldQueryShortTerm, shouldQueryLongTerm := querySpec.ShouldQueryShortTermAndLongTerm()
if shouldQueryLongTerm && shouldQueryShortTerm {
shards := make([]*ShardData, 0)
shards = append(shards, self.getShardRange(querySpec, self.shortTermShards)...)
shards = append(shards, self.getShardRange(querySpec, self.longTermShards)...)
if querySpec.IsAscending() {
SortShardsByTimeAscending(shards)
} else {
SortShardsByTimeDescending(shards)
}
return shards
}
var shards []*ShardData
if shouldQueryLongTerm {
shards = self.getShardRange(querySpec, self.longTermShards)
} else {
shards = self.getShardRange(querySpec, self.shortTermShards)
}
if querySpec.IsAscending() {
newShards := append([]*ShardData{}, shards...)
SortShardsByTimeAscending(newShards)
return newShards
}
return shards
}
示例6: executeDropSeriesQuery
func (self *LevelDbShard) executeDropSeriesQuery(querySpec *parser.QuerySpec, processor cluster.QueryProcessor) error {
database := querySpec.Database()
series := querySpec.Query().DropSeriesQuery.GetTableName()
return self.dropSeries(database, series)
}