ColumnDataConsumer can scan a ColumnDataCollection, and consume it in the process, i.e., read blocks are deleted.
More...
|
|
mutex | lock |
|
ColumnDataCollection & | collection |
| | The collection being scanned.
|
|
vector< column_t > | column_ids |
| | The column ids to scan.
|
|
idx_t | chunk_count |
| | The number of chunk references.
|
|
vector< ChunkReference > | chunk_references |
| | The chunks (in order) to be scanned.
|
|
idx_t | current_chunk_index |
| | Current index into "chunks".
|
|
unordered_set< idx_t > | chunks_in_progress |
| | Chunks currently in progress.
|
|
idx_t | chunk_delete_index |
| | The data has been consumed up to this chunk index.
|
ColumnDataConsumer can scan a ColumnDataCollection, and consume it in the process, i.e., read blocks are deleted.
◆ ColumnDataConsumer()
116280}
ColumnDataCollection & collection
The collection being scanned.
Definition duckdb.cpp:116245
vector< column_t > column_ids
The column ids to scan.
Definition duckdb.cpp:116247
◆ Count()
| idx_t duckdb::ColumnDataConsumer::Count |
( |
| ) |
const |
|
inline |
◆ ChunkCount()
| idx_t duckdb::ColumnDataConsumer::ChunkCount |
( |
| ) |
const |
|
inline |
116225 {
116227 }
idx_t chunk_count
The number of chunk references.
Definition duckdb.cpp:116249
◆ InitializeScan()
| void duckdb::ColumnDataConsumer::InitializeScan |
( |
| ) |
|
Initialize the scan of the ColumnDataCollection.
116282 {
116286
116287
116289 for (
auto &segment :
collection.GetSegments()) {
116290 for (
idx_t chunk_index = 0; chunk_index < segment->chunk_data.size(); chunk_index++) {
116292 }
116293 }
116295}
vector< ChunkReference > chunk_references
The chunks (in order) to be scanned.
Definition duckdb.cpp:116251
idx_t current_chunk_index
Current index into "chunks".
Definition duckdb.cpp:116253
idx_t chunk_delete_index
The data has been consumed up to this chunk index.
Definition duckdb.cpp:116257
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static constexpr const idx_t INVALID_INDEX
The value used to signify an invalid index entry.
Definition duckdb.hpp:1117
◆ AssignChunk()
Assign a chunk to the scan state.
116297 {
116298 lock_guard<mutex> guard(lock);
116300
116301 state.current_chunk_state.handles.clear();
116303 return false;
116304 }
116305
116309 return true;
116310}
unordered_set< idx_t > chunks_in_progress
Chunks currently in progress.
Definition duckdb.cpp:116255
◆ ScanChunk()
Scan the assigned chunk.
116312 {
116315 if (state.allocator != chunk_ref.segment->allocator.get()) {
116316
116317 state.allocator = chunk_ref.segment->allocator.get();
116318 state.current_chunk_state.handles.clear();
116319 }
116320 chunk_ref.segment->ReadChunk(chunk_ref.chunk_index_in_segment, state.current_chunk_state, chunk,
column_ids);
116321}
◆ FinishChunk()
Indicate that scanning the chunk is done.
116323 {
116325 idx_t delete_index_start;
116326 idx_t delete_index_end;
116327 {
116328 lock_guard<mutex> guard(lock);
116334 }
116335 ConsumeChunks(delete_index_start, delete_index_end);
116336}
◆ ConsumeChunks()
| void duckdb::ColumnDataConsumer::ConsumeChunks |
( |
idx_t | delete_index_start, |
|
|
idx_t | delete_index_end ) |
|
private |
116337 {
116338 for (
idx_t chunk_index = delete_index_start; chunk_index < delete_index_end; chunk_index++) {
116339 if (chunk_index == 0) {
116340 continue;
116341 }
116344 auto prev_allocator = prev_chunk_ref.segment->allocator.get();
116345 auto curr_allocator = curr_chunk_ref.segment->allocator.get();
116346 auto prev_min_block_id = prev_chunk_ref.GetMinimumBlockID();
116347 auto curr_min_block_id = curr_chunk_ref.GetMinimumBlockID();
116348 if (prev_allocator != curr_allocator) {
116349
116350 for (uint32_t block_id = prev_min_block_id; block_id < prev_allocator->BlockCount(); block_id++) {
116351 prev_allocator->SetDestroyBufferUponUnpin(block_id);
116352 }
116353 continue;
116354 }
116355
116356 for (uint32_t block_id = prev_min_block_id; block_id < curr_min_block_id; block_id++) {
116357 prev_allocator->SetDestroyBufferUponUnpin(block_id);
116358 }
116359 }
116360}
The documentation for this class was generated from the following file: