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

Public Member Functions

 SampleGlobalSinkState (Allocator &allocator, SampleOptions &options)
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
unique_ptr< BlockingSample > sample
 The reservoir sample.
Public Attributes inherited from duckdb::GlobalSinkState
SinkFinalizeType state

Constructor & Destructor Documentation

◆ SampleGlobalSinkState()

duckdb::SampleGlobalSinkState::SampleGlobalSinkState ( Allocator & allocator,
SampleOptions & options )
inlineexplicit
179181 {
179182 if (options.is_percentage) {
179183 auto percentage = options.sample_size.GetValue<double>();
179184 if (percentage == 0) {
179185 return;
179186 }
179187 sample = make_uniq<ReservoirSamplePercentage>(allocator, percentage,
179188 static_cast<int64_t>(options.seed.GetIndex()));
179189 } else {
179190 auto size = NumericCast<idx_t>(options.sample_size.GetValue<int64_t>());
179191 if (size == 0) {
179192 return;
179193 }
179194 sample = make_uniq<ReservoirSample>(allocator, size, static_cast<int64_t>(options.seed.GetIndex()));
179195 }
179196 }
unique_ptr< BlockingSample > sample
The reservoir sample.
Definition duckdb.cpp:179202
GOpaque< Size > size(const GMat &src)
::int64_t int64_t

Member Data Documentation

◆ lock

mutex duckdb::SampleGlobalSinkState::lock

The lock for updating the global aggoregate state Also used to update the global sample when percentages are used


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