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

Unified Diff: service/datastore/checkfilter.go

Issue 2007123002: datastore: Update AllocateIDs to take keys. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Rebase, comments. Created 4 years, 6 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 | « impl/prod/raw_datastore.go ('k') | service/datastore/checkfilter_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/datastore/checkfilter.go
diff --git a/service/datastore/checkfilter.go b/service/datastore/checkfilter.go
index cd0c970ba2f8c74c696ef8392b0542fc3098513d..478fd925b1bfbed630b1b207d7747b5637fd59de 100644
--- a/service/datastore/checkfilter.go
+++ b/service/datastore/checkfilter.go
@@ -19,16 +19,6 @@ type checkFilter struct {
ns string
}
-func (tcf *checkFilter) AllocateIDs(incomplete *Key, n int) (start int64, err error) {
- if n <= 0 {
- return 0, fmt.Errorf("datastore: invalid `n` parameter in AllocateIDs: %d", n)
- }
- if !incomplete.PartialValid(tcf.aid, tcf.ns) {
- return 0, ErrInvalidKey
- }
- return tcf.RawInterface.AllocateIDs(incomplete, n)
-}
-
func (tcf *checkFilter) RunInTransaction(f func(c context.Context) error, opts *TransactionOptions) error {
if f == nil {
return fmt.Errorf("datastore: RunInTransaction function is nil")
@@ -55,7 +45,7 @@ func (tcf *checkFilter) GetMulti(keys []*Key, meta MultiMetaGetter, cb GetMultiC
}
lme := errors.NewLazyMultiError(len(keys))
for i, k := range keys {
- if k.Incomplete() || !k.Valid(true, tcf.aid, tcf.ns) {
+ if k.IsIncomplete() || !k.Valid(true, tcf.aid, tcf.ns) {
lme.Assign(i, ErrInvalidKey)
}
}
@@ -68,7 +58,7 @@ func (tcf *checkFilter) GetMulti(keys []*Key, meta MultiMetaGetter, cb GetMultiC
return tcf.RawInterface.GetMulti(keys, meta, cb)
}
-func (tcf *checkFilter) PutMulti(keys []*Key, vals []PropertyMap, cb PutMultiCB) error {
+func (tcf *checkFilter) PutMulti(keys []*Key, vals []PropertyMap, cb NewKeyCB) error {
if len(keys) != len(vals) {
return fmt.Errorf("datastore: PutMulti with mismatched keys/vals lengths (%d/%d)", len(keys), len(vals))
}
@@ -108,7 +98,7 @@ func (tcf *checkFilter) DeleteMulti(keys []*Key, cb DeleteMultiCB) error {
}
lme := errors.NewLazyMultiError(len(keys))
for i, k := range keys {
- if k.Incomplete() || !k.Valid(false, tcf.aid, tcf.ns) {
+ if k.IsIncomplete() || !k.Valid(false, tcf.aid, tcf.ns) {
lme.Assign(i, ErrInvalidKey)
}
}
« no previous file with comments | « impl/prod/raw_datastore.go ('k') | service/datastore/checkfilter_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698