public final class Docsum extends Object
Modifier and Type | Field and Description |
---|---|
private DocsumDefinition |
definition |
private int[] |
fieldOffsets
The offsets into the packet data of each field, given the fields index, computed lazily
|
private int |
largestStoredOffset
The largest stored offset
|
private byte[] |
packet |
Constructor and Description |
---|
Docsum(DocsumDefinition definition,
byte[] packet) |
Modifier and Type | Method and Description |
---|---|
Object |
decode(int fieldIndex) |
FastHit.RawField |
fetchFieldAsUtf8(int fieldIndex)
Fetches the field as raw utf-8 if it is a text field.
|
DocsumDefinition |
getDefinition() |
Integer |
getFieldIndex(String fieldName) |
ByteBuffer |
packetAsBuffer() |
private int |
setAndReturnOffsetToField(ByteBuffer b,
int fieldIndex)
Returns the offset of a given field in the buffer, and sets the position of the buffer to that field start
|
String |
toString() |
private final DocsumDefinition definition
private final byte[] packet
private final int[] fieldOffsets
private int largestStoredOffset
public Docsum(DocsumDefinition definition, byte[] packet)
public DocsumDefinition getDefinition()
public Object decode(int fieldIndex)
public FastHit.RawField fetchFieldAsUtf8(int fieldIndex)
public ByteBuffer packetAsBuffer()
private int setAndReturnOffsetToField(ByteBuffer b, int fieldIndex)
Copyright © 2018. All rights reserved.