当前位置: 首页>>代码示例>>Golang>>正文


Golang DeleteQuery.GetQueryStringWithTimeCondition方法代码示例

本文整理汇总了Golang中parser.DeleteQuery.GetQueryStringWithTimeCondition方法的典型用法代码示例。如果您正苦于以下问题:Golang DeleteQuery.GetQueryStringWithTimeCondition方法的具体用法?Golang DeleteQuery.GetQueryStringWithTimeCondition怎么用?Golang DeleteQuery.GetQueryStringWithTimeCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在parser.DeleteQuery的用法示例。


在下文中一共展示了DeleteQuery.GetQueryStringWithTimeCondition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: handleSeriesDelete

func (self *CoordinatorImpl) handleSeriesDelete(user common.User, server *ClusterServer, database string, query *parser.DeleteQuery) error {
	owner, servers := self.clusterConfiguration.GetReplicas(server, &database)

	request := self.createRequest(proxyDelete, &database)
	queryStr := query.GetQueryStringWithTimeCondition()
	request.Query = &queryStr
	request.OriginatingServerId = &self.clusterConfiguration.localServerId
	request.ClusterVersion = &self.clusterConfiguration.ClusterVersion
	request.OwnerServerId = &owner.Id

	if server.Id == self.clusterConfiguration.localServerId {
		// this is a local delete
		replicationFactor := self.clusterConfiguration.GetReplicationFactor(&database)
		err := self.datastore.LogRequestAndAssignSequenceNumber(request, &replicationFactor, &owner.Id)
		if err != nil {
			return self.proxyUntilSuccess(servers, request)
		}
		self.deleteSeriesDataLocally(user, database, query)
		if err != nil {
			log.Error("Couldn't write data to local store: ", err, request)
		}

		// ignoring the error because we still want to send to replicas
		request.Type = &replicateDelete
		self.sendRequestToReplicas(request, servers)
		return nil
	}

	// otherwise, proxy the delete
	return self.proxyUntilSuccess(servers, request)
}
开发者ID:schmurfy,项目名称:influxdb,代码行数:31,代码来源:coordinator.go


注:本文中的parser.DeleteQuery.GetQueryStringWithTimeCondition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。