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

Issue 1355783002: Refactor keys and queries in datastore service and implementation. (Closed)

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

Description

Refactor keys and queries in datastore service and implementation. * datastore.Query and datastore.FinalizedQuery are now first class objects in the service/datastore api. * datastore.Key is similarly a first class object. All luci/gae users will need to interact with `*ds.Key` now. This object gained all the superpowers that previously existed in the dskey subpackage of service/datastore. The new Query objects are inspectable, and adjustable. Additionally, this homogenizes they query generation between different implementations. The normalization which normally occurs on the server-side is now done client-side. This should ensure consistency between 'prod' and 'memory' implementations. Additionally, the new FinalizedQuery object gains a GQL() method which should (hopefully) allow trivial debugging by printing a query. You should be able to copy and paste the generated GQL* into the appengine dashboard and see what your request was querying for. * With the exception of Cursors, which currently have no textual format in the GQL schema. R=dnj@chromium.org, estaab@chromium.org, maruel@chromium.org, tandrii@chromium.org, vadimsh@chromium.org BUG=533024 Committed: https://github.com/luci/gae/commit/f8e86bf226d6985065d19449e21d63398be39a67

Patch Set 1 #

Total comments: 96

Patch Set 2 : fix comments #

Total comments: 1

Patch Set 3 : golint #

