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

Side by Side Diff: filter/txnBuf/query_merger.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/dscache/dscache_test.go ('k') | filter/txnBuf/state.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 "sort" 9 "sort"
10 10
11 "github.com/luci/gae/impl/memory" 11 "github.com/luci/gae/impl/memory"
12 ds "github.com/luci/gae/service/datastore" 12 ds "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/luci-go/common/stringset" 14 » "github.com/luci/luci-go/common/data/stringset"
15 ) 15 )
16 16
17 // queryToIter takes a FinalizedQuery and returns an iterator function which 17 // queryToIter takes a FinalizedQuery and returns an iterator function which
18 // will produce either *items or errors. 18 // will produce either *items or errors.
19 // 19 //
20 // - d is the raw datastore to run this query on 20 // - d is the raw datastore to run this query on
21 // - filter is a function which will return true if the given key should be 21 // - filter is a function which will return true if the given key should be
22 // excluded from the result set. 22 // excluded from the result set.
23 func queryToIter(stopChan chan struct{}, fq *ds.FinalizedQuery, d ds.RawInterfac e) func() (*item, error) { 23 func queryToIter(stopChan chan struct{}, fq *ds.FinalizedQuery, d ds.RawInterfac e) func() (*item, error) {
24 c := make(chan *item) 24 c := make(chan *item)
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 } 289 }
290 if !foundOne { 290 if !foundOne {
291 return nil, nil 291 return nil, nil
292 } 292 }
293 } 293 }
294 if end != nil && bytes.Compare(soFar, end) >= 0 { 294 if end != nil && bytes.Compare(soFar, end) >= 0 {
295 return nil, nil 295 return nil, nil
296 } 296 }
297 return soFar, ps["__key__"][0] 297 return soFar, ps["__key__"][0]
298 } 298 }
OLDNEW
« no previous file with comments | « filter/dscache/dscache_test.go ('k') | filter/txnBuf/state.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698