A segmentStack is a stack of segments, where higher (later) entries in the stack have higher precedence, and should "shadow" any entries of the same key from lower in the stack. A segmentStack implements the Snapshot interface.
| 18 | // entries of the same key from lower in the stack. A segmentStack |
| 19 | // implements the Snapshot interface. |
| 20 | type segmentStack struct { |
| 21 | options *CollectionOptions |
| 22 | stats *CollectionStats |
| 23 | |
| 24 | a []Segment |
| 25 | |
| 26 | m sync.Mutex // Protects the fields the follow. |
| 27 | |
| 28 | refs int |
| 29 | |
| 30 | lowerLevelSnapshot *SnapshotWrapper |
| 31 | |
| 32 | // incarNum represents this segmentStack's unique incarnation number assigned |
| 33 | // when the child collection was created. 0 for top-level collection. |
| 34 | incarNum uint64 |
| 35 | |
| 36 | // childSegStacks recursively store child collection segmentStacks. |
| 37 | childSegStacks map[string]*segmentStack |
| 38 | } |
| 39 | |
| 40 | func (ss *segmentStack) addRef() { |
| 41 | ss.m.Lock() |
nothing calls this directly
no outgoing calls
no test coverage detected