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

Unified Diff: appengine/datastorecache/manager.go

Issue 2617903005: Remove dsQueryBatch in favor of ds.Batcher. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/datastorecache/cache.go ('k') | appengine/tsmon/handler.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/datastorecache/manager.go
diff --git a/appengine/datastorecache/manager.go b/appengine/datastorecache/manager.go
index db6d79c7c642116034c255b9c465792b9ede2b1c..da801bd328659a6d7072901adfd43a90e83e4d2b 100644
--- a/appengine/datastorecache/manager.go
+++ b/appengine/datastorecache/manager.go
@@ -19,7 +19,6 @@ import (
"github.com/luci/luci-go/common/sync/parallel"
"github.com/luci/luci-go/server/router"
- "github.com/luci/gae/filter/dsQueryBatch"
"github.com/luci/gae/service/datastore"
"github.com/luci/gae/service/info"
@@ -27,12 +26,6 @@ import (
"golang.org/x/net/context"
)
-const (
- // managerQueryBatchSize is the query batch size for cache entries that are
- // processed by a manager shard.
- managerQueryBatchSize = 200
-)
-
func errHTTPHandler(fn func(c context.Context, req *http.Request, params httprouter.Params) error) router.Handler {
return func(ctx *router.Context) {
err := fn(ctx.Context, ctx.Request, ctx.Params)
@@ -326,7 +319,11 @@ func (ms *managerShard) runLocked(c context.Context) error {
return nil
}
- err := datastore.Run(dsQueryBatch.BatchQueries(c, int32(ms.queryBatchSize), handleEntries), q, func(e *entry) error {
+ b := datastore.Batcher{
+ Size: ms.queryBatchSize,
+ Callback: handleEntries,
+ }
+ err := b.Run(c, q, func(e *entry) error {
totalEntries++
ms.observeEntry()
entries = append(entries, e)
« no previous file with comments | « appengine/datastorecache/cache.go ('k') | appengine/tsmon/handler.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698