本文整理匯總了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)
}