15 #ifndef IMPALA_RUNTIME_TUPLE_BUFFERED_STREAM_INLINE_H
16 #define IMPALA_RUNTIME_TUPLE_BUFFERED_STREAM_INLINE_H
28 bool got_block =
false;
30 if (!
status_.
ok() || !got_block)
return false;
37 bool got_block =
false;
39 if (!
status_.
ok() || !got_block)
return NULL;
61 uint32_t tuple_idx = idx.
idx() * tuples_per_row;
62 for (
int i = 0; i < tuples_per_row; ++i) {
64 const uint32_t null_pos = tuple_idx & 7;
65 const bool is_not_null = ((*null_word & (1 << (7 - null_pos))) == 0);
66 row->
SetTuple(i, reinterpret_cast<Tuple*>(
67 reinterpret_cast<uint64_t>(data) * is_not_null));
73 row->
SetTuple(i, reinterpret_cast<Tuple*>(data));
std::vector< uint8_t * > block_start_idx_
T * Allocate(int size)
Allocates the specified number of bytes from this block.
bool DeepCopy(TupleRow *row, uint8_t **dst)
Wrapper of the templated DeepCopyInternal() function.
const RowDescriptor & desc_
Description of rows stored in the stream.
int BytesRemaining() const
Return the number of remaining bytes that can be allocated in this block.
const bool delete_on_read_
If true, blocks are deleted after they are read.
const bool nullable_tuple_
Whether any tuple in the rows is nullable.
BufferedBlockMgr::Block * write_block_
The current block for writing. NULL if there is no available block to write to.
const std::vector< TupleDescriptor * > & tuple_descriptors() const
Return descriptors for all tuples in this row, in order of appearance.
void SetTuple(int tuple_idx, Tuple *tuple)
bool AddRow(TupleRow *row, uint8_t **dst=NULL)
uint8_t * AllocateRow(int size)
std::list< BufferedBlockMgr::Block * > blocks_
List of blocks in the stream.
Status NewBlockForWrite(int min_size, bool *got_block)
int64_t num_rows_
Number of rows stored in the stream.
int ComputeRowSize(TupleRow *row) const
Returns the byte size of this row when encoded in a block.
void GetTupleRow(const RowIdx &idx, TupleRow *row) const