Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <bit-stream-utils.8byte.h>
Public Member Functions | |
BitReader_8byte (uint8_t *buffer, int buffer_len) | |
BitReader_8byte () | |
template<typename T > | |
bool | GetValue (int num_bits, T *v) |
template<typename T > | |
bool | GetAligned (int num_bits, T *v) |
bool | GetVlqInt (int32_t *v) |
int | bytes_left () |
Static Public Attributes | |
static const int | MAX_VLQ_BYTE_LEN = 5 |
Maximum byte length of a vlq encoded int. More... | |
Private Member Functions | |
void | Align () |
Advances offset_ and/or bit_offset_ to next byte boundary in buffer_. More... | |
Private Attributes | |
uint64_t * | buffer_ |
int | max_bytes_ |
int | offset_ |
int | bit_offset_ |
Utility class to read bit/byte stream. This class can read bits or bytes that are either byte aligned or not. It also has utilities to read multiple bytes in one read (e.g. encoded int).
Definition at line 84 of file bit-stream-utils.8byte.h.
|
inline |
buffer: buffer to read from. The buffer's length is 'buffer_len' and must be a multiple of 8.
Definition at line 88 of file bit-stream-utils.8byte.h.
|
inline |
Definition at line 96 of file bit-stream-utils.8byte.h.
|
inlineprivate |
Advances offset_ and/or bit_offset_ to next byte boundary in buffer_.
Definition at line 130 of file bit-stream-utils.8byte.inline.h.
References bit_offset_, max_bytes_, offset_, impala::BitUtil::RoundUpNumBytes(), and UNLIKELY.
Referenced by GetAligned().
|
inline |
Returns the number of bytes left in the stream, not including the current byte (i.e., there may be an additional fraction of a byte).
Definition at line 115 of file bit-stream-utils.8byte.h.
References bit_offset_, impala::BitUtil::Ceil(), max_bytes_, and offset_.
Referenced by GetAligned().
|
inline |
Reads a T sized value from the buffer. T needs to be a native type and little endian. The value is assumed to be byte aligned so the stream will be advance to the start of the next byte before v is read.
Definition at line 106 of file bit-stream-utils.8byte.inline.h.
References Align(), bit_offset_, bytes_left(), impala::BitUtil::Ceil(), GetValue(), and UNLIKELY.
|
inline |
Gets the next value from the buffer. Returns true if 'v' could be read or false if there are not enough bytes left.
Definition at line 87 of file bit-stream-utils.8byte.inline.h.
References bit_offset_, buffer_, max_bytes_, offset_, impala::BitUtil::TrailingBits(), and UNLIKELY.
Referenced by GetAligned(), and TestBitWriter8ByteDecode().
|
inline |
Reads a vlq encoded int from the stream. The encoded int must start at the beginning of a byte. Return false if there were not enough bytes in the buffer.
Definition at line 116 of file bit-stream-utils.8byte.inline.h.
References MAX_VLQ_BYTE_LEN.
|
private |
Definition at line 126 of file bit-stream-utils.8byte.h.
Referenced by Align(), bytes_left(), GetAligned(), and GetValue().
|
private |
Definition at line 123 of file bit-stream-utils.8byte.h.
Referenced by GetValue().
|
private |
Definition at line 124 of file bit-stream-utils.8byte.h.
Referenced by Align(), bytes_left(), and GetValue().
|
static |
Maximum byte length of a vlq encoded int.
Definition at line 120 of file bit-stream-utils.8byte.h.
Referenced by GetVlqInt().
|
private |
Definition at line 125 of file bit-stream-utils.8byte.h.
Referenced by Align(), bytes_left(), and GetValue().