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::ExternalFileCache::CachedFileRange Struct Reference

Cached reads (immutable). More...

Collaboration diagram for duckdb::ExternalFileCache::CachedFileRange:

Public Member Functions

 CachedFileRange (shared_ptr< BlockHandle > block_handle, idx_t nr_bytes, idx_t location, string version_tag)
CachedFileRangeOverlap GetOverlap (idx_t other_nr_bytes, idx_t other_location) const
 Gets the overlap between this file range and another.
CachedFileRangeOverlap GetOverlap (const CachedFileRange &other) const
void AddCheckSum ()
 Computes/verifies checksum over the buffer to ensure data was not modified (used for Verification only).
void VerifyCheckSum ()

Public Attributes

shared_ptr< BlockHandle > block_handle
const idx_t nr_bytes
const idx_t location
const string version_tag

Detailed Description

Cached reads (immutable).

Constructor & Destructor Documentation

◆ CachedFileRange()

duckdb::ExternalFileCache::CachedFileRange::CachedFileRange ( shared_ptr< BlockHandle > block_handle,
idx_t nr_bytes,
idx_t location,
string version_tag )
413245 : block_handle(std::move(block_handle_p)), nr_bytes(nr_bytes_p), location(location_p),
413246 version_tag(std::move(version_tag_p)) {
413247}

◆ ~CachedFileRange()

duckdb::ExternalFileCache::CachedFileRange::~CachedFileRange ( )
413249 {
413250 VerifyCheckSum();
413251}

Member Function Documentation

◆ GetOverlap() [1/2]

ExternalFileCache::CachedFileRangeOverlap duckdb::ExternalFileCache::CachedFileRange::GetOverlap ( idx_t other_nr_bytes,
idx_t other_location ) const

Gets the overlap between this file range and another.

413254 {
413255 const auto this_end = this->location + this->nr_bytes;
413256 const auto other_end = other_nr_bytes + other_location;
413257 if (this->location <= other_location && this_end >= other_end) {
413258 return CachedFileRangeOverlap::FULL;
413259 }
413260 if (this->location < other_end && other_location < this_end) {
413261 return CachedFileRangeOverlap::PARTIAL;
413262 }
413263 return CachedFileRangeOverlap::NONE;
413264}
Here is the caller graph for this function:

◆ GetOverlap() [2/2]

ExternalFileCache::CachedFileRangeOverlap duckdb::ExternalFileCache::CachedFileRange::GetOverlap ( const CachedFileRange & other) const
413267 {
413268 return GetOverlap(other.nr_bytes, other.location);
413269}
CachedFileRangeOverlap GetOverlap(idx_t other_nr_bytes, idx_t other_location) const
Gets the overlap between this file range and another.
Definition duckdb.cpp:413254

◆ AddCheckSum()

void duckdb::ExternalFileCache::CachedFileRange::AddCheckSum ( )

Computes/verifies checksum over the buffer to ensure data was not modified (used for Verification only).

413271 {
413272#ifdef DEBUG
413273 D_ASSERT(checksum == 0);
413274 auto buffer_handle = block_handle->GetMemory().GetBufferManager().Pin(block_handle);
413275 checksum = Checksum(buffer_handle.Ptr(), nr_bytes);
413276#endif
413277}
uint64_t Checksum(uint8_t *buffer, size_t size)
Compute a checksum over a buffer of size size.
Definition duckdb.cpp:49970
Here is the call graph for this function:

◆ VerifyCheckSum()

void duckdb::ExternalFileCache::CachedFileRange::VerifyCheckSum ( )
413279 {
413280#ifdef DEBUG
413281 if (checksum == 0) {
413282 return;
413283 }
413284 auto buffer_handle = block_handle->GetMemory().GetBufferManager().Pin(block_handle);
413285 if (!buffer_handle.IsValid()) {
413286 return;
413287 }
413288 D_ASSERT(checksum == Checksum(buffer_handle.Ptr(), nr_bytes));
413289#endif
413290}

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