MCPcopy
hub / github.com/uber/aresdb / NewArrayValueReader

Function NewArrayValueReader

memstore/common/data_value.go:717–724  ·  view source on GitHub ↗

NewArrayValueReader is to create ArrayValueReader to read from upsertbatch, which includes the item number

(dataType DataType, value unsafe.Pointer)

Source from the content-addressed store, hash-verified

715
716// NewArrayValueReader is to create ArrayValueReader to read from upsertbatch, which includes the item number
717func NewArrayValueReader(dataType DataType, value unsafe.Pointer) *ArrayValueReader {
718 length := *((*uint32)(value))
719 return &ArrayValueReader{
720 itemType: GetElementDataType(dataType),
721 value: unsafe.Pointer(uintptr(value) + 4),
722 length: int(length),
723 }
724}
725
726// GetLength return item numbers inside the array
727func (reader *ArrayValueReader) GetLength() int {

Callers 8

getCompactedTotalBytesFunction · 0.92
createArchiveVPFunction · 0.92
arrayValueCompareFunction · 0.92

Calls 1

GetElementDataTypeFunction · 0.85

Tested by 2

getCompactedTotalBytesFunction · 0.74
createArchiveVPFunction · 0.74