Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: filter/dsQueryBatch/context.go

Issue 1846123002: Fix missing/broken ds.Stop handling in raw DS. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
iannucci 2016/04/01 02:45:42 er... rebase?
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package dsQueryBatch
6
7 import (
8 ds "github.com/luci/gae/service/datastore"
9 "golang.org/x/net/context"
10 )
11
12 // BatchQueries installs a datastore filter that causes all queries to be broken
13 // into a series of iterative fixed-size queries. The batching uses cursors to
14 // chain the iterations together.
15 //
16 // This helps accommodate query size or time limits enforced by the backing
17 // datastore implementation.
18 //
19 // Note that this expands a single query into a series of queries, which may
20 // lose additional single-query consistency guarantees.
21 func BatchQueries(c context.Context, batchSize int32) context.Context {
22 return ds.AddRawFilters(c, func(ic context.Context, ri ds.RawInterface) ds.RawInterface {
23 return &iterQueryFilter{
24 RawInterface: ri,
25 batchSize: batchSize,
26 }
27 })
28 }
OLDNEW
« filter/count/count.go ('K') | « filter/count/rds.go ('k') | filter/dsQueryBatch/filter.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698