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

Side by Side Diff: filter/txnBuf/state.go

Issue 2192003003: GAE CL for luci-go common refactor (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « filter/txnBuf/query_merger.go ('k') | filter/txnBuf/txnbuf_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package txnBuf 5 package txnBuf
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "sync" 9 "sync"
10 10
11 "github.com/luci/gae/impl/memory" 11 "github.com/luci/gae/impl/memory"
12 "github.com/luci/gae/service/datastore" 12 "github.com/luci/gae/service/datastore"
13 "github.com/luci/gae/service/datastore/serialize" 13 "github.com/luci/gae/service/datastore/serialize"
14 "github.com/luci/gae/service/info" 14 "github.com/luci/gae/service/info"
15 "github.com/luci/luci-go/common/data/stringset"
15 "github.com/luci/luci-go/common/errors" 16 "github.com/luci/luci-go/common/errors"
16 » "github.com/luci/luci-go/common/parallel" 17 » "github.com/luci/luci-go/common/sync/parallel"
17 » "github.com/luci/luci-go/common/stringset"
18 "golang.org/x/net/context" 18 "golang.org/x/net/context"
19 ) 19 )
20 20
21 // DefaultSizeBudget is the size budget for the root transaction. 21 // DefaultSizeBudget is the size budget for the root transaction.
22 // 22 //
23 // Because our estimation algorithm isn't entirely correct, we take 5% off 23 // Because our estimation algorithm isn't entirely correct, we take 5% off
24 // the limit for encoding and estimate inaccuracies. 24 // the limit for encoding and estimate inaccuracies.
25 // 25 //
26 // 10MB taken on 2015/09/24: 26 // 10MB taken on 2015/09/24:
27 // https://cloud.google.com/appengine/docs/go/datastore/#Go_Quotas_and_limits 27 // https://cloud.google.com/appengine/docs/go/datastore/#Go_Quotas_and_limits
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // plus a stringset of all the encoded root keys that `keys` represents. 564 // plus a stringset of all the encoded root keys that `keys` represents.
565 func toEncoded(keys []*datastore.Key) (full []string, roots stringset.Set) { 565 func toEncoded(keys []*datastore.Key) (full []string, roots stringset.Set) {
566 roots = stringset.New(len(keys)) 566 roots = stringset.New(len(keys))
567 full = make([]string, len(keys)) 567 full = make([]string, len(keys))
568 for i, k := range keys { 568 for i, k := range keys {
569 roots.Add(string(serialize.ToBytes(k.Root()))) 569 roots.Add(string(serialize.ToBytes(k.Root())))
570 full[i] = string(serialize.ToBytes(k)) 570 full[i] = string(serialize.ToBytes(k))
571 } 571 }
572 return 572 return
573 } 573 }
OLDNEW
« no previous file with comments | « filter/txnBuf/query_merger.go ('k') | filter/txnBuf/txnbuf_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698