Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <bit-stream-utils.8byte.h>
Public Member Functions | |
BitWriter_8byte (uint8_t *buffer, int buffer_len) | |
void | Clear () |
uint8_t * | buffer () const |
int | buffer_len () const |
int | bytes_written () const |
bool | PutValue (uint64_t v, int num_bits) |
template<typename T > | |
bool | PutAligned (T v, int num_bits) |
Writes v to the next aligned byte. More... | |
bool | PutVlqInt (int32_t v) |
uint8_t * | GetNextBytePtr (int num_bytes=1) |
Private Attributes | |
uint64_t * | buffer_ |
int | max_bytes_ |
int | offset_ |
int | bit_offset_ |
Utility class to write bit/byte streams. This class can write data to either be bit packed or byte aligned (and a single stream that has a mix of both). This class does not allocate memory.
Definition at line 30 of file bit-stream-utils.8byte.h.
|
inline |
buffer: buffer to write bits to. Buffer should be preallocated with 'buffer_len' bytes. 'buffer_len' must be a multiple of 8.
Definition at line 34 of file bit-stream-utils.8byte.h.
|
inline |
Definition at line 48 of file bit-stream-utils.8byte.h.
References buffer_.
|
inline |
Definition at line 49 of file bit-stream-utils.8byte.h.
References max_bytes_.
|
inline |
Definition at line 51 of file bit-stream-utils.8byte.h.
References bit_offset_, impala::BitUtil::Ceil(), and offset_.
Referenced by GetNextBytePtr().
|
inline |
Definition at line 42 of file bit-stream-utils.8byte.h.
References bit_offset_, buffer_, max_bytes_, and offset_.
|
inline |
Get a pointer to the next aligned byte and advance the underlying buffer by num_bytes. Returns NULL if there was not enough space.
Definition at line 45 of file bit-stream-utils.8byte.inline.h.
References bit_offset_, buffer_, bytes_written(), max_bytes_, offset_, impala::BitUtil::RoundUpNumBytes(), and UNLIKELY.
Referenced by PutAligned().
|
inline |
Writes v to the next aligned byte.
Definition at line 65 of file bit-stream-utils.8byte.inline.h.
References GetNextBytePtr(), and PutValue().
Writes a value to the buffer. This is bit packed. Returns false if there was not enough space.
Definition at line 23 of file bit-stream-utils.8byte.inline.h.
References bit_offset_, buffer_, max_bytes_, offset_, and UNLIKELY.
Referenced by PutAligned(), and TestBitWriter8ByteEncode().
|
inline |
Write a Vlq encoded int to the buffer. Returns false if there was not enough room. The value is written byte aligned. For more details on vlq: en.wikipedia.org/wiki/Variable-length_quantity
Definition at line 76 of file bit-stream-utils.8byte.inline.h.
|
private |
Definition at line 78 of file bit-stream-utils.8byte.h.
Referenced by bytes_written(), Clear(), GetNextBytePtr(), and PutValue().
|
private |
Definition at line 75 of file bit-stream-utils.8byte.h.
Referenced by buffer(), Clear(), GetNextBytePtr(), and PutValue().
|
private |
Definition at line 76 of file bit-stream-utils.8byte.h.
Referenced by buffer_len(), Clear(), GetNextBytePtr(), and PutValue().
|
private |
Definition at line 77 of file bit-stream-utils.8byte.h.
Referenced by bytes_written(), Clear(), GetNextBytePtr(), and PutValue().