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

Issue 5782053: Implement agent interface and helper. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by TheMue
Modified:
12 years, 1 month ago
Reviewers:
mp+96609
Visibility:
Public.

Description

Implement agent interface and helper. First draft of how to let state entities with a common agent interface implement this with a helper type. The Python implementation uses a mixin, which is not supported by Go. This draft uses the helper to let an entity easily implement the agent interface. Type embedding as an alternative solution would hamper the dynamic access to the ZooKeeper agent path. https://code.launchpad.net/~themue/juju/go-state-first-agent-draft/+merge/96609 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 22

Patch Set 2 : Implement agent interface and helper. #

Total comments: 1

Patch Set 3 : Implement agent interface and helper. #

Total comments: 12

Patch Set 4 : Implement agent interface and helper. #

Total comments: 2

Patch Set 5 : Implement agent interface and helper. #

Total comments: 18

Patch Set 6 : Implement agent interface and helper. #

Total comments: 6

Patch Set 7 : Implement agent interface and helper. #

Total comments: 7

Patch Set 8 : Implement agent interface and helper. #

Patch Set 9 : Implement agent interface and helper. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+238 lines, -80 lines) Patch
A [revision details] View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M state/internal_test.go View 1 2 3 4 5 6 37 chunks +43 lines, -43 lines 0 comments Download
M state/machine.go View 1 2 3 4 5 6 7 2 chunks +23 lines, -0 lines 0 comments Download
M state/state_test.go View 1 2 3 4 5 6 7 35 chunks +140 lines, -37 lines 0 comments Download
M state/unit.go View 1 2 3 4 5 6 7 3 chunks +30 lines, -0 lines 0 comments Download

Messages

