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

Issue 6499071: state: unit: AssignedMachine returns a machine

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by dave
Modified:
11 years, 8 months ago
Reviewers:
mp+122617, niemeyer, rog
Visibility:
Public.

Description

state: unit: AssignedMachine returns a machine This proposal alters AssignedMachine (and it's signature) to return a *state.Machine rather than an id. All the non test consumers of this method are actually after a *Machine, not the id anyway, so this saves them the call to state.Machine(). The test code was altered for the new signature but is operation is unaffected. https://code.launchpad.net/~dave-cheney/juju-core/089-state-unit-assigned-machine/+merge/122617 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -42 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/juju/status.go View 1 chunk +2 lines, -2 lines 1 comment Download
M cmd/jujud/provisioning_test.go View 1 chunk +1 line, -3 lines 0 comments Download
M juju/deploy_test.go View 1 chunk +5 lines, -5 lines 0 comments Download
M state/assign_test.go View 8 chunks +18 lines, -18 lines 0 comments Download
M state/service_test.go View 1 chunk +2 lines, -2 lines 0 comments Download
M state/unit.go View 1 chunk +6 lines, -6 lines 0 comments Download
M worker/firewaller/firewaller.go View 1 chunk +3 lines, -3 lines 1 comment Download
M worker/firewaller/firewaller_test.go View 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 4
dave_cheney.net
Please take a look.
11 years, 8 months ago (2012-09-04 06:32:11 UTC) #1
niemeyer
The CL change doesn't seem to reflect the CL description. https://codereview.appspot.com/6499071/diff/1/cmd/juju/status.go File cmd/juju/status.go (right): https://codereview.appspot.com/6499071/diff/1/cmd/juju/status.go#newcode212 ...
11 years, 8 months ago (2012-09-04 20:53:33 UTC) #2
rog
I'm +1 on this CL. It's easy to get a machine id from a Machine, ...
11 years, 8 months ago (2012-09-06 12:04:41 UTC) #3
niemeyer
11 years, 8 months ago (2012-09-06 12:55:09 UTC) #4
On 2012/09/06 12:04:41, rog wrote:
> I'm +1 on this CL. It's easy to get a machine id from a Machine, but getting a
> Machine from an id requires an additional round trip.

Thus we should *always* be paying for the additional roundtrip to the database,
even when the two only non-test locations involved don't actually want anything
but the machine id? I don't understand.

This seems like a totally straightforward decision, btw. It concerns me a bit
that we're even discussing it. I'll soon be stepping down as core reviewer and
will not be overseeing all such changes anymore.
Sign in to reply to this message.

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