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

Public Member Functions

 PhysicalBufferedCollector (PhysicalPlan &physical_plan, PreparedStatementData &data, bool parallel)
unique_ptr< QueryResult > GetResult (GlobalSinkState &state) const override
 The final method used to fetch the query result from this operator.
SinkResultType Sink (ExecutionContext &context, DataChunk &chunk, OperatorSinkInput &input) const override
SinkCombineResultType Combine (ExecutionContext &context, OperatorSinkCombineInput &input) const override
unique_ptr< LocalSinkState > GetLocalSinkState (ExecutionContext &context) const override
unique_ptr< GlobalSinkState > GetGlobalSinkState (ClientContext &context) const override
bool ParallelSink () const override
bool SinkOrderDependent () const override
bool IsStreaming () const override
 Whether this is a streaming result collector.
Public Member Functions inherited from duckdb::PhysicalResultCollector
 PhysicalResultCollector (PhysicalPlan &physical_plan, PreparedStatementData &data)
bool IsSink () const override
vector< const_reference< PhysicalOperator > > GetChildren () const override
void BuildPipelines (Pipeline &current, MetaPipeline &meta_pipeline) override
bool IsSource () const override
Public Member Functions inherited from duckdb::PhysicalOperator
 PhysicalOperator (PhysicalPlan &physical_plan, PhysicalOperatorType type, vector< LogicalType > types, idx_t estimated_cardinality)
 PhysicalOperator (const PhysicalOperator &other)=delete
 Deleted copy constructors.
PhysicalOperator & operator= (const PhysicalOperator &)=delete
virtual string GetName () const
virtual InsertionOrderPreservingMap< string > ParamsToString () const
virtual string ToString (ExplainFormat format=ExplainFormat::DEFAULT) const
void Print () const
const vector< LogicalType > & GetTypes () const
 Return a vector of the types that will be returned by this operator.
virtual bool Equals (const PhysicalOperator &other) const
idx_t EstimatedThreadCount () const
 Functions to help decide how to set up pipeline dependencies.
