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::SegmentTree< T, SUPPORTS_LAZY_LOADING > Class Template Reference
Collaboration diagram for duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >:

Classes

class  BaseSegmentIterator
 
class  SegmentIterationHelper
 
class  SegmentNodeIterationHelper
 

Public Member Functions

 SegmentTree (idx_t base_row_id=0)
 
SegmentLock Lock () const
 
bool IsEmpty (SegmentLock &l) const
 
optional_ptr< SegmentNode< T > > GetRootSegment () const
 Gets a pointer to the first segment. Useful for scans.
 
optional_ptr< SegmentNode< T > > GetRootSegment (SegmentLock &l) const
 
vector< unique_ptr< SegmentNode< T > > > MoveSegments (SegmentLock &l)
 Obtains ownership of the data of the segment tree.
 
vector< unique_ptr< SegmentNode< T > > > MoveSegments ()
 
vector< unique_ptr< SegmentNode< T > > > & ReferenceLoadedSegmentsMutable (SegmentLock &l)
 
idx_t GetSegmentCount () const
 
idx_t GetSegmentCount (SegmentLock &l) const
 
optional_ptr< SegmentNode< T > > GetSegmentByIndex (int64_t index) const
 Gets a pointer to the nth segment. Negative numbers start from the back.
 
optional_ptr< SegmentNode< T > > GetSegmentByIndex (SegmentLock &l, int64_t index) const
 
optional_ptr< SegmentNode< T > > GetNextSegment (SegmentNode< T > &node) const
 Gets the next segment.
 
optional_ptr< SegmentNode< T > > GetNextSegment (SegmentLock &l, SegmentNode< T > &node) const
 
optional_ptr< SegmentNode< T > > GetLastSegment (SegmentLock &l) const
 Gets a pointer to the last segment. Useful for appends.
 
optional_ptr< SegmentNode< T > > GetSegment (idx_t row_number) const
 Gets a pointer to a specific column segment for the given row.
 
optional_ptr< SegmentNode< T > > GetSegment (SegmentLock &l, idx_t row_number) const
 
void AppendSegment (shared_ptr< T > segment)
 
void AppendSegment (SegmentLock &l, shared_ptr< T > segment)
 
void AppendSegment (SegmentLock &l, shared_ptr< T > segment, idx_t row_start)
 
bool HasSegment (SegmentNode< T > &segment) const
 Debug method, check whether the segment is in the segment tree.
 
bool HasSegment (SegmentLock &, SegmentNode< T > &segment) const
 
void EraseSegments (SegmentLock &l, idx_t segment_start)
 Erase all segments after a specific segment.
 
idx_t GetSegmentIndex (SegmentLock &l, idx_t row_number) const
 Get the segment index of the column segment for the given row.
 
bool TryGetSegmentIndex (SegmentLock &l, idx_t row_number, idx_t &result) const
 
void Verify (SegmentLock &) const
 
void Verify ()
 
idx_t GetBaseRowId () const
 
SegmentIterationHelper Segments () const
 
SegmentIterationHelper Segments (SegmentLock &l) const
 
SegmentNodeIterationHelper SegmentNodes () const
 
SegmentNodeIterationHelper SegmentNodes (SegmentLock &l) const
 

Protected Member Functions

virtual shared_ptr< T > LoadSegment () const
 Load the next segment - only used when lazily loading.
 
optional_ptr< SegmentNode< T > > GetRootSegmentInternal () const
 

Protected Attributes

atomic< bool > finished_loading
 

Private Member Functions

bool LoadNextSegment (SegmentLock &l) const
 Load the next segment, if there are any left to load.
 
void LoadAllSegments (SegmentLock &l) const
 Load all segments, if there are any left to load.
 
void AppendSegmentInternal (SegmentLock &l, shared_ptr< T > segment, idx_t row_start) const
 Append a column segment to the tree.
 
void AppendSegmentInternal (SegmentLock &l, shared_ptr< T > segment) const
 

Private Attributes

vector< unique_ptr< SegmentNode< T > > > nodes
 The nodes in the tree, can be binary searched.
 
mutex node_lock
 Lock to access or modify the nodes.
 
idx_t base_row_id
 Base row id (row id of the first segment)
 

Detailed Description

template<class T, bool SUPPORTS_LAZY_LOADING = false>
class duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >

The SegmentTree maintains a list of all segments of a specific column in a table, and allows searching for a segment by row number

Constructor & Destructor Documentation

◆ SegmentTree()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::SegmentTree ( idx_t  base_row_id = 0)
inlineexplicit
23597 : finished_loading(true), base_row_id(base_row_id) {
23598 }
idx_t base_row_id
Base row id (row id of the first segment)
Definition duckdb.hpp:23841

◆ ~SegmentTree()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
virtual duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::~SegmentTree ( )
inlinevirtual
23599 {
23600 }

Member Function Documentation

◆ Lock()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
SegmentLock duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::Lock ( ) const
inline

Locks the segment tree. All methods to the segment tree either lock the segment tree, or take an already obtained lock.

23604 {
23605 return SegmentLock(node_lock);
23606 }
mutex node_lock
Lock to access or modify the nodes.
Definition duckdb.hpp:23839
Here is the caller graph for this function:

◆ IsEmpty()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
bool duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::IsEmpty ( SegmentLock l) const
inline
23608 {
23609 return GetRootSegment(l) == nullptr;
23610 }
optional_ptr< SegmentNode< T > > GetRootSegment() const
Gets a pointer to the first segment. Useful for scans.
Definition duckdb.hpp:23613

◆ GetRootSegment() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetRootSegment ( ) const
inline

Gets a pointer to the first segment. Useful for scans.

23613 {
23614 auto l = Lock();
23615 return GetRootSegment(l);
23616 }
SegmentLock Lock() const
Definition duckdb.hpp:23604
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRootSegment() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetRootSegment ( SegmentLock l) const
inline
23618 {
23619 if (nodes.empty()) {
23620 LoadNextSegment(l);
23621 }
23622 return GetRootSegmentInternal();
23623 }
vector< unique_ptr< SegmentNode< T > > > nodes
The nodes in the tree, can be binary searched.
Definition duckdb.hpp:23837
bool LoadNextSegment(SegmentLock &l) const
Load the next segment, if there are any left to load.
Definition duckdb.hpp:23936

◆ MoveSegments() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
vector< unique_ptr< SegmentNode< T > > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::MoveSegments ( SegmentLock l)
inline

Obtains ownership of the data of the segment tree.

23625 {
23626 LoadAllSegments(l);
23627 return std::move(nodes);
23628 }
void LoadAllSegments(SegmentLock &l) const
Load all segments, if there are any left to load.
Definition duckdb.hpp:23952
Here is the call graph for this function:

◆ MoveSegments() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
vector< unique_ptr< SegmentNode< T > > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::MoveSegments ( )
inline
23629 {
23630 auto l = Lock();
23631 return MoveSegments(l);
23632 }
vector< unique_ptr< SegmentNode< T > > > MoveSegments(SegmentLock &l)
Obtains ownership of the data of the segment tree.
Definition duckdb.hpp:23625

◆ ReferenceLoadedSegmentsMutable()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
vector< unique_ptr< SegmentNode< T > > > & duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::ReferenceLoadedSegmentsMutable ( SegmentLock l)
inline
23634 {
23635 return nodes;
23636 }

◆ GetSegmentCount() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
idx_t duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegmentCount ( ) const
inline
23638 {
23639 auto l = Lock();
23640 return GetSegmentCount(l);
23641 }

◆ GetSegmentCount() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
idx_t duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegmentCount ( SegmentLock l) const
inline
23642 {
23643 LoadAllSegments(l);
23644 return nodes.size();
23645 }

◆ GetSegmentByIndex() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegmentByIndex ( int64_t  index) const
inline

Gets a pointer to the nth segment. Negative numbers start from the back.

