support rtree preheat
This commit is contained in:
parent
31e31a63d0
commit
da70b98932
@ -260,6 +260,7 @@ class StaticRTree
|
|||||||
boost::iostreams::mapped_file_source m_objects_region;
|
boost::iostreams::mapped_file_source m_objects_region;
|
||||||
// This is a view of the EdgeDataT data mmap'd from the .fileIndex file
|
// This is a view of the EdgeDataT data mmap'd from the .fileIndex file
|
||||||
util::vector_view<const EdgeDataT> m_objects;
|
util::vector_view<const EdgeDataT> m_objects;
|
||||||
|
EdgeDataT tmp;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StaticRTree() = default;
|
StaticRTree() = default;
|
||||||
@ -462,6 +463,7 @@ class StaticRTree
|
|||||||
: m_coordinate_list(coordinate_list.data(), coordinate_list.size()),
|
: m_coordinate_list(coordinate_list.data(), coordinate_list.size()),
|
||||||
m_objects(mmapFile<EdgeDataT>(on_disk_file_name, m_objects_region))
|
m_objects(mmapFile<EdgeDataT>(on_disk_file_name, m_objects_region))
|
||||||
{
|
{
|
||||||
|
preheat();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -480,6 +482,7 @@ class StaticRTree
|
|||||||
{
|
{
|
||||||
BOOST_ASSERT(m_tree_level_starts.size() >= 2);
|
BOOST_ASSERT(m_tree_level_starts.size() >= 2);
|
||||||
m_objects = mmapFile<EdgeDataT>(on_disk_file_name, m_objects_region);
|
m_objects = mmapFile<EdgeDataT>(on_disk_file_name, m_objects_region);
|
||||||
|
preheat();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns all features inside the bounding box.
|
/* Returns all features inside the bounding box.
|
||||||
@ -761,6 +764,18 @@ class StaticRTree
|
|||||||
return treeindex.level == m_tree_level_starts.size() - 2;
|
return treeindex.level == m_tree_level_starts.size() - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void preheat()
|
||||||
|
{
|
||||||
|
auto iter = m_objects.begin();
|
||||||
|
auto end = m_objects.end();
|
||||||
|
while (iter < end)
|
||||||
|
{
|
||||||
|
tmp = *(iter.get_ptr());
|
||||||
|
// because os's page is unit of 4K
|
||||||
|
iter += LEAF_NODE_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
friend void serialization::read<EdgeDataT, Ownership, BRANCHING_FACTOR, LEAF_PAGE_SIZE>(
|
friend void serialization::read<EdgeDataT, Ownership, BRANCHING_FACTOR, LEAF_PAGE_SIZE>(
|
||||||
storage::tar::FileReader &reader, const std::string &name, StaticRTree &rtree);
|
storage::tar::FileReader &reader, const std::string &name, StaticRTree &rtree);
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ class VectorViewIterator : public boost::iterator_facade<VectorViewIterator<Data
|
|||||||
|
|
||||||
explicit VectorViewIterator() : m_value(nullptr) {}
|
explicit VectorViewIterator() : m_value(nullptr) {}
|
||||||
explicit VectorViewIterator(DataT *x) : m_value(x) {}
|
explicit VectorViewIterator(DataT *x) : m_value(x) {}
|
||||||
|
DataT * get_ptr(){return m_value;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void increment() { ++m_value; }
|
void increment() { ++m_value; }
|
||||||
|
Loading…
Reference in New Issue
Block a user