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

Issue 2342063003: Differentiate between single- and multi- props. (Closed)

Created:
4 years, 3 months ago by dnj
Modified:
4 years, 3 months ago
Reviewers:
iannucci
CC:
chromium-reviews, infra-reviews+luci-gae_chromium.org
Target Ref:
refs/heads/master
Project:
luci-gae
Visibility:
Public.

Description

Differentiate between single- and multi- props. Fixes #58. Change PropertyMap to accept either a single Property or a PropertySlice, the former being a single Property and the latter being a multi-property regardless of content size. This will likely break API compatibility for packages that directly use PropertyMap, which shouldn't be too many. Updating is not difficult: If you want to have a single property, you can assign directly instead of wrapping in a []Property: PropertyMap{"Foo": MkProperty("Bar")} If you want to have a multi-valued Property, use a PropertySlice: PropertyMap{"Foo": PropertySlice{ds.MkProperty("Bar")}} Note that datastore now differentiates between single-valued Properties and multi-valued Properties. When dealing with structs, luci/gae doesn't really care when loading, but will export them as multi- if they are backed by a slice. BUG=None TEST=local Committed: https://github.com/luci/gae/commit/c4fab9e7d5a1b17dc32257a21fde91696d6cb217

Patch Set 1 #

Total comments: 10

Patch Set 2 : Comments, cleanup, fix. #

Patch Set 3 : Slice is now always a clone. This is marginally worse performance, but a much safer UI. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+699 lines, -450 lines) Patch
M filter/count/count_test.go View 2 chunks +4 lines, -4 lines 0 comments Download
M filter/dscache/dscache_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M filter/featureBreaker/featurebreaker_test.go View 2 chunks +2 lines, -2 lines 0 comments Download
M filter/txnBuf/query_merger.go View 1 1 chunk +2 lines, -2 lines 0 comments Download
M filter/txnBuf/txnbuf_test.go View 6 chunks +7 lines, -7 lines 0 comments Download
M impl/cloud/datastore.go View 6 chunks +76 lines, -42 lines 0 comments Download
M impl/cloud/datastore_test.go View 3 chunks +27 lines, -13 lines 0 comments Download
M impl/memory/datastore_data.go View 2 chunks +3 lines, -3 lines 0 comments Download
M impl/memory/datastore_index.go View 1 chunk +2 lines, -1 line 0 comments Download
M impl/memory/datastore_index_test.go View 6 chunks +26 lines, -26 lines 0 comments Download
M impl/memory/datastore_query_execution.go View 1 chunk +1 line, -1 line 0 comments Download
M impl/memory/datastore_test.go View 5 chunks +23 lines, -8 lines 0 comments Download
M impl/memory/race_test.go View 2 chunks +4 lines, -4 lines 0 comments Download
M impl/memory/testing_utils_test.go View 1 chunk +41 lines, -14 lines 0 comments Download
M impl/prod/everything_test.go View 8 chunks +52 lines, -39 lines 0 comments Download
M impl/prod/raw_datastore_type_converter.go View 1 chunk +33 lines, -4 lines 0 comments Download
M service/datastore/datastore_test.go View 28 chunks +55 lines, -55 lines 0 comments Download
M service/datastore/dumper/dumper.go View 1 chunk +18 lines, -9 lines 0 comments Download
M service/datastore/dumper/dumper_example_test.go View 1 chunk +6 lines, -6 lines 0 comments Download
M service/datastore/meta/eg_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M service/datastore/multiarg.go View 1 chunk +1 line, -1 line 0 comments Download
M service/datastore/pls_impl.go View 1 2 6 chunks +28 lines, -11 lines 0 comments Download
M service/datastore/pls_test.go View 30 chunks +119 lines, -115 lines 0 comments Download
M service/datastore/properties.go View 1 2 11 chunks +104 lines, -41 lines 0 comments Download
M service/datastore/properties_test.go View 2 chunks +4 lines, -4 lines 0 comments Download
M service/datastore/serialize/serialize.go View 5 chunks +40 lines, -17 lines 0 comments Download
M service/datastore/serialize/serialize_test.go View 3 chunks +15 lines, -15 lines 0 comments Download
M service/datastore/size_test.go View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (6 generated)
dnj
PTAL. I'm going to put some polish on, but it should be good enough for ...
4 years, 3 months ago (2016-09-16 03:51:05 UTC) #2
iannucci
lgtm, though I think we may need to update the in-memory model if 'multiple' affects ...
4 years, 3 months ago (2016-09-16 07:11:04 UTC) #4
dnj
https://chromiumcodereview.appspot.com/2342063003/diff/1/impl/memory/datastore_index_test.go File impl/memory/datastore_index_test.go (right): https://chromiumcodereview.appspot.com/2342063003/diff/1/impl/memory/datastore_index_test.go#newcode41 impl/memory/datastore_index_test.go:41: { On 2016/09/16 07:11:03, iannucci wrote: > question: now ...
4 years, 3 months ago (2016-09-16 19:07:22 UTC) #5
dnj
https://chromiumcodereview.appspot.com/2342063003/diff/1/service/datastore/properties.go File service/datastore/properties.go (right): https://chromiumcodereview.appspot.com/2342063003/diff/1/service/datastore/properties.go#newcode863 service/datastore/properties.go:863: pm[k] = v.Clone() On 2016/09/16 19:07:22, dnj wrote: > ...
4 years, 3 months ago (2016-09-16 19:21:34 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2342063003/40001
4 years, 3 months ago (2016-09-16 21:13:05 UTC) #10
commit-bot: I haz the power
4 years, 3 months ago (2016-09-16 21:18:49 UTC) #12
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://github.com/luci/gae/commit/c4fab9e7d5a1b17dc32257a21fde91696d6cb217

Powered by Google App Engine
This is Rietveld 408576698