Patch Set 4 : appease errcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3542 lines, -2758 lines) Patch
M filter/count/count.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M filter/count/count_test.go View 1 2 3 9 chunks +20 lines, -13 lines 0 comments Download
M filter/count/gi.go View 1 2 3 5 chunks +19 lines, -21 lines 0 comments Download
M filter/count/mc.go View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M filter/count/rds.go View 3 chunks +4 lines, -22 lines 0 comments Download
M filter/dscache/context.go View 1 chunk +1 line, -1 line 0 comments Download
M filter/dscache/ds.go View 1 chunk +3 lines, -3 lines 0 comments Download
M filter/dscache/ds_txn.go View 1 chunk +2 lines, -2 lines 0 comments Download
M filter/dscache/ds_txn_state.go View 1 chunk +1 line, -1 line 0 comments Download
M filter/dscache/dscache.go View 1 2 3 chunks +38 lines, -10 lines 0 comments Download
M filter/dscache/dscache_test.go View 1 chunk +6 lines, -5 lines 0 comments Download
M filter/dscache/globalconfig.go View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
M filter/dscache/plan.go View 3 chunks +3 lines, -3 lines 0 comments Download
M filter/dscache/support.go View 6 chunks +7 lines, -7 lines 0 comments Download
M filter/featureBreaker/rds.go View 1 chunk +23 lines, -12 lines 0 comments Download
M impl/dummy/dummy.go View 2 chunks +6 lines, -11 lines 0 comments Download
M impl/dummy/dummy_test.go View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
M impl/memory/datastore.go View 1 2 3 5 chunks +11 lines, -39 lines 0 comments Download
M impl/memory/datastore_data.go View 1 2 3 14 chunks +26 lines, -32 lines 0 comments Download
M impl/memory/datastore_index.go View 1 2 3 10 chunks +14 lines, -14 lines 0 comments Download
M impl/memory/datastore_index_selection.go View 1 2 19 chunks +26 lines, -26 lines 0 comments Download
M impl/memory/datastore_index_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M impl/memory/datastore_query.go View 1 2 7 chunks +115 lines, -570 lines 0 comments Download
M impl/memory/datastore_query_execution.go View 1 2 10 chunks +23 lines, -24 lines 0 comments Download
M impl/memory/datastore_query_execution_test.go View 1 2 3 15 chunks +73 lines, -67 lines 0 comments Download
M impl/memory/datastore_query_test.go View 1 2 3 4 chunks +77 lines, -313 lines 0 comments Download
M impl/memory/datastore_test.go View 1 2 3 20 chunks +42 lines, -70 lines 0 comments Download
M impl/memory/gkvlite_utils.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M impl/memory/memcache.go View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M impl/memory/memcache_test.go View 1 2 3 3 chunks +7 lines, -6 lines 0 comments Download
M impl/memory/taskqueue_test.go View 1 2 3 9 chunks +21 lines, -18 lines 0 comments Download
M impl/memory/testing_utils_test.go View 1 2 3 6 chunks +38 lines, -44 lines 0 comments Download
M impl/prod/context.go View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M impl/prod/datastore_key.go View 1 2 chunks +42 lines, -31 lines 0 comments Download
M impl/prod/doc.go View 1 1 chunk +6 lines, -0 lines 0 comments Download
M impl/prod/memcache.go View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M impl/prod/raw_datastore.go View 1 6 chunks +110 lines, -68 lines 0 comments Download
M impl/prod/raw_datastore_type_converter.go View 4 chunks +62 lines, -45 lines 0 comments Download
M impl/prod/raw_datastore_type_converter_test.go View 5 chunks +6 lines, -6 lines 0 comments Download
M service/datastore/checkfilter.go View 3 chunks +6 lines, -6 lines 0 comments Download
M service/datastore/checkfilter_test.go View 1 2 3 3 chunks +24 lines, -24 lines 0 comments Download
M service/datastore/context.go View 2 chunks +7 lines, -1 line 0 comments Download
M service/datastore/context_test.go View 2 chunks +11 lines, -4 lines 0 comments Download
M service/datastore/datastore.go View 10 chunks +64 lines, -24 lines 0 comments Download
M service/datastore/datastore_test.go View 1 2 3 28 chunks +79 lines, -116 lines 0 comments Download
D service/datastore/dskey/doc.go View 1 chunk +0 lines, -8 lines 0 comments Download
D service/datastore/dskey/generic_key.go View 1 chunk +0 lines, -122 lines 0 comments Download
D service/datastore/dskey/key.go View 1 chunk +0 lines, -244 lines 0 comments Download
D service/datastore/dskey/key_test.go View 1 chunk +0 lines, -257 lines 0 comments Download
A service/datastore/finalized_query.go View 1 2 3 1 chunk +337 lines, -0 lines 0 comments Download
M service/datastore/index.go View 1 2 3 9 chunks +105 lines, -46 lines 0 comments Download
M service/datastore/index_test.go View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M service/datastore/interface.go View 6 chunks +33 lines, -24 lines 0 comments Download
A service/datastore/key.go View 1 2 3 1 chunk +403 lines, -0 lines 0 comments Download
A service/datastore/key_test.go View 1 1 chunk +232 lines, -0 lines 0 comments Download
M service/datastore/multiarg.go View 1 2 3 12 chunks +31 lines, -30 lines 0 comments Download
M service/datastore/pls_impl.go View 3 chunks +5 lines, -10 lines 0 comments Download
M service/datastore/pls_test.go View 1 2 3 7 chunks +16 lines, -128 lines 0 comments Download
M service/datastore/properties.go View 1 2 3 10 chunks +193 lines, -36 lines 0 comments Download
M service/datastore/properties_test.go View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download
A service/datastore/query.go View 1 2 3 1 chunk +709 lines, -0 lines 0 comments Download
A service/datastore/query_test.go View 1 chunk +291 lines, -0 lines 0 comments Download
M service/datastore/raw_interface.go View 1 2 9 chunks +7 lines, -63 lines 0 comments Download
M service/datastore/raw_interface_test.go View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M service/datastore/reflect.go View 1 chunk +1 line, -1 line 0 comments Download
M service/datastore/serialize/serialize.go View 1 2 8 chunks +8 lines, -14 lines 0 comments Download
M service/datastore/serialize/serialize_test.go View 1 2 3 12 chunks +105 lines, -93 lines 0 comments Download
M service/datastore/testable.go View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M service/taskqueue/errors.go View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M service/taskqueue/taskqueue.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M service/taskqueue/types.go View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 17 (5 generated)
iannucci
5 years, 3 months ago (2015-09-18 04:00:29 UTC) #1
iannucci
On 2015/09/18 04:00:29, iannucci wrote: Tests are currently all passing. I'm going to add some ...
5 years, 3 months ago (2015-09-18 04:02:27 UTC) #2
iannucci
some notes https://chromiumcodereview.appspot.com/1355783002/diff/1/filter/count/rds.go File filter/count/rds.go (left): https://chromiumcodereview.appspot.com/1355783002/diff/1/filter/count/rds.go#oldcode18 filter/count/rds.go:18: NewQuery Entry these aren't part of RawInterface ...
5 years, 3 months ago (2015-09-18 04:31:53 UTC) #3
dnj
https://chromiumcodereview.appspot.com/1355783002/diff/1/impl/memory/datastore_query.go File impl/memory/datastore_query.go (right): https://chromiumcodereview.appspot.com/1355783002/diff/1/impl/memory/datastore_query.go#newcode136 impl/memory/datastore_query.go:136: _, startOp, startV := fq.IneqFilterLow() Maybe comment that the ...
5 years, 3 months ago (2015-09-18 16:47:59 UTC) #4
iannucci
PTAL https://chromiumcodereview.appspot.com/1355783002/diff/1/impl/memory/datastore_query.go File impl/memory/datastore_query.go (right): https://chromiumcodereview.appspot.com/1355783002/diff/1/impl/memory/datastore_query.go#newcode136 impl/memory/datastore_query.go:136: _, startOp, startV := fq.IneqFilterLow() On 2015/09/18 at ...
5 years, 3 months ago (2015-09-18 22:25:49 UTC) #5
dnj
lgtm % comments https://chromiumcodereview.appspot.com/1355783002/diff/1/service/datastore/finalized_query.go File service/datastore/finalized_query.go (right): https://chromiumcodereview.appspot.com/1355783002/diff/1/service/datastore/finalized_query.go#newcode55 service/datastore/finalized_query.go:55: ret := make([]string, len(q.project)) On 2015/09/18 ...
5 years, 3 months ago (2015-09-18 22:45:13 UTC) #6
iannucci
On 2015/09/18 at 22:45:13, dnj wrote: > lgtm % comments > > https://chromiumcodereview.appspot.com/1355783002/diff/1/service/datastore/finalized_query.go > File ...
5 years, 3 months ago (2015-09-19 02:06:15 UTC) #7
iannucci
On 2015/09/19 at 02:06:15, iannucci wrote: > On 2015/09/18 at 22:45:13, dnj wrote: > > ...
5 years, 3 months ago (2015-09-19 02:08:06 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1355783002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1355783002/40001
5 years, 3 months ago (2015-09-19 02:10:00 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: Luci-GAE Linux Trusty 64 Tester on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Luci-GAE%20Linux%20Trusty%2064%20Tester/builds/14) ...
5 years, 3 months ago (2015-09-19 02:12:47 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1355783002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1355783002/60001
5 years, 3 months ago (2015-09-19 05:10:21 UTC) #16
commit-bot: I haz the power
5 years, 3 months ago (2015-09-19 05:11:58 UTC) #17
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://github.com/luci/gae/commit/f8e86bf226d6985065d19449e21d63398be39a67

Powered by Google App Engine
This is Rietveld 408576698