Add 'latest' CRDT; use it to store container state.

Also use same technique to merge the controls, returning the latest
set of controls instead of the union.
This commit is contained in:
Tom Wilkie
2015-11-05 18:00:15 +00:00
parent f7c75f9cd3
commit 43d0ce986f
23 changed files with 867 additions and 43 deletions

View File

@@ -134,10 +134,12 @@ func (rn RenderableNode) Copy() RenderableNode {
// Specifically, that means cutting out parts of the Node.
func (rn RenderableNode) Prune() RenderableNode {
cp := rn.Copy()
cp.Node.Metadata = report.Metadata{} // snip
cp.Node.Counters = report.Counters{} // snip
cp.Node.Edges = report.EdgeMetadatas{} // snip
cp.Node.Sets = report.Sets{} // snip
cp.Node.Metadata = report.Metadata{} // snip
cp.Node.Counters = report.Counters{} // snip
cp.Node.Edges = report.EdgeMetadatas{} // snip
cp.Node.Sets = report.Sets{} // snip
cp.Node.Controls = report.NodeControls{} // snip
cp.Node.Latest = report.LatestMap{} // snip
return cp
}