|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hive.serde2.lazybinary.LazyBinaryUtils
public final class LazyBinaryUtils
LazyBinaryUtils.
Nested Class Summary | |
---|---|
static class |
LazyBinaryUtils.RecordInfo
Record is the unit that data is serialized in. |
static class |
LazyBinaryUtils.VInt
A zero-compressed encoded integer. |
static class |
LazyBinaryUtils.VLong
A zero-compressed encoded long. |
Method Summary | |
---|---|
static int |
byteArrayToInt(byte[] b,
int offset)
Convert the byte array to an int starting from the given offset. |
static long |
byteArrayToLong(byte[] b,
int offset)
Convert the byte array to a long starting from the given offset. |
static short |
byteArrayToShort(byte[] b,
int offset)
Convert the byte array to a short starting from the given offset. |
static void |
checkObjectByteInfo(ObjectInspector objectInspector,
byte[] bytes,
int offset,
LazyBinaryUtils.RecordInfo recordInfo)
Check a particular field and set its size and offset in bytes based on the field type and the bytes arrays. |
static ObjectInspector |
getLazyBinaryObjectInspectorFromTypeInfo(TypeInfo typeInfo)
Returns the lazy binary object inspector that can be used to inspect an lazy binary object of that typeInfo For primitive types, we use the standard writable object inspector. |
static void |
readVInt(byte[] bytes,
int offset,
LazyBinaryUtils.VInt vInt)
Reads a zero-compressed encoded int from a byte array and returns it. |
static void |
readVLong(byte[] bytes,
int offset,
LazyBinaryUtils.VLong vlong)
Reads a zero-compressed encoded long from a byte array and returns it. |
static void |
writeVInt(ByteStream.Output byteStream,
int i)
Writes a zero-compressed encoded int to a byte array. |
static void |
writeVLong(ByteStream.Output byteStream,
long l)
|
static int |
writeVLongToByteArray(byte[] bytes,
int offset,
long l)
|
static int |
writeVLongToByteArray(byte[] bytes,
long l)
Write a zero-compressed encoded long to a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int byteArrayToInt(byte[] b, int offset)
b
- the byte arrayoffset
- the array offset
public static long byteArrayToLong(byte[] b, int offset)
b
- the byte arrayoffset
- the array offset
public static short byteArrayToShort(byte[] b, int offset)
b
- the byte arrayoffset
- the array offset
public static void checkObjectByteInfo(ObjectInspector objectInspector, byte[] bytes, int offset, LazyBinaryUtils.RecordInfo recordInfo)
objectInspector
- object inspector of the fieldbytes
- bytes arrays store the table rowoffset
- offset of this fieldrecordInfo
- modify this byteinfo object and return itpublic static void readVLong(byte[] bytes, int offset, LazyBinaryUtils.VLong vlong)
bytes
- the byte arrayoffset
- offset of the array to read fromvlong
- storing the deserialized long and its size in bytepublic static void readVInt(byte[] bytes, int offset, LazyBinaryUtils.VInt vInt)
bytes
- the byte arrayoffset
- offset of the array to read fromvInt
- storing the deserialized int and its size in bytepublic static void writeVInt(ByteStream.Output byteStream, int i)
byteStream
- the byte array/streami
- the intpublic static int writeVLongToByteArray(byte[] bytes, long l)
bytes
- the byte array/streaml
- the longpublic static int writeVLongToByteArray(byte[] bytes, int offset, long l)
public static void writeVLong(ByteStream.Output byteStream, long l)
public static ObjectInspector getLazyBinaryObjectInspectorFromTypeInfo(TypeInfo typeInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |