|
| enum class | Slot : uint8_t { SEGMENT
, OVERFLOW_0
, OVERFLOW_1
} |
◆ Slot
| enum class duckdb::ZSTDCompressionBufferCollection::Slot : uint8_t |
|
strong |
406879:
uint8_t { SEGMENT, OVERFLOW_0, OVERFLOW_1 };
◆ GetCurrentId()
| page_id_t duckdb::ZSTDCompressionBufferCollection::GetCurrentId |
( |
| ) |
const |
|
inline |
406895 {
406896#ifdef DEBUG
406897 if (!buffer_index.IsValid() || buffer_index == 0) {
406898 D_ASSERT(
block_id == INVALID_BLOCK);
406899 } else {
406900 D_ASSERT(
block_id != INVALID_BLOCK);
406901 }
406902#endif
406904 }
block_id_t block_id
Definition duckdb.cpp:407006
◆ SetCurrentBuffer()
| void duckdb::ZSTDCompressionBufferCollection::SetCurrentBuffer |
( |
Slot | slot, |
|
|
page_offset_t | offset = 0 ) |
|
inline |
406907 {
406909 switch (slot) {
406910 case Slot::SEGMENT:
406912 break;
406913 case Slot::OVERFLOW_0:
406915 break;
406916 case Slot::OVERFLOW_1:
406918 break;
406919 default:
406920 throw InternalException("ZSTDCompressionBufferCollection::Slot value not handled");
406921 };
406922 buffer_index =
index;
406924 }
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
ZSTDCompressionBufferState buffer_states[3]
Definition duckdb.cpp:407017
◆ GetCurrentOffset()
| page_offset_t & duckdb::ZSTDCompressionBufferCollection::GetCurrentOffset |
( |
| ) |
|
|
inline |
406925 {
406926 if (!buffer_index.IsValid()) {
406927 throw InternalException(
406928 "(ZSTDCompressionBufferCollection::GetCurrentOffset) Can't get BufferHandle, no buffer set yet!");
406929 }
406930 auto index = buffer_index.GetIndex();
406932 return offset;
406933 }
◆ AlignCurrentOffset()
| void duckdb::ZSTDCompressionBufferCollection::AlignCurrentOffset |
( |
| ) |
|
|
inline |
406934 {
406935 auto &offset = GetCurrentOffset();
406936 offset = UnsafeNumericCast<page_offset_t>(
406937 AlignValue<
idx_t,
sizeof(string_length_t)>(UnsafeNumericCast<idx_t>(offset)));
406938 }
static T AlignValue(T n)
Align value (ceiling) (not for pointer types).
Definition duckdb.hpp:2126
◆ BufferHandleMutable()
| BufferHandle & duckdb::ZSTDCompressionBufferCollection::BufferHandleMutable |
( |
| ) |
|
|
inline |
406939 {
406940 if (!buffer_index.IsValid()) {
406941 throw InternalException(
406942 "(ZSTDCompressionBufferCollection::BufferHandleMutable) Can't get BufferHandle, no buffer set yet!");
406943 }
406944 auto index = buffer_index.GetIndex();
406945 if (index == 0) {
406946 return segment_handle;
406947 }
406948 D_ASSERT(index < 3);
406949 return extra_pages[
index - 1];
406950 }
◆ GetBufferData()
| vector< BufferData > duckdb::ZSTDCompressionBufferCollection::GetBufferData |
( |
bool | include_segment | ) |
|
|
inline |
406951 {
406952 vector<BufferData> res;
406953 for (
idx_t i = 0; i < 3; i++) {
406954 if (!i) {
406955 if (include_segment) {
406956 res.emplace_back(segment_handle,
buffer_states[i], Slot::SEGMENT);
406957 }
406958 continue;
406959 }
406960 res.emplace_back(extra_pages[i - 1],
buffer_states[i], i == 1 ? Slot::OVERFLOW_0 : Slot::OVERFLOW_1);
406961 }
406962 return res;
406963 }
◆ GetCurrentBufferPtr()
| data_ptr_t duckdb::ZSTDCompressionBufferCollection::GetCurrentBufferPtr |
( |
| ) |
|
|
inline |
406964 {
406965 if (!buffer_index.IsValid()) {
406966 throw InternalException(
406967 "(ZSTDCompressionBufferCollection::GetCurrentBufferPtr) Can't get BufferHandle, no buffer set yet!");
406968 }
406969 auto index = buffer_index.GetIndex();
406971 return BufferHandleMutable().Ptr() + state.offset;
406972 }
◆ CanFlush()
| bool duckdb::ZSTDCompressionBufferCollection::CanFlush |
( |
| ) |
const |
|
inline |
Can't flush the segment buffer
406973 {
406974 if (!buffer_index.IsValid()) {
406975 throw InternalException(
406976 "(ZSTDCompressionBufferCollection::CanFlush) Can't determine CanFlush, no buffer set yet!");
406977 }
406978 auto index = buffer_index.GetIndex();
406979 if (index == 0) {
406981 return false;
406982 }
406984 return !flags.HasVectorMetadata() && !flags.HasStringMetadata();
406985 }
◆ GetCurrentFlags()
406986 {
406987 return GetCurrentBufferState().flags;
406988 }
◆ GetCurrentBufferState()
406989 {
406990 if (!buffer_index.IsValid()) {
406991 throw InternalException(
406992 "(ZSTDCompressionBufferCollection::GetCurrentBufferState) Can't get BufferState, no buffer set yet!");
406993 }
406995 }
◆ IsOnSegmentBuffer()
| bool duckdb::ZSTDCompressionBufferCollection::IsOnSegmentBuffer |
( |
| ) |
const |
|
inline |
406996 {
406997 if (!buffer_index.IsValid()) {
406998 return false;
406999 }
407000 return buffer_index.GetIndex() == 0;
407001 }
◆ block_id
| block_id_t duckdb::ZSTDCompressionBufferCollection::block_id = INVALID_BLOCK |
Current block-id of the overflow page we're writing NOTE: INVALID_BLOCK means we haven't spilled to an overflow page yet
◆ buffer_states
0: segment_handle 1: extra_pages[0]; 2: extra_pages[1];
The documentation for this struct was generated from the following file: