MCPcopy Create free account
hub / github.com/couchbase/moss / ensureSorted

Method ensureSorted

segment_stack.go:146–161  ·  view source on GitHub ↗

------------------------------------------------------

(minSeg, maxSeg int)

Source from the content-addressed store, hash-verified

144// ------------------------------------------------------
145
146func (ss *segmentStack) ensureSorted(minSeg, maxSeg int) {
147 if ss.options == nil || !ss.options.DeferredSort {
148 return
149 }
150
151 sorted := true // Two phases allows for more concurrent sorting.
152 for seg := maxSeg; seg >= minSeg; seg-- {
153 sorted = sorted && ss.a[seg].RequestSort(false)
154 }
155
156 if !sorted {
157 for seg := maxSeg; seg >= minSeg; seg-- {
158 ss.a[seg].RequestSort(true)
159 }
160 }
161}
162
163// ------------------------------------------------------
164

Callers 3

getMethod · 0.95
ensureFullySortedMethod · 0.95
startIteratorMethod · 0.95

Calls 1

RequestSortMethod · 0.65

Tested by

no test coverage detected