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

Issue 6305082: add unitRelationWatcher/unitRelationChange types

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

Description

add unitRelationWatcher/unitRelationChange types In python, we track settings node version rather than settings node content as we do here. This has been changed because we want to be able to run hooks in the contexts that caused those specific hooks to run -- including settings for all relation members at that point in time; and this consequently frees us from having to worry about what happens when a hook tries to get the settings of a unit relation that *was* joined when the hook was executed but has subsequently been deleted. It's also beneficial in that it only communicates changes when the actual content has changed, rather than every time the node is written. Note that it will still be perectly possible to implement a hook scheduler that collapses multiple queued events from the same unit, as is done in python, so we shouldn't be in danger of needing to store a ridiculous excess of historical events. https://code.launchpad.net/~fwereade/juju-core/unit-relation-watcher/+merge/109617 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 24

Patch Set 2 : add unitRelationWatcher/unitRelationChange types #

Total comments: 18

Patch Set 3 : add unitRelationWatcher/unitRelationChange types #

Patch Set 4 : add unitRelationWatcher/unitRelationChange types #

Unified diffs Side-by-side diffs Delta from patch set Stats (+318 lines, -13 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M state/internal_test.go View 1 2 2 chunks +4 lines, -12 lines 0 comments Download
A state/relation_test.go View 1 2 1 chunk +130 lines, -0 lines 0 comments Download
M state/unit.go View 1 2 1 chunk +1 line, -1 line 0 comments Download
M state/watcher.go View 1 2 2 chunks +181 lines, -0 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
11 years, 10 months ago (2012-06-11 12:17:16 UTC) #1
niemeyer
Good work polishing the problem up onto a nice piece of the puzzle, thanks. Some ...
11 years, 10 months ago (2012-06-11 21:02:50 UTC) #2
fwereade
Please take a look. https://codereview.appspot.com/6305082/diff/1/state/watcher.go File state/watcher.go (right): https://codereview.appspot.com/6305082/diff/1/state/watcher.go#newcode416 state/watcher.go:416: // unitRelationChange describes the state ...
11 years, 10 months ago (2012-06-12 09:18:18 UTC) #3
niemeyer
LGTM, with some additional suggestions: https://codereview.appspot.com/6305082/diff/1/state/watcher.go File state/watcher.go (right): https://codereview.appspot.com/6305082/diff/1/state/watcher.go#newcode483 state/watcher.go:483: return On 2012/06/12 09:18:18, ...
11 years, 10 months ago (2012-06-13 12:16:03 UTC) #4
fwereade
Please take a look. https://codereview.appspot.com/6305082/diff/5001/state/internal_test.go File state/internal_test.go (right): https://codereview.appspot.com/6305082/diff/5001/state/internal_test.go#newcode1105 state/internal_test.go:1105: type RelationUnitWatcherSuite struct { On ...
11 years, 10 months ago (2012-06-14 13:14:39 UTC) #5
fwereade
11 years, 10 months ago (2012-06-14 14:31:05 UTC) #6
*** Submitted:

add unitRelationWatcher/unitRelationChange types

In python, we track settings node version rather than settings node content
as we do here. This has been changed because we want to be able to run hooks
in the contexts that caused those specific hooks to run -- including
settings for all relation members at that point in time; and this
consequently frees us from having to worry about what happens when a hook
tries to get the settings of a unit relation that *was* joined when the
hook was executed but has subsequently been deleted.  It's also beneficial
in that it only communicates changes when the actual content has changed,
rather than every time the node is written.

Note that it will still be perectly possible to implement a hook scheduler
that collapses multiple queued events from the same unit, as is done in
python, so we shouldn't be in danger of needing to store a ridiculous excess
of historical events.

R=niemeyer
CC=
https://codereview.appspot.com/6305082
Sign in to reply to this message.

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