23647 {
23648 auto l = Lock();
23649 return GetSegmentByIndex(l, index);
23650 }
optional_ptr< SegmentNode< T > > GetSegmentByIndex(int64_t index) const
Gets a pointer to the nth segment. Negative numbers start from the back.
Definition duckdb.hpp:23647
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSegmentByIndex() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegmentByIndex ( SegmentLock l,
int64_t  index 
) const
inline
23651 {
23652 if (index < 0) {
23653 // load all segments
23654 LoadAllSegments(l);
23655 index += nodes.size();
23656 if (index < 0) {
23657 return nullptr;
23658 }
23659 return nodes[UnsafeNumericCast<idx_t>(index)].get();
23660 } else {
23661 // lazily load segments until we reach the specific segment
23662 while (idx_t(index) >= nodes.size() && LoadNextSegment(l)) {
23663 }
23664 if (idx_t(index) >= nodes.size()) {
23665 return nullptr;
23666 }
23667 return nodes[UnsafeNumericCast<idx_t>(index)].get();
23668 }
23669 }
index
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ GetNextSegment() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetNextSegment ( SegmentNode< T > &  node) const
inline

Gets the next segment.

23671 {
23672 if (!SUPPORTS_LAZY_LOADING) {
23673 return node.Next();
23674 }
23675 if (finished_loading) {
23676 return node.Next();
23677 }
23678 auto l = Lock();
23679 return GetNextSegment(l, node);
23680 }
optional_ptr< SegmentNode< T > > GetNextSegment(SegmentNode< T > &node) const
Gets the next segment.
Definition duckdb.hpp:23671
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNextSegment() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetNextSegment ( SegmentLock l,
SegmentNode< T > &  node 
) const
inline
23681 {
23682#ifdef DEBUG
23683 D_ASSERT(RefersToSameObject(*nodes[node.GetIndex()], node));
23684#endif
23685 return GetSegmentByIndex(l, UnsafeNumericCast<int64_t>(node.GetIndex() + 1));
23686 }
bool RefersToSameObject(const reference< T > &a, const reference< T > &b)
Returns whether or not two reference wrappers refer to the same object.
Definition duckdb.hpp:2191

◆ GetLastSegment()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetLastSegment ( SegmentLock l) const
inline

Gets a pointer to the last segment. Useful for appends.

23689 {
23690 LoadAllSegments(l);
23691 if (nodes.empty()) {
23692 return nullptr;
23693 }
23694 return nodes.back().get();
23695 }
Here is the call graph for this function:

◆ GetSegment() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegment ( idx_t  row_number) const
inline

Gets a pointer to a specific column segment for the given row.

23697 {
23698 auto l = Lock();
23699 return GetSegment(l, row_number);
23700 }
optional_ptr< SegmentNode< T > > GetSegment(idx_t row_number) const
Gets a pointer to a specific column segment for the given row.
Definition duckdb.hpp:23697
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSegment() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegment ( SegmentLock l,
idx_t  row_number 
) const
inline
23701 {
23702 return nodes[GetSegmentIndex(l, row_number)].get();
23703 }
idx_t GetSegmentIndex(SegmentLock &l, idx_t row_number) const
Get the segment index of the column segment for the given row.
Definition duckdb.hpp:23737

◆ AppendSegment() [1/3]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::AppendSegment ( shared_ptr< T >  segment)
inline
23705 {
23706 auto l = Lock();
23707 AppendSegment(l, std::move(segment));
23708 }

◆ AppendSegment() [2/3]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::AppendSegment ( SegmentLock l,
shared_ptr< T >  segment 
)
inline
23709 {
23710 LoadAllSegments(l);
23711 AppendSegmentInternal(l, std::move(segment));
23712 }
void AppendSegmentInternal(SegmentLock &l, shared_ptr< T > segment, idx_t row_start) const
Append a column segment to the tree.
Definition duckdb.hpp:23961

