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

Issue 1253263002: Make rawdatastore API safer for writing filters. (Closed)

Created:
5 years, 4 months ago by iannucci
Modified:
5 years, 4 months ago
CC:
chromium-reviews
Base URL:
https://github.com/luci/gae.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Make rawdatastore API safer for writing filters. This removes Get/Put/Delete, since they always end up being implemented as wrappers around the Multi versions anyway, it just caused unnecessary noise. They'll come back with the 'user friendly' datastore interface, but there's no reason to have them at every layer of the cake. It moves the *Multi methods to be callback-based, which makes interacting with them easier (since you don't have to do lots of slice allocations). It introduces 'checkFilter' to rawdatastore which guarantees that filters and backend implementations don't need to do lots of redundant checks to sanitize their inputs. It adds a new API to the Info service to retrieve the current namespace. R=dnj@google.com, estaab@chromium.org, dnj@chromium.org, vadimsh@chromium.org BUG= Committed: https://github.com/luci/gae/commit/5de5392ae282348d6c7f4df74fea36bfccd48e09

Patch Set 1 #

Patch Set 2 : Switch to callback interface #

Patch Set 3 : avoid dummy callbacks #

Total comments: 10

Patch Set 4 : fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+675 lines, -671 lines) Patch
M filter/count/count_test.go View 1 4 chunks +45 lines, -26 lines 0 comments Download
M filter/count/gi.go View 1 2 chunks +6 lines, -0 lines 0 comments Download
M filter/count/rds.go View 1 2 chunks +8 lines, -38 lines 0 comments Download
M filter/featureBreaker/featurebreaker_test.go View 1 3 chunks +26 lines, -14 lines 0 comments Download
M filter/featureBreaker/rds.go View 1 1 chunk +9 lines, -44 lines 0 comments Download
M impl/dummy/dummy.go View 1 2 chunks +10 lines, -17 lines 0 comments Download
M impl/dummy/dummy_test.go View 1 2 chunks +13 lines, -10 lines 0 comments Download
M impl/memory/globalinfo.go View 1 2 chunks +13 lines, -1 line 0 comments Download
M impl/memory/raw_datastore.go View 1 3 chunks +25 lines, -81 lines 0 comments Download
M impl/memory/raw_datastore_data.go View 1 2 5 chunks +68 lines, -168 lines 0 comments Download
M impl/memory/raw_datastore_query.go View 1 3 chunks +8 lines, -22 lines 0 comments Download
M impl/memory/raw_datastore_test.go View 1 17 chunks +148 lines, -115 lines 0 comments Download
M impl/prod/datastore_key.go View 2 chunks +0 lines, -29 lines 0 comments Download
M impl/prod/info.go View 1 3 chunks +14 lines, -1 line 0 comments Download
M impl/prod/raw_datastore.go View 1 2 3 3 chunks +69 lines, -56 lines 0 comments Download
M impl/prod/raw_datastore_type_converter.go View 1 3 chunks +8 lines, -11 lines 0 comments Download
M service/info/interface.go View 1 1 chunk +2 lines, -0 lines 0 comments Download
A service/rawdatastore/checkfilter.go View 1 2 1 chunk +123 lines, -0 lines 0 comments Download
M service/rawdatastore/context.go View 1 1 chunk +1 line, -1 line 0 comments Download
M service/rawdatastore/context_test.go View 1 3 chunks +12 lines, -7 lines 0 comments Download
M service/rawdatastore/datastore_key.go View 1 1 chunk +2 lines, -5 lines 0 comments Download
M service/rawdatastore/datastore_key_test.go View 1 2 chunks +2 lines, -3 lines 0 comments Download
M service/rawdatastore/interface.go View 1 2 2 chunks +63 lines, -22 lines 0 comments Download

Messages

Total messages: 11 (1 generated)
iannucci
5 years, 4 months ago (2015-07-26 23:07:20 UTC) #1
iannucci
On 2015/07/26 23:07:20, iannucci wrote: wait on this one for a bit, have a refactor.
5 years, 4 months ago (2015-07-27 15:21:34 UTC) #2
iannucci
PTAL, this is in decent shape now (though the diff is a bit dumb :/)
5 years, 4 months ago (2015-07-28 05:26:41 UTC) #3
iannucci
On 2015/07/28 05:26:41, iannucci wrote: > PTAL, this is in decent shape now (though the ...
5 years, 4 months ago (2015-07-28 05:27:02 UTC) #4
estaab
lgtm with the caveat that I don't have a strong grasp of this code. https://codereview.chromium.org/1253263002/diff/40001/filter/count/count_test.go ...
5 years, 4 months ago (2015-07-28 21:52:40 UTC) #5
dnj (Google)
(Sorry for the delay, will review later this evening).
5 years, 4 months ago (2015-07-28 23:11:13 UTC) #7
dnj (Google)
LGTM w/ nits. Now that i see the usage more directly, I think it would ...
5 years, 4 months ago (2015-07-29 01:44:59 UTC) #8
iannucci
On 2015/07/29 01:44:59, dnj (Google) wrote: > LGTM w/ nits. > > Now that i ...
5 years, 4 months ago (2015-07-29 07:35:40 UTC) #9
iannucci
https://chromiumcodereview.appspot.com/1253263002/diff/40001/filter/count/count_test.go File filter/count/count_test.go (right): https://chromiumcodereview.appspot.com/1253263002/diff/40001/filter/count/count_test.go#newcode24 filter/count/count_test.go:24: pnil := func(_ rawdatastore.Key, err error) { On 2015/07/28 ...
5 years, 4 months ago (2015-07-29 07:35:48 UTC) #10
iannucci
5 years, 4 months ago (2015-07-29 07:36:21 UTC) #11
Message was sent while issue was closed.
Committed patchset #4 (id:60001) manually as
5de5392ae282348d6c7f4df74fea36bfccd48e09 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698