Total messages: 26
TheMue
Please take a look.
12 years, 1 month ago (2012-03-08 16:08:55 UTC) #1
rog
as discussed on IRC, this particular watcher may not be the best place to start, ...
12 years, 1 month ago (2012-03-08 17:12:48 UTC) #2
fwereade
https://codereview.appspot.com/5782053/diff/1/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/1/state/agent.go#newcode22 state/agent.go:22: type AgentWatcher struct { I'm not sure we need ...
12 years, 1 month ago (2012-03-09 12:01:15 UTC) #3
niemeyer
I've marked the merge proposal as Work In Progress. I believe lbox isn't actually moving ...
12 years, 1 month ago (2012-03-13 21:12:41 UTC) #4
TheMue
Please take a look.
12 years, 1 month ago (2012-03-15 16:59:01 UTC) #5
TheMue
PTAL https://codereview.appspot.com/5782053/diff/1/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/1/state/agent.go#newcode17 state/agent.go:17: Err error On 2012/03/08 17:12:49, rog wrote: > ...
12 years, 1 month ago (2012-03-15 16:59:18 UTC) #6
rog
https://codereview.appspot.com/5782053/diff/7001/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/7001/state/agent.go#newcode19 state/agent.go:19: type AgentMixin interface { i confess i'm not familiar ...
12 years, 1 month ago (2012-03-15 17:28:27 UTC) #7
TheMue
Please take a look.
12 years, 1 month ago (2012-03-16 07:36:22 UTC) #8
TheMue
On 2012/03/15 17:28:27, rog wrote: > https://codereview.appspot.com/5782053/diff/7001/state/agent.go > File state/agent.go (right): > > https://codereview.appspot.com/5782053/diff/7001/state/agent.go#newcode19 > ...
12 years, 1 month ago (2012-03-16 07:44:09 UTC) #9
fwereade
LGTM: most of my quibbles are entirely speculative, and the only thing I'm 99% sure ...
12 years, 1 month ago (2012-03-16 08:04:46 UTC) #10
TheMue
Please take a look. https://codereview.appspot.com/5782053/diff/12001/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/12001/state/agent.go#newcode13 state/agent.go:13: agentPingerPeriod = 25 * time.Millisecond ...
12 years, 1 month ago (2012-03-16 10:34:58 UTC) #11
TheMue
PTAL
12 years, 1 month ago (2012-03-16 10:36:29 UTC) #12
rog
LGTM although i think the agent type should be exported, which will simplify the testing ...
12 years, 1 month ago (2012-03-16 11:10:56 UTC) #13
fwereade
https://codereview.appspot.com/5782053/diff/15001/state/export_test.go File state/export_test.go (right): https://codereview.appspot.com/5782053/diff/15001/state/export_test.go#newcode52 state/export_test.go:52: // AgentEntity is a helper representing any state entity ...
12 years, 1 month ago (2012-03-16 11:51:26 UTC) #14
TheMue
Please take a look.
12 years, 1 month ago (2012-03-16 15:49:45 UTC) #15
rog
On 2012/03/16 15:49:45, TheMue wrote: > Please take a look. LGTM. thanks for bearing with ...
12 years, 1 month ago (2012-03-16 16:10:02 UTC) #16
niemeyer
https://codereview.appspot.com/5782053/diff/12003/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/12003/state/agent.go#newcode23 state/agent.go:23: // Connected returns true if its entity state has ...
12 years, 1 month ago (2012-03-16 18:48:50 UTC) #17
rog
https://codereview.appspot.com/5782053/diff/12003/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/12003/state/agent.go#newcode53 state/agent.go:53: // Connect informs juju that an associated agent is ...
12 years, 1 month ago (2012-03-16 22:01:54 UTC) #18
TheMue
Some comments. https://codereview.appspot.com/5782053/diff/12003/state/agent.go File state/agent.go (right): https://codereview.appspot.com/5782053/diff/12003/state/agent.go#newcode23 state/agent.go:23: // Connected returns true if its entity ...
12 years, 1 month ago (2012-03-18 19:55:54 UTC) #19
TheMue
Please take a look.
12 years, 1 month ago (2012-03-19 18:17:04 UTC) #20
niemeyer
https://codereview.appspot.com/5782053/diff/14005/state/unit.go File state/unit.go (right): https://codereview.appspot.com/5782053/diff/14005/state/unit.go#newcode395 state/unit.go:395: alive, watch, err := presence.AliveW(u.st.zk, u.zkAgentPath()) Isn't that function ...
12 years, 1 month ago (2012-03-19 18:32:06 UTC) #21
TheMue
Please take a look.
12 years, 1 month ago (2012-03-20 16:34:15 UTC) #22
niemeyer
Looking great. Just a few additional details. https://codereview.appspot.com/5782053/diff/15010/state/machine.go File state/machine.go (right): https://codereview.appspot.com/5782053/diff/15010/state/machine.go#newcode35 state/machine.go:35: return fmt.Errorf("wait ...
12 years, 1 month ago (2012-03-20 19:05:21 UTC) #23
TheMue
Please take a look. https://codereview.appspot.com/5782053/diff/15010/state/machine.go File state/machine.go (right): https://codereview.appspot.com/5782053/diff/15010/state/machine.go#newcode35 state/machine.go:35: return fmt.Errorf("wait for machine agent ...
12 years, 1 month ago (2012-03-20 20:29:57 UTC) #24
niemeyer
LGTM, thanks!
12 years, 1 month ago (2012-03-20 20:36:42 UTC) #25
TheMue
12 years, 1 month ago (2012-03-21 07:58:00 UTC) #26
*** Submitted:

Implement agent interface and helper.

First draft of how to let state entities with a common agent interface
implement this with a helper type. The Python implementation
uses a mixin, which is not supported by Go. This draft uses the helper
to let an entity easily implement the agent interface. Type embedding
as an alternative solution would hamper the dynamic access to the
ZooKeeper agent path.

R=rog, fwereade, niemeyer
CC=
https://codereview.appspot.com/5782053
Sign in to reply to this message.

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