Files
dolt/newset/node_store.go
Benjamin Kalman 326a202025 Implement Put for newset, also requiring a moderate refactor.
Previously we had flatSet vs chunkedSet, each implementing the Set
interface, and SetBuilder dealing with this Set interface.

Now we have a chunkedSet interface with setValueChunk and setIndexChunk
implementations, SetBuilder dealing with the chunkedSet interface, and a
Set class which implements Set primitives on top of a chunkedSet.

Of particular note is the introduction of the setChunkStore, an
in-memory cache of setChunks keyed by their refs. This is needed right
now so that we only have a single SetBuilder implementation which chunks
refs, as opposed to 2 SetBuilder implementations, one which chunks refs
and the other chunkedSet instances. Something like it will be needed in
the longer term to implement lazily loading set chunks, however there
will be issues like memory pressure to deal with as well.

Follow-ups to this patch include renaming files to reflect their class
names better, and doing a bit of function/member renaming to better
reflect semantics. I've tried to keep the diff as small as possible.
2015-10-28 17:42:15 -07:00

13 lines
235 B
Go

package newset
import "github.com/attic-labs/noms/ref"
// nodeStore is an in-memory mapping from ref to node.
type nodeStore struct {
d map[ref.Ref]node
}
func newNodeStore() nodeStore {
return nodeStore{make(map[ref.Ref]node)}
}