bool CanSaturateThreads (ClientContext &context) const
virtual void Verify ()
virtual unique_ptr< OperatorState > GetOperatorState (ExecutionContext &context) const
virtual unique_ptr< GlobalOperatorState > GetGlobalOperatorState (ClientContext &context) const
virtual OperatorResultType Execute (ExecutionContext &context, DataChunk &input, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const
virtual OperatorFinalizeResultType FinalExecute (ExecutionContext &context, DataChunk &chunk, GlobalOperatorState &gstate, OperatorState &state) const
virtual OperatorFinalResultType OperatorFinalize (Pipeline &pipeline, Event &event, ClientContext &context, OperatorFinalizeInput &input) const
virtual bool ParallelOperator () const
virtual bool RequiresFinalExecute () const
virtual bool RequiresOperatorFinalize () const
virtual OrderPreservationType OperatorOrder () const
 The influence the operator has on order (insertion order means no influence).
virtual unique_ptr< LocalSourceState > GetLocalSourceState (ExecutionContext &context, GlobalSourceState &gstate) const
virtual unique_ptr< GlobalSourceState > GetGlobalSourceState (ClientContext &context) const
SourceResultType GetData (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const
virtual OperatorPartitionData GetPartitionData (ExecutionContext &context, DataChunk &chunk, GlobalSourceState &gstate, LocalSourceState &lstate, const OperatorPartitionInfo &partition_info) const
virtual bool ParallelSource () const
virtual bool SupportsPartitioning (const OperatorPartitionInfo &partition_info) const
virtual OrderPreservationType SourceOrder () const
 The type of order emitted by the operator (as a source).
virtual ProgressData GetProgress (ClientContext &context, GlobalSourceState &gstate) const
 Returns the current progress percentage, or a negative value if progress bars are not supported.
virtual ProgressData GetSinkProgress (ClientContext &context, GlobalSinkState &gstate, const ProgressData source_progress) const
 Returns the current progress percentage, or a negative value if progress bars are not supported.
virtual InsertionOrderPreservingMap< string > ExtraSourceParams (GlobalSourceState &gstate, LocalSourceState &lstate) const
virtual void PrepareFinalize (ClientContext &context, GlobalSinkState &sink_state) const
virtual SinkFinalizeType Finalize (Pipeline &pipeline, Event &event, ClientContext &context, OperatorSinkFinalizeInput &input) const
virtual SinkNextBatchType NextBatch (ExecutionContext &context, OperatorSinkNextBatchInput &input) const
virtual OperatorPartitionInfo RequiredPartitionInfo () const
virtual vector< const_reference< PhysicalOperator > > GetSources () const
bool AllSourcesSupportBatchIndex () const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

bool parallel
Public Attributes inherited from duckdb::PhysicalResultCollector
StatementType statement_type
StatementProperties properties
QueryResultMemoryType memory_type
PhysicalOperator & plan
vector< string > names
Public Attributes inherited from duckdb::PhysicalOperator
ArenaLinkedList< reference< PhysicalOperator > > children
 The child operators.
PhysicalOperatorType type
 The physical operator type.
vector< LogicalType > types
 The return types.
idx_t estimated_cardinality
 The estimated cardinality.
unique_ptr< GlobalSinkState > sink_state
 The global sink state.
unique_ptr< GlobalOperatorState > op_state
 The global operator state.
mutex lock
 Lock for (re)setting any of the operator states.

Additional Inherited Members

Static Public Member Functions inherited from duckdb::PhysicalResultCollector
static unique_ptr< PhysicalOperator > GetResultCollector (ClientContext &context, PreparedStatementData &data)
Static Public Member Functions inherited from duckdb::PhysicalOperator
static void SetEstimatedCardinality (InsertionOrderPreservingMap< string > &result, idx_t estimated_cardinality)
static idx_t GetMaxThreadMemory (ClientContext &context)
 The maximum amount of memory the operator should use per thread.
static OperatorCachingMode SelectOperatorCachingMode (ExecutionContext &context)
 Whether operator caching is allowed in the current execution context.
Static Public Attributes inherited from duckdb::PhysicalResultCollector
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::RESULT_COLLECTOR
Static Public Attributes inherited from duckdb::PhysicalOperator
static constexpr const PhysicalOperatorType TYPE = PhysicalOperatorType::INVALID
Protected Member Functions inherited from duckdb::PhysicalResultCollector
unique_ptr< ColumnDataCollection > CreateCollection (ClientContext &context) const
Protected Member Functions inherited from duckdb::PhysicalOperator
virtual SourceResultType GetDataInternal (ExecutionContext &context, DataChunk &chunk, OperatorSourceInput &input) const

Constructor & Destructor Documentation

◆ PhysicalBufferedCollector()

duckdb::PhysicalBufferedCollector::PhysicalBufferedCollector ( PhysicalPlan & physical_plan,
PreparedStatementData & data,
bool parallel )
177500 : PhysicalResultCollector(physical_plan, data), parallel(parallel) {
177501}

Member Function Documentation

◆ GetResult()

unique_ptr< QueryResult > duckdb::PhysicalBufferedCollector::GetResult ( GlobalSinkState & state) const
overridevirtual

The final method used to fetch the query result from this operator.

Implements duckdb::PhysicalResultCollector.

177551 {
177552 auto &gstate = state.Cast<BufferedCollectorGlobalState>();
177553 lock_guard<mutex> l(gstate.glock);
177554 // FIXME: maybe we want to check if the execution was successful before creating the StreamQueryResult ?
177555 auto cc = gstate.context.lock();
177556 auto result = make_uniq<StreamQueryResult>(statement_type, properties, types, names, cc->GetClientProperties(),
177557 gstate.buffered_data);
177558 return std::move(result);
177559}
vector< LogicalType > types
The return types.
Definition duckdb.hpp:22152

◆ Sink()

SinkResultType duckdb::PhysicalBufferedCollector::Sink ( ExecutionContext & context,
DataChunk & chunk,
OperatorSinkInput & input ) const
overridevirtual

The sink method is called constantly with new input, as long as new input is available. Note that this method CAN be called in parallel, proper locking is needed when accessing dat a inside the GlobalSinkState.

Reimplemented from duckdb::PhysicalOperator.

177517 {
177518 auto &gstate = input.global_state.Cast<BufferedCollectorGlobalState>();
177519 auto &lstate = input.local_state.Cast<BufferedCollectorLocalState>();
177520 (void)lstate;
177521
177522 lock_guard<mutex> l(gstate.glock);
177523 auto &buffered_data = gstate.buffered_data->Cast<SimpleBufferedData>();
177524
177525 if (buffered_data.BufferIsFull()) {
177526 auto callback_state = input.interrupt_state;
177527 buffered_data.BlockSink(callback_state);
177528 return SinkResultType::BLOCKED;
177529 }
177530 buffered_data.Append(chunk);
177531 return SinkResultType::NEED_MORE_INPUT;
177532}

◆ Combine()

SinkCombineResultType duckdb::PhysicalBufferedCollector::Combine ( ExecutionContext & context,
OperatorSinkCombineInput & input ) const
overridevirtual

The combine is called when a single thread has completed execution of its part of the pipeline, it is the final time that a specific LocalSinkState is accessible. This method can be called in parallel while other Sink() or Combine() calls are active on the same GlobalSinkState.

Reimplemented from duckdb::PhysicalOperator.

177535 {
177536 return SinkCombineResultType::FINISHED;
177537}

◆ GetLocalSinkState()

unique_ptr< LocalSinkState > duckdb::PhysicalBufferedCollector::GetLocalSinkState ( ExecutionContext & context) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

177546 {
177547 auto state = make_uniq<BufferedCollectorLocalState>();
177548 return std::move(state);
177549}

◆ GetGlobalSinkState()

unique_ptr< GlobalSinkState > duckdb::PhysicalBufferedCollector::GetGlobalSinkState ( ClientContext & context) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

177539 {
177540 auto state = make_uniq<BufferedCollectorGlobalState>();
177541 state->context = context.shared_from_this();
177542 state->buffered_data = make_shared_ptr<SimpleBufferedData>(context);
177543 return std::move(state);
177544}

◆ ParallelSink()

bool duckdb::PhysicalBufferedCollector::ParallelSink ( ) const
overridevirtual

Reimplemented from duckdb::PhysicalOperator.

177561 {
177562 return parallel;
177563}

◆ SinkOrderDependent()

bool duckdb::PhysicalBufferedCollector::SinkOrderDependent ( ) const
overridevirtual

Whether or not the sink operator depends on the order of the input chunks If this is set to true, we cannot do things like caching intermediate vectors

Reimplemented from duckdb::PhysicalOperator.

177565 {
177566 return true;
177567}

◆ IsStreaming()

bool duckdb::PhysicalBufferedCollector::IsStreaming ( ) const
inlineoverridevirtual

Whether this is a streaming result collector.

Reimplemented from duckdb::PhysicalResultCollector.

177486 {
177487 return true;
177488 }

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