MCPcopy Create free account
hub / github.com/apache/impala / GetNextBatch

Method GetNextBatch

be/src/exec/row-batch-cache.h:43–53  ·  view source on GitHub ↗

Returns the next batch from the cache. Expands the cache if necessary. If a new batch is created, its memory is tracked against 'mem_tracker'.

Source from the content-addressed store, hash-verified

41 /// Returns the next batch from the cache. Expands the cache if necessary.
42 /// If a new batch is created, its memory is tracked against 'mem_tracker'.
43 RowBatch* GetNextBatch(MemTracker* mem_tracker) {
44 if (next_row_batch_idx_ >= row_batches_.size()) {
45 // Expand the cache with a new row batch.
46 row_batches_.push_back(
47 std::make_unique<RowBatch>(row_desc_, batch_size_, mem_tracker));
48 } else {
49 // Reset batch from the cache before returning it.
50 row_batches_[next_row_batch_idx_]->Reset();
51 }
52 return row_batches_[next_row_batch_idx_++].get();
53 }
54
55 /// Resets the cache such that subsequent calls to GetNextBatch() return batches from
56 /// the beginning of the cache. All batches previously returned by GetNextBatch()

Callers 2

DeepCopyBuildBatchesMethod · 0.45
GetNextEmptyBatchMethod · 0.45

Calls 4

push_backMethod · 0.80
getMethod · 0.65
sizeMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected