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<
89 decltype(std::declval<VolatileTreeBase>().m_tree.begin())>::type
114 const IndexKey *upper,
bool upper_isstrict);
Definition: IndexDesc.h:11
A forward-iterator for the items in the index.
Definition: Index.h:181
An interface class for index implementations.
Definition: Index.h:19
RecordId & GetRecordId()
Definition: Record.h:131
A Schema object stores the information for accessing an ordered set of typed fields either from a dis...
Definition: Schema.h:39
Definition: VolatileTree.h:92
bool Next() override
Moves the iterator to the next indexed item if any.
Definition: VolatileTree.cpp:313
UniqueIndexKey m_upper
Definition: VolatileTree.h:120
void EndScan() override
Ends the index scan.
Definition: VolatileTree.h:109
RecordId GetCurrentRecordId() override
Returns the record id of the indexed item the iterator is currently at.
Definition: VolatileTree.h:104
bool IsAtValidItem() override
Returns whether the iterator is currently at a valid indexed item.
Definition: VolatileTree.cpp:351
std::vector< Datum > m_upper_data_buffer
Definition: VolatileTree.h:122
Record m_rec
Definition: VolatileTree.h:118
bool m_is_first
Definition: VolatileTree.h:124
VolatileTree::map_iterator m_iter
Definition: VolatileTree.h:116
bool m_upper_isstrict
Definition: VolatileTree.h:126
const Record & GetCurrentItem() override
Returns the current indexed item the iterator is currently at, where the GetData() and GetLength() pa...
Definition: VolatileTree.h:99
An in-memory tree index that is stored only in memory.
Definition: VolatileTree.h:59
virtual ~VolatileTree()
Definition: VolatileTree.cpp:156
std::decay< decltype(std::declval< VolatileTreeBase >).m_tree.begin())>::type map_iterator
Definition: VolatileTree.h:90
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
bool InsertKey(const IndexKey *key, RecordId rid) override
Inserts the (key, rid) pair into the index.
Definition: VolatileTree.cpp:160
std::shared_ptr< VolatileTreeBase > m_base
Definition: VolatileTree.h:74
VolatileTree(std::shared_ptr< const IndexDesc > idxdesc, std::shared_ptr< VolatileTreeBase > base)
Definition: VolatileTree.cpp:150
VolatileTreeBase::tree_type tree_type
Definition: VolatileTree.h:61
static void Initialize(const IndexDesc *idxdesc)
Definition: VolatileTree.cpp:90
bool DeleteKey(const IndexKey *key, RecordId &rid) override
Deletes an arbitrary data entry with matching key if rid is invalid.
Definition: VolatileTree.cpp:200
static std::unique_ptr< VolatileTree > Create(std::shared_ptr< const IndexDesc > idxdesc)
Definition: VolatileTree.cpp:140
void InitVolatileTree()
Initializes the internal state of the in-memory tree index.
Definition: VolatileTree.cpp:71
void CleanVolatileTree()
Cleans up the internal state of the in-memory tree index.
Definition: VolatileTree.cpp:80
std::unique_ptr< IndexKey, AlignedAllocImpl::FreeMem > UniqueIndexKey
The returned smart pointer of IndexKey::Create().
Definition: IndexKey.h:10
An IndexKey stores references to a few data (Datum objects) that comprise a key tuple to in an index.
Definition: IndexKey.h:35
The record ID of a record on a page is a pair of ‘(PageNumber, SlotId)’.
Definition: Record.h:17
Definition: VolatileTree.h:42
tree_type m_tree
Definition: VolatileTree.h:48
std::vector< maxaligned_char_buf > m_tuplebufs
Definition: VolatileTree.h:52
VolatileTreeBase(std::shared_ptr< VolatileTreeFuncs > funcs)
Definition: VolatileTree.cpp:84
std::multimap< char *, RecordId, VolatileTreeLess > tree_type
Definition: VolatileTree.h:44
std::shared_ptr< VolatileTreeFuncs > m_funcs
Definition: VolatileTree.h:50
Definition: VolatileTree.h:22
std::vector< FunctionInfo > m_eq_funcs
Definition: VolatileTree.h:29
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
std::vector< FunctionInfo > m_lt_funcs
Definition: VolatileTree.h:28
Definition: VolatileTree.h:32
VolatileTreeLess(std::shared_ptr< VolatileTreeFuncs > funcs)
Definition: VolatileTree.h:33
bool operator()(char *buf1, char *buf2) const
Definition: VolatileTree.cpp:265
std::shared_ptr< VolatileTreeFuncs > m_funcs
Definition: VolatileTree.h:39