◆ AppendSegment() [3/3]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::AppendSegment ( SegmentLock l,
shared_ptr< T >  segment,
idx_t  row_start 
)
inline
23713 {
23714 LoadAllSegments(l);
23715 AppendSegmentInternal(l, std::move(segment), row_start);
23716 }

◆ HasSegment() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
bool duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::HasSegment ( SegmentNode< T > &  segment) const
inline

Debug method, check whether the segment is in the segment tree.

23718 {
23719 auto l = Lock();
23720 return HasSegment(l, segment);
23721 }
bool HasSegment(SegmentNode< T > &segment) const
Debug method, check whether the segment is in the segment tree.
Definition duckdb.hpp:23718
Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasSegment() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
bool duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::HasSegment ( SegmentLock ,
SegmentNode< T > &  segment 
) const
inline
23722 {
23723 auto segment_idx = segment.GetIndex();
23724 return segment_idx < nodes.size() && RefersToSameObject(*nodes[segment_idx], segment);
23725 }

◆ EraseSegments()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::EraseSegments ( SegmentLock l,
idx_t  segment_start 
)
inline

Erase all segments after a specific segment.

23728 {
23729 LoadAllSegments(l);
23730 if (segment_start >= nodes.size()) {
23731 return;
23732 }
23733 nodes.erase(nodes.begin() + UnsafeNumericCast<int64_t>(segment_start), nodes.end());
23734 }
Here is the call graph for this function:

◆ GetSegmentIndex()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
idx_t duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetSegmentIndex ( SegmentLock l,
idx_t  row_number 
) const
inline

Get the segment index of the column segment for the given row.

23737 {
23738 idx_t segment_index;
23739 if (TryGetSegmentIndex(l, row_number, segment_index)) {
23740 return segment_index;
23741 }
23742 string error;
23743 error = StringUtil::Format("Attempting to find row number \"%lld\" in %lld nodes\n", row_number, nodes.size());
23744 for (idx_t i = 0; i < nodes.size(); i++) {
23745 error += StringUtil::Format("* Node %lld: Start %lld, Count %lld\n", i, nodes[i]->GetRowStart(),
23746 nodes[i]->GetCount());
23747 }
23748 throw InternalException("Could not find node in column segment tree!\n%s", error);
23749 }
static string Format(const string fmt_str, ARGS... params)
Format a string using printf semantics.
Definition duckdb.hpp:4002
void error(int _code, const String &_err, const char *_func, const char *_file, int _line)
Here is the call graph for this function:

◆ TryGetSegmentIndex()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
bool duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::TryGetSegmentIndex ( SegmentLock l,
idx_t  row_number,
idx_t result 
) const
inline
23751 {
23752 // load segments until the row number is within bounds
23753 while (nodes.empty() || (row_number >= nodes.back()->GetRowEnd())) {
23754 if (!LoadNextSegment(l)) {
23755 break;
23756 }
23757 }
23758 if (nodes.empty()) {
23759 return false;
23760 }
23761 idx_t lower = 0;
23762 idx_t upper = nodes.size() - 1;
23763 // binary search to find the node
23764 while (lower <= upper) {
23765 idx_t index = (lower + upper) / 2;
23766 if (index >= nodes.size()) {
23767 string segments;
23768 for (auto &entry : nodes) {
23769 segments += StringUtil::Format("Start %d Count %d", entry->GetRowStart(), entry->GetCount());
23770 }
23771 throw InternalException("Segment tree index not found for row number %d\nSegments:%s", row_number,
23772 segments);
23773 }
23774 auto &entry = *nodes[index];
23775 if (row_number < entry.GetRowStart()) {
23776 upper = index - 1;
23777 } else if (row_number >= entry.GetRowEnd()) {
23778 lower = index + 1;
23779 } else {
23780 result = index;
23781 return true;
23782 }
23783 }
23784 return false;
23785 }

◆ Verify() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::Verify ( SegmentLock ) const
inline
23787 {
23788#ifdef DEBUG
23789 idx_t base_start = nodes.empty() ? 0 : nodes[0]->GetRowStart();
23790 for (idx_t i = 0; i < nodes.size(); i++) {
23791 D_ASSERT(nodes[i]->GetRowStart() == base_start);
23792 base_start += nodes[i]->GetCount();
23793 }
23794#endif
23795 }

◆ Verify() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::Verify ( )
inline
23796 {
23797#ifdef DEBUG
23798 auto l = Lock();
23799 Verify(l);
23800#endif
23801 }

◆ GetBaseRowId()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
idx_t duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetBaseRowId ( ) const
inline
23803 {
23804 return base_row_id;
23805 }

◆ Segments() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
SegmentIterationHelper duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::Segments ( ) const
inline
23807 {
23808 return SegmentIterationHelper(*this);
23809 }

◆ Segments() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
SegmentIterationHelper duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::Segments ( SegmentLock l) const
inline
23811 {
23812 return SegmentIterationHelper(*this, l);
23813 }

◆ SegmentNodes() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
SegmentNodeIterationHelper duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::SegmentNodes ( ) const
inline
23815 {
23816 return SegmentNodeIterationHelper(*this);
23817 }

◆ SegmentNodes() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
SegmentNodeIterationHelper duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::SegmentNodes ( SegmentLock l) const
inline
23819 {
23820 return SegmentNodeIterationHelper(*this, l);
23821 }

◆ LoadSegment()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
virtual shared_ptr< T > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::LoadSegment ( ) const
inlineprotectedvirtual

Load the next segment - only used when lazily loading.

Reimplemented in duckdb::RowGroupSegmentTree.

23827 {
23828 return nullptr;
23829 }
Here is the caller graph for this function:

◆ GetRootSegmentInternal()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
optional_ptr< SegmentNode< T > > duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::GetRootSegmentInternal ( ) const
inlineprotected
23831 {
23832 return nodes.empty() ? nullptr : nodes[0].get();
23833 }

◆ LoadNextSegment()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
bool duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::LoadNextSegment ( SegmentLock l) const
inlineprivate

Load the next segment, if there are any left to load.

23936 {
23937 if (!SUPPORTS_LAZY_LOADING) {
23938 return false;
23939 }
23940 if (finished_loading) {
23941 return false;
23942 }
23943 auto result = LoadSegment();
23944 if (result) {
23945 AppendSegmentInternal(l, std::move(result));
23946 return true;
23947 }
23948 return false;
23949 }
virtual shared_ptr< T > LoadSegment() const
Load the next segment - only used when lazily loading.
Definition duckdb.hpp:23827
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadAllSegments()

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::LoadAllSegments ( SegmentLock l) const
inlineprivate

Load all segments, if there are any left to load.

23952 {
23953 if (!SUPPORTS_LAZY_LOADING) {
23954 return;
23955 }
23956 while (LoadNextSegment(l)) {
23957 }
23958 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AppendSegmentInternal() [1/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::AppendSegmentInternal ( SegmentLock l,
shared_ptr< T >  segment,
idx_t  row_start 
) const
inlineprivate

Append a column segment to the tree.

23961 {
23962 D_ASSERT(segment);
23963 // add the node to the list of nodes
23964 auto node = make_uniq<SegmentNode<T>>(row_start, std::move(segment), nodes.size());
23965 if (!nodes.empty()) {
23966 nodes.back()->SetNext(*node);
23967 }
23968 nodes.push_back(std::move(node));
23969 }
Here is the caller graph for this function:

◆ AppendSegmentInternal() [2/2]

template<class T , bool SUPPORTS_LAZY_LOADING = false>
void duckdb::SegmentTree< T, SUPPORTS_LAZY_LOADING >::AppendSegmentInternal ( SegmentLock l,
shared_ptr< T >  segment 
) const
inlineprivate
23970 {
23971 idx_t row_start;
23972 if (nodes.empty()) {
23973 row_start = base_row_id;
23974 } else {
23975 auto &last_node = nodes.back();
23976 row_start = last_node->GetRowEnd();
23977 }
23978 AppendSegmentInternal(l, std::move(segment), row_start);
23979 }

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