16 #ifndef IMPALA_RUNTIME_ROW_BATCH_H
17 #define IMPALA_RUNTIME_ROW_BATCH_H
21 #include <boost/scoped_ptr.hpp>
31 class BufferedTupleStream;
36 class TupleDescriptor;
130 DCHECK(tuple_pool != NULL);
142 DCHECK_GE(row_idx, 0);
180 DCHECK_LE(dest, src);
The underlying memory management is done by the BufferedBlockMgr.
RowBatch(const RowDescriptor &row_desc, int capacity, MemTracker *tracker)
void ClearRow(TupleRow *row)
int64_t total_allocated_bytes() const
int num_io_buffers() const
A tuple with 0 materialised slots is represented as NULL.
const RowDescriptor & row_desc() const
TupleRow * GetRow(int row_idx)
void AcquireState(RowBatch *src)
void CopyRows(int dest, int src, int num_rows)
bool AtCapacity(MemPool *tuple_pool)
std::vector< DiskIoMgr::BufferDescriptor * > io_buffers_
bool has_in_flight_row_
All members below need to be handled in RowBatch::AcquireState()
void AddTupleStream(BufferedTupleStream *stream)
int64_t auxiliary_mem_usage_
static const int AT_CAPACITY_MEM_USAGE
void Reset()
Resets the row batch, returning all resources it has accumulated.
void set_num_rows(int num_rows)
void AddIoBuffer(DiskIoMgr::BufferDescriptor *buffer)
Add io buffer to this row batch.
static int GetBatchSize(const TRowBatch &batch)
Utility function: returns total size of batch.
void TransferResourceOwnership(RowBatch *dest)
MemTracker * mem_tracker_
This class is thread-safe.
std::string compression_scratch_
MemPool * tuple_data_pool()
int Serialize(TRowBatch *output_batch)
std::vector< BufferedTupleStream * > tuple_streams_
Tuple streams currently owned by this row batch.
void CopyRow(TupleRow *src, TupleRow *dest)
int MaxTupleBufferSize()
Computes the maximum size needed to store tuple data for this row batch.
int num_tuple_streams() const
boost::scoped_ptr< MemPool > tuple_data_pool_
holding (some of the) data referenced by rows
static const int INVALID_ROW_INDEX