Cached reads (immutable).
More...
Cached reads (immutable).
◆ CachedFileRange()
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}
◆ 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}
◆ 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
◆ 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: