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::ReservoirSamplePercentage Class Reference

The reservoir sample sample_size class maintains a streaming sample of variable size. More...

Inheritance diagram for duckdb::ReservoirSamplePercentage:
Collaboration diagram for duckdb::ReservoirSamplePercentage:

Public Member Functions

 ReservoirSamplePercentage (Allocator &allocator, double percentage, int64_t seed=-1)
 
 ReservoirSamplePercentage (double percentage, int64_t seed, idx_t reservoir_sample_size)
 
 ReservoirSamplePercentage (double percentage, int64_t seed=-1)
 
void AddToReservoir (DataChunk &input) override
 Add a chunk of data to the sample.
 
unique_ptr< BlockingSampleCopy () const override
 
unique_ptr< DataChunkGetChunk () override
 Fetches a chunk from the sample. If destory = true this method is descructive.
 
void Finalize () override
 
void Serialize (Serializer &serializer) const override
 
- Public Member Functions inherited from duckdb::BlockingSample
 BlockingSample (int64_t seed=-1)
 
virtual void Destroy ()
 
std::pair< double, idx_tPopFromWeightQueue ()
 Helper functions needed to merge two reservoirs while respecting weights of sampled rows.
 
double GetMinWeightThreshold ()
 
idx_t GetPriorityQueueSize ()
 
template<class TARGET >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () const
 

Static Public Member Functions

static unique_ptr< BlockingSampleDeserialize (Deserializer &deserializer)
 
- Static Public Member Functions inherited from duckdb::BlockingSample
static unique_ptr< BlockingSampleDeserialize (Deserializer &deserializer)
 

Static Public Attributes

static constexpr const SampleType TYPE = SampleType::RESERVOIR_PERCENTAGE_SAMPLE
 
- Static Public Attributes inherited from duckdb::BlockingSample
static constexpr const SampleType TYPE = SampleType::BLOCKING_SAMPLE
 

Private Attributes

Allocatorallocator
 
double sample_percentage
 The sample_size to sample.
 
idx_t reservoir_sample_size
 The fixed sample size of the sub-reservoirs.
 
unique_ptr< ReservoirSamplecurrent_sample
 The current sample.
 
vector< unique_ptr< ReservoirSample > > finished_samples
 The set of finished samples of the reservoir sample.
 
idx_t current_count = 0
 The amount of tuples that have been processed so far (not put in the reservoir, just processed)
 
bool is_finalized
 

Static Private Attributes

static constexpr idx_t RESERVOIR_THRESHOLD = 100000
 

Additional Inherited Members

- Public Attributes inherited from duckdb::BlockingSample
unique_ptr< BaseReservoirSamplingbase_reservoir_sample
 
SampleType type
 The sample type.
 
bool destroyed
 has the sample been destroyed due to updates to the referenced table
 

Detailed Description

The reservoir sample sample_size class maintains a streaming sample of variable size.

Member Function Documentation

◆ AddToReservoir()

void duckdb::ReservoirSamplePercentage::AddToReservoir ( DataChunk input)
overridevirtual

Add a chunk of data to the sample.

Implements duckdb::BlockingSample.

◆ Copy()

unique_ptr< BlockingSample > duckdb::ReservoirSamplePercentage::Copy ( ) const
overridevirtual

◆ GetChunk()

unique_ptr< DataChunk > duckdb::ReservoirSamplePercentage::GetChunk ( )
overridevirtual

Fetches a chunk from the sample. If destory = true this method is descructive.

Implements duckdb::BlockingSample.

◆ Finalize()

void duckdb::ReservoirSamplePercentage::Finalize ( )
overridevirtual

◆ Serialize()

void duckdb::ReservoirSamplePercentage::Serialize ( Serializer serializer) const
overridevirtual

Reimplemented from duckdb::BlockingSample.

Member Data Documentation

◆ is_finalized

bool duckdb::ReservoirSamplePercentage::is_finalized
private

Whether or not the stream is finalized. The stream is automatically finalized on the first call to GetChunkAndShrink();


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