Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MappedNode & generalise render logic #233

Merged
merged 2 commits into from
Jun 16, 2015

Conversation

tomwilkie
Copy link
Contributor

Towards #228

@tomwilkie tomwilkie force-pushed the 228-rm-mapped-node branch 3 times, most recently from f052ddd to 2ce7065 Compare June 15, 2015 16:21
@tomwilkie tomwilkie force-pushed the 228-rm-mapped-node branch from 2ce7065 to 23bdae3 Compare June 15, 2015 16:26
@peterbourgon
Copy link
Contributor

Could you write a few sentences for context? At a minimum, the problem that motivates this PR, and a high-level description of the implementation?

@tomwilkie tomwilkie force-pushed the 228-rm-mapped-node branch from 23bdae3 to 0899c89 Compare June 16, 2015 08:41
@tomwilkie
Copy link
Contributor Author

This is a refactoring on the path to synthesising the containers topology from endpoints topology via the process topology. To do this we need the renderers to be able to recurse - effectively what I'm aiming for is:

render.Reduce{
    render.LeafMap{Selector: report.SelectContainer, Mapper: report.MapContainerIdentity, Pseudo: report.InternetOnlyPseudoNode},
    render.Map{
        Mapper: report.MapProcess2Container,
        Renderer: render.Reduce{
            render.LeafMap{Selector: report.SelectProcess, Mapper: report.MapProcessIdentity, Pseudo: report.InternetOnlyPseudoNode},
            render.Map{
                Mapper: report.MapEndpoint2Process,
                Renderer: render.LeafMap{Selector: report.SelectEndpoint, Mapper: report.MapEndpointIdentity, Pseudo: report.InternetOnlyPseudoNode},
            }
        }
    }
}

This isn't all the way there yet, just a step in that direction (getting the Renderer interface right I think).

I removed MappedNode as its redundant, with the introduction of DetailedNode.Merge. It has the nice side effect of propagating Origin nodes correctly for nodes without any adjacency info.

// Renderer is something that can render a report to a set of RenderableNodes
type Renderer interface {
Render(report.Report) report.RenderableNodes
EdgeMetadata(rpt report.Report, localID, remoteID string) report.AggregateMetadata

This comment was marked as abuse.

@peterbourgon
Copy link
Contributor

This feels really refreshing. Whenever we can eliminate a needless intermediate form, wonderful. Thanks! Those comments addressed, LGTM.

@tomwilkie tomwilkie force-pushed the 228-rm-mapped-node branch from 0899c89 to 1e92e7d Compare June 16, 2015 10:54
tomwilkie added a commit that referenced this pull request Jun 16, 2015
Remove MappedNode & generalise render logic
@tomwilkie tomwilkie merged commit 4445182 into weaveworks:master Jun 16, 2015
@tomwilkie tomwilkie deleted the 228-rm-mapped-node branch June 16, 2015 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants