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

Method getOperationKeyVal

segment.go:521–533  ·  view source on GitHub ↗

getOperationKeyVal() returns the operation, key, val for a given logical entry position in the segment.

(pos int)

Source from the content-addressed store, hash-verified

519// getOperationKeyVal() returns the operation, key, val for a given
520// logical entry position in the segment.
521func (a *segment) getOperationKeyVal(pos int) (uint64, []byte, []byte) {
522 x := pos * 2
523 if x < len(a.kvs) {
524 opklvl := a.kvs[x]
525 kstart := int(a.kvs[x+1])
526 operation, keyLen, valLen := decodeOpKeyLenValLen(opklvl)
527 vstart := kstart + keyLen
528
529 return operation, a.buf[kstart:vstart], a.buf[vstart : vstart+valLen]
530 }
531
532 return 0, nil, nil
533}
534
535// ------------------------------------------------------
536

Callers 4

GetMethod · 0.95
CurrentMethod · 0.80
currentKeyMethod · 0.80
TestBatchSortFunction · 0.80

Calls 1

decodeOpKeyLenValLenFunction · 0.85

Tested by 1

TestBatchSortFunction · 0.64