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

Public Member Functions

 CSVBuffer (ClientContext &context, idx_t buffer_size_p, CSVFileHandle &file_handle, const idx_t &global_csv_current_position)
 Constructor for Initial Buffer.
 
 CSVBuffer (CSVFileHandle &file_handle, ClientContext &context, idx_t buffer_size, idx_t global_csv_current_position, idx_t buffer_idx)
 Constructor for Next() Buffers.
 
shared_ptr< CSVBufferNext (CSVFileHandle &file_handle, idx_t buffer_size, bool &has_seeked) const
 Creates a new buffer with the next part of the CSV File.
 
idx_t GetBufferSize () const
 Gets the buffer actual size.
 
bool IsCSVFileLastBuffer () const
 If this buffer is the last buffer of the CSV File.
 
void AllocateBuffer (idx_t buffer_size)
 Allocates internal buffer, sets 'block' and 'handle' variables.
 
void Reload (CSVFileHandle &file_handle)
 
shared_ptr< CSVBufferHandlePin (CSVFileHandle &file_handle, bool &has_seeked)
 
void Unpin ()
 Wrapper for unpin.
 
charPtr ()
 
bool IsUnloaded () const
 

Public Attributes

bool last_buffer = false
 

Static Public Attributes

static constexpr idx_t ROWS_PER_BUFFER = 16
 By default, we use CSV_BUFFER_SIZE to allocate each buffer.
 
static constexpr idx_t MIN_ROWS_PER_BUFFER = 4
 

Private Attributes

ClientContextcontext
 
idx_t actual_buffer_size
 Actual size can be smaller than the buffer size in case we allocate it too optimistically.
 
idx_t requested_size
 
idx_t global_csv_start = 0
 Global position from the CSV File where this buffer starts.
 
bool can_seek
 If we can seek in the file or not.
 
bool is_pipe
 If this file is being fed by a pipe.
 
idx_t buffer_idx = 0
 Buffer Index, used as a batch index for insertion-order preservation.
 
shared_ptr< BlockHandleblock
 
BufferHandle handle
 

Detailed Description

CSV Buffers are parts of a decompressed CSV File. For a decompressed file of 100Mb. With our Buffer size set to 32Mb, we would generate 4 buffers. One for the first 32Mb, second and third for the other 32Mb, and the last one with 4 Mb These buffers are actually used for sniffing and parsing!

Member Function Documentation

◆ Pin()

shared_ptr< CSVBufferHandle > duckdb::CSVBuffer::Pin ( CSVFileHandle file_handle,
bool &  has_seeked 
)

Wrapper for the Pin Function, if it can seek, it means that the buffer might have been destroyed, hence we must Scan it from the disk file again.

◆ Ptr()

char * duckdb::CSVBuffer::Ptr ( )
inline
45977 {
45978 return char_ptr_cast(handle.Ptr());
45979 }
data_ptr_t Ptr() const
Returns a pointer to the buffer data. Handle must be valid.
Definition duckdb.hpp:9927

◆ IsUnloaded()

bool duckdb::CSVBuffer::IsUnloaded ( ) const
inline
45980 {
45981 return block->GetMemory().IsUnloaded();
45982 }
shared_ptr< BlockHandle > block
Definition duckdb.hpp:46005

Member Data Documentation

◆ block

shared_ptr<BlockHandle> duckdb::CSVBuffer::block
private

-----— Allocated Block ------—// Block created in allocation


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