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

Issue 6553051: state: drop kill and Die method names

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+125761
Visibility:
Public.

Description

state: drop kill and Die method names s/Kill/EnsureDying/ s/Die/EnsureDead/ The above methods are now implemented in terms of ensureDying and ensureDead funcs; ensureDead allows you to pass a list of additional txn.Ops that can block entity death by including Asserts. https://code.launchpad.net/~fwereade/juju-core/rename-kill-die/+merge/125761 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 28

Patch Set 2 : state: drop kill and Die method names #

Total comments: 1

Patch Set 3 : state: drop kill and Die method names #

Patch Set 4 : state: drop kill and Die method names #

Unified diffs Side-by-side diffs Delta from patch set Stats (+225 lines, -154 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 3 1 chunk +1 line, -1 line 0 comments Download
M state/assign_test.go View 1 2 3 11 chunks +18 lines, -17 lines 0 comments Download
M state/life.go View 1 2 3 2 chunks +37 lines, -22 lines 0 comments Download
M state/life_test.go View 4 chunks +7 lines, -8 lines 0 comments Download
M state/machine.go View 2 chunks +6 lines, -5 lines 0 comments Download
M state/machine_test.go View 1 2 3 7 chunks +19 lines, -19 lines 0 comments Download
M state/relation.go View 1 2 3 2 chunks +6 lines, -6 lines 0 comments Download
M state/relation_test.go View 3 chunks +4 lines, -2 lines 0 comments Download
M state/service.go View 1 2 3 7 chunks +27 lines, -10 lines 0 comments Download
M state/service_test.go View 1 2 3 17 chunks +69 lines, -35 lines 0 comments Download
M state/state.go View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M state/state_test.go View 1 2 3 13 chunks +15 lines, -15 lines 0 comments Download
M state/tools_test.go View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M state/unit.go View 1 2 3 2 chunks +6 lines, -6 lines 0 comments Download
M state/unit_test.go View 1 2 3 4 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 9
fwereade
Please take a look.
11 years, 7 months ago (2012-09-21 16:26:50 UTC) #1
aram
LGTM https://codereview.appspot.com/6553051/diff/1/state/service.go File state/service.go (right): https://codereview.appspot.com/6553051/diff/1/state/service.go#newcode201 state/service.go:201: s.doc.UnitCount += 1 Refresh perhaps?
11 years, 7 months ago (2012-09-21 16:34:38 UTC) #2
aram
https://codereview.appspot.com/6553051/diff/1/state/service.go File state/service.go (right): https://codereview.appspot.com/6553051/diff/1/state/service.go#newcode201 state/service.go:201: s.doc.UnitCount += 1 On 2012/09/21 16:34:38, aram wrote: > ...
11 years, 7 months ago (2012-09-21 16:37:28 UTC) #3
fwereade
Please take a look.
11 years, 7 months ago (2012-09-21 16:41:42 UTC) #4
TheMue
LGTM. https://codereview.appspot.com/6553051/diff/5001/state/tools_test.go File state/tools_test.go (right): https://codereview.appspot.com/6553051/diff/5001/state/tools_test.go#newcode15 state/tools_test.go:15: Life() state.Life Thought the lifer interface could be ...
11 years, 7 months ago (2012-09-21 16:47:32 UTC) #5
niemeyer
https://codereview.appspot.com/6553051/diff/1/state/assign_test.go File state/assign_test.go (left): https://codereview.appspot.com/6553051/diff/1/state/assign_test.go#oldcode347 state/assign_test.go:347: func (s *AssignSuite) TestAssignUnitToUnusedMachineWithRemovedService(c *C) { Why is this ...
11 years, 7 months ago (2012-09-21 16:57:37 UTC) #6
fwereade
Please take a look. https://codereview.appspot.com/6553051/diff/1/state/assign_test.go File state/assign_test.go (left): https://codereview.appspot.com/6553051/diff/1/state/assign_test.go#oldcode347 state/assign_test.go:347: func (s *AssignSuite) TestAssignUnitToUnusedMachineWithRemovedService(c *C) ...
11 years, 7 months ago (2012-09-21 17:43:48 UTC) #7
niemeyer
LGTM
11 years, 7 months ago (2012-09-21 17:57:39 UTC) #8
fwereade
11 years, 7 months ago (2012-09-24 09:33:49 UTC) #9
*** Submitted:

state: drop kill and Die method names

s/Kill/EnsureDying/
s/Die/EnsureDead/

The above methods are now implemented in terms of ensureDying and ensureDead
funcs; ensureDead allows you to pass a list of additional txn.Ops that can
block entity death by including Asserts.

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

https://codereview.appspot.com/6553051/diff/1/state/life.go
File state/life.go (right):

https://codereview.appspot.com/6553051/diff/1/state/life.go#newcode53
state/life.go:53: return fmt.Errorf("cannot set life to Dying for %s %q: %v",
desc, id, err)
On 2012/09/21 16:57:37, niemeyer wrote:
> I suggest we use a slightly more user-oriented message here:
> 
> "cannot start termination of %s %#v: %v"
> 
> (please note the %#v there.. %q is wrong for machine)

Done.

https://codereview.appspot.com/6553051/diff/1/state/life.go#newcode62
state/life.go:62: defer trivial.ErrorContextf(&err, "cannot set life to Dead for
%s %q", desc, id)
On 2012/09/21 16:57:37, niemeyer wrote:
> "cannot finish termination of %s %#v"

Done.

https://codereview.appspot.com/6553051/diff/1/state/life.go#newcode73
state/life.go:73: var doc struct{ Life Life }
On 2012/09/21 16:57:37, niemeyer wrote:
> Just one Life is enough. (!)

Done.

https://codereview.appspot.com/6553051/diff/1/state/service.go
File state/service.go (right):

https://codereview.appspot.com/6553051/diff/1/state/service.go#newcode27
state/service.go:27: UnitCount  int
Reinstated per live discussion.
Sign in to reply to this message.

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