Go to the documentation of this file. 1 #ifndef INDEX_VOLATILETREE_VOLATILETREE_H
2 #define INDEX_VOLATILETREE_VOLATILETREE_H
39 std::shared_ptr<VolatileTreeFuncs>
m_funcs;
44 typedef std::multimap<char*, RecordId, VolatileTreeLess>
tree_type;
50 std::shared_ptr<VolatileTreeFuncs>
m_funcs;
67 static std::unique_ptr<VolatileTree>
Create(
68 std::shared_ptr<const IndexDesc> idxdesc);
72 std::shared_ptr<VolatileTreeBase> base);
74 std::shared_ptr<VolatileTreeBase>
m_base;
86 bool upper_isstrict)
override;
88 typedef typename std::decay<
114 const IndexKey *upper,
bool upper_isstrict);
136 #endif // INDEX_VOLATILETREE_VOLATILETREE_H
bool m_is_first
Definition: VolatileTree.h:124
std::shared_ptr< VolatileTreeFuncs > m_funcs
Definition: VolatileTree.h:50
bool InsertKey(const IndexKey *key, RecordId rid) override
Inserts the (key, rid) pair into the index.
Definition: VolatileTree.cpp:160
std::multimap< char *, RecordId, VolatileTreeLess > tree_type
Definition: VolatileTree.h:44
bool Next() override
Moves the iterator to the next indexed item if any.
Definition: VolatileTree.cpp:313
bool DeleteKey(const IndexKey *key, RecordId &rid) override
Deletes any matching key (if rid is invalid), or the matching (key, rid) pair (if rid is valid) from ...
Definition: VolatileTree.cpp:200
void InitVolatileTree()
Initializes the internal state of the in-memory tree index.
Definition: VolatileTree.cpp:71
VolatileTree(std::shared_ptr< const IndexDesc > idxdesc, std::shared_ptr< VolatileTreeBase > base)
Definition: VolatileTree.cpp:150
bool IsAtValidItem() override
Returns whether the iterator is currently at a valid indexed item.
Definition: VolatileTree.cpp:351
bool operator()(char *buf1, char *buf2)
Definition: VolatileTree.cpp:265
std::vector< Datum > m_upper_data_buffer
Definition: VolatileTree.h:122
std::vector< FunctionInfo > m_eq_funcs
Definition: VolatileTree.h:29
virtual ~VolatileTree()
Definition: VolatileTree.cpp:156
std::shared_ptr< VolatileTreeBase > m_base
Definition: VolatileTree.h:74
void CleanVolatileTree()
Cleans up the internal state of the in-memory tree index.
Definition: VolatileTree.cpp:80
VolatileTree::map_iterator m_iter
Definition: VolatileTree.h:116
static std::unique_ptr< VolatileTree > Create(std::shared_ptr< const IndexDesc > idxdesc)
Definition: VolatileTree.cpp:140
Schema m_key_schema
This is a copy of the index's key schema to be used by std::multimap's comparator to dissemble a reco...
Definition: VolatileTree.h:27
A Schema object stores the information for accessing an ordered set of typed fields either from a dis...
Definition: Schema.h:39
The record ID of a record on a page is a pair of ‘(PageNumber, SlotId)’.
Definition: Record.h:17
std::shared_ptr< VolatileTreeFuncs > m_funcs
Definition: VolatileTree.h:39
void EndScan() override
Ends the index scan.
Definition: VolatileTree.h:109
An IndexKey stores references to a few data (Datum objects) that comprise a key tuple to in an index.
Definition: IndexKey.h:35
RecordId & GetRecordId()
Definition: Record.h:131
std::unique_ptr< Index::Iterator > StartScan(const IndexKey *lower, bool lower_isstrict, const IndexKey *upper, bool upper_isstrict) override
Returns a forward-iterator for all the indexed items in the specified range defined by the arguments.
Definition: VolatileTree.cpp:234
VolatileTreeLess(std::shared_ptr< VolatileTreeFuncs > funcs)
Definition: VolatileTree.h:33
VolatileTreeBase::tree_type tree_type
Definition: VolatileTree.h:61
const Record & GetCurrentItem() override
Returns the current indexed item the iterator is currently at, where the GetData() and GetLength() pa...
Definition: VolatileTree.h:99
Definition: VolatileTree.h:42
bool m_upper_isstrict
Definition: VolatileTree.h:126
std::vector< FunctionInfo > m_lt_funcs
Definition: VolatileTree.h:28
Definition: VolatileTree.h:22
tree_type m_tree
Definition: VolatileTree.h:48
Definition: VolatileTree.h:32
An in-memory tree index that is stored only in memory.
Definition: VolatileTree.h:59
Definition: VolatileTree.h:92
std::unique_ptr< IndexKey, AlignedAllocImpl::FreeMem > UniqueIndexKey
The returned smart pointer of IndexKey::Create().
Definition: IndexKey.h:10
RecordId GetCurrentRecordId() override
Returns the record id of the indexed item the iterator is currently at.
Definition: VolatileTree.h:104
VolatileTreeBase(std::shared_ptr< VolatileTreeFuncs > funcs)
Definition: VolatileTree.cpp:84
static void Initialize(const IndexDesc *idxdesc)
Definition: VolatileTree.cpp:90
std::vector< maxaligned_char_buf > m_tuplebufs
Definition: VolatileTree.h:52
Record m_rec
Definition: VolatileTree.h:118
UniqueIndexKey m_upper
Definition: VolatileTree.h:120
A forward-iterator for the items in the index.
Definition: Index.h:180
std::decay< decltype(((VolatileTreeBase *) nullptr) ->m_tree.begin())>::type map_iterator
Definition: VolatileTree.h:90
Definition: IndexDesc.h:11
An interface class for index implementations.
Definition: Index.h:19