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

Public Member Functions

 PartitionedAggregateGlobalSinkState (const PhysicalPartitionedAggregate &op, ClientContext &context)
GlobalUngroupedAggregateState & GetOrCreatePartition (ClientContext &context, const Value &partition)
void Combine (ClientContext &context, PartitionedAggregateLocalSinkState &lstate)
Public Member Functions inherited from duckdb::GlobalSinkState
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const
virtual idx_t MaxThreads (idx_t source_max_threads)
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

mutex lock
const PhysicalPartitionedAggregate & op
value_map_t< unique_ptr< GlobalUngroupedAggregateState > > aggregate_states
 The per-partition aggregate states.
ColumnDataCollection aggregate_result
 Final aggregate result.
Public Attributes inherited from duckdb::GlobalSinkState
SinkFinalizeType state

Constructor & Destructor Documentation

◆ PartitionedAggregateGlobalSinkState()

duckdb::PartitionedAggregateGlobalSinkState::PartitionedAggregateGlobalSinkState ( const PhysicalPartitionedAggregate & op,
ClientContext & context )
inline
161100 : op(op), aggregate_result(BufferAllocator::Get(context), op.types) {
161101 }
ColumnDataCollection aggregate_result
Final aggregate result.
Definition duckdb.cpp:161108

Member Function Documentation

◆ GetOrCreatePartition()

GlobalUngroupedAggregateState & duckdb::PartitionedAggregateGlobalSinkState::GetOrCreatePartition ( ClientContext & context,
const Value & partition )
inline
161110 {
161111 lock_guard<mutex> l(lock);
161112 // find the state that corresponds to this partition and combine
161113 auto entry = aggregate_states.find(partition);
161114 if (entry != aggregate_states.end()) {
161115 return *entry->second;
161116 }
161117 // no state yet for this partition - allocate a new one
161118 auto new_global_state = make_uniq<GlobalUngroupedAggregateState>(BufferAllocator::Get(context), op.aggregates);
161119 auto &result = *new_global_state;
161120 aggregate_states.insert(make_pair(partition, std::move(new_global_state)));
161121 return result;
161122 }
value_map_t< unique_ptr< GlobalUngroupedAggregateState > > aggregate_states
The per-partition aggregate states.
Definition duckdb.cpp:161106

◆ Combine()

void duckdb::PartitionedAggregateGlobalSinkState::Combine ( ClientContext & context,
PartitionedAggregateLocalSinkState & lstate )
inline
161124 {
161125 if (!lstate.state) {
161126 // no aggregate state
161127 return;
161128 }
161129 auto &global_state = GetOrCreatePartition(context, lstate.current_partition);
161130 global_state.Combine(*lstate.state);
161131 // clear the local aggregate state
161132 lstate.state.reset();
161133 }

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