Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1311)

Issue 6533052: state: introduce relation Scope concept

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by fwereade
Modified:
11 years, 7 months ago
Reviewers:
mp+125211
Visibility:
Public.

Description

state: introduce relation Scope concept RelationScopeWatcher will be used by RelationUnitsWatcher to determine what presence keys should be watched for join/depart (and what settings keys should then be watched when joined). https://code.launchpad.net/~fwereade/juju-core/mstate-watch-relation-scope/+merge/125211 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 22

Patch Set 2 : add RelationScopeWatcher et al #

Patch Set 3 : add RelationScopeWatcher et al #

Total comments: 10

Patch Set 4 : state: introduce relation Scope concept #

Unified diffs Side-by-side diffs Delta from patch set Stats (+467 lines, -67 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujuc/server/context_test.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujuc/server/util_test.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/open.go View 1 2 3 2 chunks +12 lines, -11 lines 0 comments Download
M state/relation.go View 1 2 3 4 chunks +61 lines, -1 line 0 comments Download
M state/relation_test.go View 1 2 3 5 chunks +234 lines, -7 lines 0 comments Download
M state/state.go View 1 2 3 1 chunk +13 lines, -12 lines 0 comments Download
M state/watcher.go View 1 2 8 chunks +138 lines, -29 lines 0 comments Download
M worker/uniter/relationer.go View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M worker/uniter/relationer_test.go View 1 2 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 11
fwereade
Please take a look.
11 years, 7 months ago (2012-09-19 13:51:37 UTC) #1
aram
LGTM
11 years, 7 months ago (2012-09-19 14:25:34 UTC) #2
fwereade
https://codereview.appspot.com/6533052/diff/1/mstate/watcher.go File mstate/watcher.go (right): https://codereview.appspot.com/6533052/diff/1/mstate/watcher.go#newcode610 mstate/watcher.go:610: log.Printf("tick %#v", c) whoops, sorry https://codereview.appspot.com/6533052/diff/1/mstate/watcher.go#newcode624 mstate/watcher.go:624: log.Printf("tock %#v", ...
11 years, 7 months ago (2012-09-19 14:29:35 UTC) #3
aram
> mstate/watcher.go:610: log.Printf("tick %#v", c) > whoops, sorry Strange, I thought that was a feature.
11 years, 7 months ago (2012-09-19 14:30:34 UTC) #4
niemeyer
Looks surprisingly straightforward. https://codereview.appspot.com/6533052/diff/1/mstate/open.go File mstate/open.go (right): https://codereview.appspot.com/6533052/diff/1/mstate/open.go#newcode92 mstate/open.go:92: relationRefs: db.C("relationRefs"), I'd prefer to keep ...
11 years, 7 months ago (2012-09-19 15:43:33 UTC) #5
fwereade
just a couple of comments, GTWing on the rest https://codereview.appspot.com/6533052/diff/1/mstate/relation.go File mstate/relation.go (right): https://codereview.appspot.com/6533052/diff/1/mstate/relation.go#newcode323 mstate/relation.go:323: ...
11 years, 7 months ago (2012-09-19 16:07:16 UTC) #6
niemeyer
One more detail on the Sort. https://codereview.appspot.com/6533052/diff/1/mstate/watcher.go File mstate/watcher.go (right): https://codereview.appspot.com/6533052/diff/1/mstate/watcher.go#newcode82 mstate/watcher.go:82: Added []string On ...
11 years, 7 months ago (2012-09-19 16:22:43 UTC) #7
fwereade
Please take a look. https://codereview.appspot.com/6533052/diff/1/mstate/open.go File mstate/open.go (right): https://codereview.appspot.com/6533052/diff/1/mstate/open.go#newcode92 mstate/open.go:92: relationRefs: db.C("relationRefs"), On 2012/09/19 15:43:33, ...
11 years, 7 months ago (2012-09-19 16:57:05 UTC) #8
fwereade
Please take a look.
11 years, 7 months ago (2012-09-19 17:46:08 UTC) #9
niemeyer
LGTM https://codereview.appspot.com/6533052/diff/8002/state/open.go File state/open.go (right): https://codereview.appspot.com/6533052/diff/8002/state/open.go#newcode87 state/open.go:87: relationScopes: db.C("relation-sccopes"), No dashes please. This would make ...
11 years, 7 months ago (2012-09-20 11:15:22 UTC) #10
fwereade
11 years, 7 months ago (2012-09-20 11:26:22 UTC) #11
*** Submitted:

state: introduce relation Scope concept

RelationScopeWatcher will be used by RelationUnitsWatcher to determine what
presence keys should be watched for join/depart (and what settings keys
should then be watched when joined).

R=aram, niemeyer
CC=
https://codereview.appspot.com/6533052

https://codereview.appspot.com/6533052/diff/8002/state/open.go
File state/open.go (right):

https://codereview.appspot.com/6533052/diff/8002/state/open.go#newcode87
state/open.go:87: relationScopes: db.C("relation-sccopes"),
On 2012/09/20 11:15:22, niemeyer wrote:
> No dashes please. This would make it very inconvenient to use it from the
mongo
> shell.
> 
> Also, s/cc/c/ :-)

Done.

https://codereview.appspot.com/6533052/diff/8002/state/relation.go
File state/relation.go (right):

https://codereview.appspot.com/6533052/diff/8002/state/relation.go#newcode224
state/relation.go:224: // observe changes to its presence and settings.
On 2012/09/20 11:15:22, niemeyer wrote:
> We've created the concept of a scope. It won't help if we use the term just in
> the method name and continue trying to explain things avoiding the concept of
a
> scope.
> 
> // EnterScope ensures that the unit has entered its scope in the relation.
> // A unit is a member of a relation when it has both entered its respective
> // scope and its pinger is signaling presence in the environment.

Done.

https://codereview.appspot.com/6533052/diff/8002/state/relation.go#newcode249
state/relation.go:249: // relation.
On 2012/09/20 11:15:22, niemeyer wrote:
> // LeaveScope ensures that the unit has departed its scope in the relation.

Done.

https://codereview.appspot.com/6533052/diff/8002/state/relation.go#newcode263
state/relation.go:263: // WatchScope returns a watcher which notifies of
counterpart units
On 2012/09/20 11:15:22, niemeyer wrote:
> Beautiful. It all makes sense now.
:D

https://codereview.appspot.com/6533052/diff/8002/state/relation.go#newcode322
state/relation.go:322: // relationScopeDoc represents the potential presence of
a unit in a relation.
On 2012/09/20 11:15:22, niemeyer wrote:
> // relationScopeDoc represents the paticipation of a unit in a relation scope.
> // The relation ...

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b