Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::MergeCollectionTask Class Reference
Inheritance diagram for duckdb::MergeCollectionTask:
Collaboration diagram for duckdb::MergeCollectionTask:

Public Member Functions

 MergeCollectionTask (vector< RowGroupBatchEntry > merge_collections_p, idx_t merged_batch_index)
void Execute (const PhysicalBatchInsert &op, ClientContext &context, GlobalSinkState &g_state_p, LocalSinkState &l_state_p) override

Public Attributes

vector< RowGroupBatchEntry > merge_collections
idx_t merged_batch_index

Constructor & Destructor Documentation

◆ MergeCollectionTask()

duckdb::MergeCollectionTask::MergeCollectionTask ( vector< RowGroupBatchEntry > merge_collections_p,
idx_t merged_batch_index )
inline
193155 : merge_collections(std::move(merge_collections_p)), merged_batch_index(merged_batch_index) {
193156 }

Member Function Documentation

◆ Execute()

void duckdb::MergeCollectionTask::Execute ( const PhysicalBatchInsert & op,
ClientContext & context,
GlobalSinkState & g_state_p,
LocalSinkState & l_state_p )
inlineoverridevirtual

Implements duckdb::BatchInsertTask.

193162 {
193163 auto &g_state = g_state_p.Cast<BatchInsertGlobalState>();
193164 auto &l_state = l_state_p.Cast<BatchInsertLocalState>();
193165
193166 // Merge the collections.
193167 if (!l_state.optimistic_writer) {
193168 l_state.optimistic_writer = make_uniq<OptimisticDataWriter>(context, g_state.table.GetStorage());
193169 }
193170 auto result_collection_index = g_state.MergeCollections(context, merge_collections, *l_state.optimistic_writer);
193171 merge_collections.clear();
193172
193173 lock_guard<mutex> l(g_state.lock);
193174 auto &result_collection = g_state.table.GetStorage().GetOptimisticCollection(context, result_collection_index);
193175 RowGroupBatchEntry new_entry(result_collection, merged_batch_index, result_collection_index,
193176 RowGroupBatchType::FLUSHED);
193177
193178 // Add the result collection to the set of batch indexes.
193179 auto it = std::lower_bound(
193180 g_state.collections.begin(), g_state.collections.end(), new_entry,
193181 [&](const RowGroupBatchEntry &a, const RowGroupBatchEntry &b) { return a.batch_idx < b.batch_idx; });
193182 if (it->batch_idx != merged_batch_index) {
193183 throw InternalException("Merged batch index was no longer present in collection");
193184 }
193185 it->collection_index = new_entry.collection_index;
193186 }

The documentation for this class was generated from the following file: