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::CachedFile Struct Reference

Cached files. More...

Collaboration diagram for duckdb::ExternalFileCache::CachedFile:

Public Member Functions

 CachedFile (string path_p)
void Verify (const unique_ptr< StorageLockKey > &guard) const
 Verifies that none of the ranges fully overlap (must hold the lock).
bool IsValid (const unique_ptr< StorageLockKey > &guard, bool validate, const string &current_version_tag, timestamp_t current_last_modified)
 Whether the CachedFile is still valid given the current modified/version tag.
idx_t & FileSize (const unique_ptr< StorageLockKey > &guard)
 Get reference to properties (must hold the lock).
timestamp_t & LastModified (const unique_ptr< StorageLockKey > &guard)
string & VersionTag (const unique_ptr< StorageLockKey > &guard)
bool & CanSeek (const unique_ptr< StorageLockKey > &guard)
bool & OnDiskFile (const unique_ptr< StorageLockKey > &guard)
map< idx_t, shared_ptr< CachedFileRange > > & Ranges (const unique_ptr< StorageLockKey > &guard)

Public Attributes

const string path
StorageLock lock

Private Attributes

map< idx_t, shared_ptr< CachedFileRange > > ranges
idx_t file_size
timestamp_t last_modified
string version_tag
bool can_seek
bool on_disk_file

Detailed Description

Cached files.

Constructor & Destructor Documentation

◆ CachedFile()

duckdb::ExternalFileCache::CachedFile::CachedFile ( string path_p)
explicit
413293 : path(std::move(path_p)), file_size(0), last_modified(0), can_seek(false), on_disk_file(false) {
413294}

Member Function Documentation

◆ Verify()

void duckdb::ExternalFileCache::CachedFile::Verify ( const unique_ptr< StorageLockKey > & guard) const

Verifies that none of the ranges fully overlap (must hold the lock).

413296 {
413297#ifdef DEBUG
413298 for (const auto &range1 : ranges) {
413299 for (const auto &range2 : ranges) {
413300 if (range1.first == range2.first) {
413301 continue;
413302 }
413303 D_ASSERT(range1.second->GetOverlap(*range2.second) != CachedFileRangeOverlap::FULL);
413304 }
413305 }
413306#endif
413307}

◆ IsValid()

bool duckdb::ExternalFileCache::CachedFile::IsValid ( const unique_ptr< StorageLockKey > & guard,
bool validate,
const string & current_version_tag,
timestamp_t current_last_modified )

Whether the CachedFile is still valid given the current modified/version tag.

413332 {
413333 if (!validate) {
413334 return true; // Assume valid
413335 }
413336 return ExternalFileCache::IsValid(validate, VersionTag(guard), LastModified(guard), current_version_tag,
413337 current_last_modified);
413338}

◆ FileSize()

idx_t & duckdb::ExternalFileCache::CachedFile::FileSize ( const unique_ptr< StorageLockKey > & guard)

Get reference to properties (must hold the lock).

413340 {
413341 return file_size;
413342}

◆ LastModified()

timestamp_t & duckdb::ExternalFileCache::CachedFile::LastModified ( const unique_ptr< StorageLockKey > & guard)
413344 {
413345 return last_modified;
413346}

◆ VersionTag()

string & duckdb::ExternalFileCache::CachedFile::VersionTag ( const unique_ptr< StorageLockKey > & guard)
413348 {
413349 return version_tag;
413350}

◆ CanSeek()

bool & duckdb::ExternalFileCache::CachedFile::CanSeek ( const unique_ptr< StorageLockKey > & guard)
413352 {
413353 return can_seek;
413354}

◆ OnDiskFile()

bool & duckdb::ExternalFileCache::CachedFile::OnDiskFile ( const unique_ptr< StorageLockKey > & guard)
413356 {
413357 return on_disk_file;
413358}

◆ Ranges()

map< idx_t, shared_ptr< ExternalFileCache::CachedFileRange > > & duckdb::ExternalFileCache::CachedFile::Ranges ( const unique_ptr< StorageLockKey > & guard)
413361 {
413362 return ranges;
413363}

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