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::RadixHTGlobalSourceState Class Reference
Inheritance diagram for duckdb::RadixHTGlobalSourceState:
Collaboration diagram for duckdb::RadixHTGlobalSourceState:

Public Member Functions

 RadixHTGlobalSourceState (ClientContext &context, const RadixPartitionedHashTable &radix_ht)
SourceResultType AssignTask (RadixHTGlobalSinkState &sink, RadixHTLocalSourceState &lstate, InterruptState &interrupt_state)
 Assigns a task to a local source state.
Public Member Functions inherited from duckdb::GlobalSourceState
virtual idx_t MaxThreads ()
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const
Public Member Functions inherited from duckdb::StateWithBlockableTasks
unique_lock< mutex > Lock ()
void PreventBlocking (const unique_lock< mutex > &guard)
bool BlockTask (const unique_lock< mutex > &guard, const InterruptState &interrupt_state)
 Add a task to 'blocked_tasks' before returning SourceResultType::BLOCKED (must hold the lock).
bool CanBlock (const unique_lock< mutex > &guard) const
bool UnblockTasks (const unique_lock< mutex > &guard)
 Unblock all tasks (must hold the lock).
SinkResultType BlockSink (const unique_lock< mutex > &guard, const InterruptState &interrupt_state)
SourceResultType BlockSource (const unique_lock< mutex > &guard, const InterruptState &interrupt_state)
void VerifyLock (const unique_lock< mutex > &guard) const

Public Attributes

ClientContext & context
 The client context.
atomic< bool > finished
 For synchronizing the source phase.
vector< column_t > column_ids
 Column ids for scanning.
atomic< idx_t > task_idx
 For synchronizing tasks.
atomic< idx_t > task_done

Constructor & Destructor Documentation

◆ RadixHTGlobalSourceState()

duckdb::RadixHTGlobalSourceState::RadixHTGlobalSourceState ( ClientContext & context,
const RadixPartitionedHashTable & radix_ht )
207737 : context(context_p), finished(false), task_idx(0), task_done(0) {
207738 for (column_t column_id = 0; column_id < radix_ht.group_types.size(); column_id++) {
207739 column_ids.push_back(column_id);
207740 }
207741}
vector< column_t > column_ids
Column ids for scanning.
Definition duckdb.cpp:207683
atomic< bool > finished
For synchronizing the source phase.
Definition duckdb.cpp:207680
atomic< idx_t > task_idx
For synchronizing tasks.
Definition duckdb.cpp:207686
ClientContext & context
The client context.
Definition duckdb.cpp:207678
idx_t column_t
Type used for column identifiers.
Definition duckdb.hpp:259

Member Function Documentation

◆ AssignTask()

SourceResultType duckdb::RadixHTGlobalSourceState::AssignTask ( RadixHTGlobalSinkState & sink,
RadixHTLocalSourceState & lstate,
InterruptState & interrupt_state )

Assigns a task to a local source state.

207744 {
207745 // First, try to get a partition index
207746 lstate.task_idx = task_idx++;
207747 if (finished || lstate.task_idx >= sink.partitions.size()) {
207748 lstate.ht.reset();
207749 return SourceResultType::FINISHED;
207750 }
207751
207752 // We got a partition index
207753 auto &partition = *sink.partitions[lstate.task_idx];
207754 auto partition_guard = partition.Lock();
207755 switch (partition.state) {
207758 lstate.task = RadixHTSourceTaskType::FINALIZE;
207759 return SourceResultType::HAVE_MORE_OUTPUT;
207761 lstate.task = RadixHTSourceTaskType::SCAN;
207762 lstate.scan_status = RadixHTScanStatus::INIT;
207763 return partition.BlockSource(partition_guard, interrupt_state);
207765 lstate.task = RadixHTSourceTaskType::SCAN;
207766 lstate.scan_status = RadixHTScanStatus::INIT;
207767 return SourceResultType::HAVE_MORE_OUTPUT;
207768 default:
207769 throw InternalException("Unexpected AggregatePartitionState in RadixHTLocalSourceState::Finalize!");
207770 }
207771}
int partition(const std::vector< _Tp > &_vec, std::vector< int > &labels, _EqPredicate predicate=_EqPredicate())
@ READY_TO_FINALIZE
Can be finalized.
Definition duckdb.cpp:207049
@ READY_TO_SCAN
Finalized, ready to scan.
Definition duckdb.cpp:207053
@ FINALIZE_IN_PROGRESS
Finalize is in progress.
Definition duckdb.cpp:207051

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