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

Issue 6501086: made hook.Info.Members optional

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

Description

made hook.Info.Members optional This allows us to skip saving them, which in turn saves us potentially a lot of time when trying to store data about 100k-scale relations. https://code.launchpad.net/~fwereade/juju-core/loose-hook-info-members/+merge/122792 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 11

Patch Set 2 : made hook.Info.Members optional #

Patch Set 3 : made hook.Info.Members optional #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -53 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M worker/uniter/hook/hook.go View 1 3 chunks +11 lines, -22 lines 0 comments Download
M worker/uniter/hook/hook_test.go View 1 chunk +0 lines, -4 lines 0 comments Download
M worker/uniter/relation/hookqueue.go View 1 chunk +0 lines, -7 lines 0 comments Download
M worker/uniter/relation/hookqueue_test.go View 1 chunk +4 lines, -4 lines 0 comments Download
M worker/uniter/relationer.go View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M worker/uniter/relationer_test.go View 4 chunks +32 lines, -15 lines 0 comments Download

Messages

Total messages: 6
fwereade
Please take a look.
11 years, 8 months ago (2012-09-05 05:55:09 UTC) #1
TheMue
LGTM, only one little note. https://codereview.appspot.com/6501086/diff/1/worker/uniter/relationer.go File worker/uniter/relationer.go (right): https://codereview.appspot.com/6501086/diff/1/worker/uniter/relationer.go#newcode115 worker/uniter/relationer.go:115: } Would like a ...
11 years, 8 months ago (2012-09-05 11:47:37 UTC) #2
niemeyer
The change looks nice on itself, although the high-level plan isn't clear if we lose ...
11 years, 8 months ago (2012-09-05 22:07:32 UTC) #3
fwereade
Please take a look. https://codereview.appspot.com/6501086/diff/1/worker/uniter/hook/hook.go File worker/uniter/hook/hook.go (right): https://codereview.appspot.com/6501086/diff/1/worker/uniter/hook/hook.go#newcode68 worker/uniter/hook/hook.go:68: RelationId int `yaml:"relation-id, omitempty"` On ...
11 years, 8 months ago (2012-09-06 07:08:16 UTC) #4
niemeyer
LGTM https://codereview.appspot.com/6501086/diff/1/worker/uniter/hook/hook.go File worker/uniter/hook/hook.go (right): https://codereview.appspot.com/6501086/diff/1/worker/uniter/hook/hook.go#newcode80 worker/uniter/hook/hook.go:80: // if a unit is not present, no ...
11 years, 8 months ago (2012-09-06 13:54:13 UTC) #5
fwereade
11 years, 8 months ago (2012-09-06 16:04:05 UTC) #6
*** Submitted:

made hook.Info.Members optional

This allows us to skip saving them, which in turn saves us potentially a lot
of time when trying to store data about 100k-scale relations.

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

https://codereview.appspot.com/6501086/diff/1/worker/uniter/relationer.go
File worker/uniter/relationer.go (right):

https://codereview.appspot.com/6501086/diff/1/worker/uniter/relationer.go#new...
worker/uniter/relationer.go:115: }
On 2012/09/06 13:54:13, niemeyer wrote:
> On 2012/09/05 11:47:37, TheMue wrote:
> > Would like a 
> > 
> > switch {
> > case hi.Kind == hook.RelationDeparted:
> >     r.ctx.DeleteMember(hi.RemoteUnit)
> > case hi.RemoteUnit != "":
> >     r.ctx.UpdateMembers(map[string]map[string]interface{}{hi.RemoteUnit:
nil})
> > }
> > 
> > more.
> 
> This is nice in many cases, but FWIW this case feels to me like abusing switch
> to build a simple if/else.

Reverted cheerfully.
Sign in to reply to this message.

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