MCPcopy Create free account
hub / github.com/brimdata/super / Touch

Method Touch

vector/record.go:107–121  ·  view source on GitHub ↗

Touch is called for each offset at which a value occurs. From this, we derive the runs of values and nones interleaved beginning with the first run of nones (which may be 0). Whenever there is a gap in values, we record the gap size as a run. When touch is called consecutively, we wait for for a gap

(off uint32)

Source from the content-addressed store, hash-verified

105// When touch is called consecutively, we wait for for a gap before
106// recording the none run immediately followed by the gap.
107func (r *RLE) Touch(off uint32) {
108 if r.prediction == r.last {
109 // This happens only on first call.
110 // Emit length of none run.
111 r.emit(off)
112 r.last = off
113 } else if r.prediction != off {
114 // emit length of value run
115 r.emit(r.prediction - r.last)
116 // emit length of none run
117 r.emit(off - r.prediction)
118 r.last = off
119 }
120 r.prediction = off + 1
121}
122
123func (r *RLE) End(off uint32) []uint32 {
124 if r.prediction == r.last {

Callers 3

EndMethod · 0.95
RLEMethod · 0.95
writeMethod · 0.80

Calls 1

emitMethod · 0.95

Tested by

no test coverage detected