#include <PostlistBuilder.hpp>
Public Types | |
typedef boost::shared_ptr < PostlistBuilder > | SharedPointer |
Public Member Functions | |
PostlistBuilder () | |
~PostlistBuilder () | |
void | append (const ByteBuffer &value) throw (std::runtime_error) |
Iterator::SharedPointer | build () |
void | clear () |
bool | empty () const |
size_t | length () const |
void | set_checksum (uint16_t checksum) |
Private Types | |
typedef std::vector< ByteBuffer > | ValueVector |
typedef Iterator::SizeVector | SizeVector |
typedef Iterator::Header | Header |
Private Member Functions | |
void | swap_out_values_ () throw (std::runtime_error) |
bool | has_page_file_ () const |
Private Attributes | |
Header | header_ |
ValueVector | values_ |
SizeVector * | vsizes_ |
size_t | memory_ |
FILE * | page_ |
A class to build postlists by appending entries.
Created on Jun 22, 2008
Definition at line 25 of file PostlistBuilder.hpp.
typedef Iterator::Header aitools::invertedindex::PostlistBuilder::Header [private] |
Definition at line 35 of file PostlistBuilder.hpp.
typedef boost::shared_ptr<PostlistBuilder> aitools::invertedindex::PostlistBuilder::SharedPointer |
Definition at line 29 of file PostlistBuilder.hpp.
typedef Iterator::SizeVector aitools::invertedindex::PostlistBuilder::SizeVector [private] |
Definition at line 34 of file PostlistBuilder.hpp.
typedef std::vector<ByteBuffer> aitools::invertedindex::PostlistBuilder::ValueVector [private] |
Definition at line 33 of file PostlistBuilder.hpp.
aitools::invertedindex::PostlistBuilder::PostlistBuilder | ( | ) |
The explicit constructor.
Definition at line 8 of file PostlistBuilder.cpp.
aitools::invertedindex::PostlistBuilder::~PostlistBuilder | ( | ) |
The destructor.
Definition at line 14 of file PostlistBuilder.cpp.
References aitools::util::fclose(), has_page_file_(), page_, and vsizes_.
void aitools::invertedindex::PostlistBuilder::append | ( | const ByteBuffer & | value | ) | throw (std::runtime_error) |
Definition at line 24 of file PostlistBuilder.cpp.
References aitools::invertedindex::System::fwrite(), and aitools::invertedindex::Iterator::max_chunk_size.
Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::ExternalMergeSort::merge(), aitools::invertedindex::InternalIntroSort::sort(), and write_postlist().
Iterator::SharedPointer aitools::invertedindex::PostlistBuilder::build | ( | ) |
Definition at line 53 of file PostlistBuilder.cpp.
References clear(), aitools::invertedindex::ByteBuffer::data(), has_page_file_(), header_, page_, aitools::invertedindex::Iterator::Header::payload, aitools::util::rewind(), aitools::invertedindex::Iterator::Header::value_size, values_, and vsizes_.
Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::ExternalMergeSort::merge(), aitools::invertedindex::InternalIntroSort::sort(), and write_postlist().
void aitools::invertedindex::PostlistBuilder::clear | ( | ) |
Definition at line 87 of file PostlistBuilder.cpp.
References aitools::util::fclose(), has_page_file_(), header_, memory_, page_, values_, and vsizes_.
Referenced by build().
bool aitools::invertedindex::PostlistBuilder::empty | ( | ) | const |
Definition at line 101 of file PostlistBuilder.cpp.
References header_, and aitools::invertedindex::Iterator::Header::value_count.
Referenced by BOOST_AUTO_TEST_CASE().
bool aitools::invertedindex::PostlistBuilder::has_page_file_ | ( | ) | const [private] |
Definition at line 132 of file PostlistBuilder.cpp.
References page_.
Referenced by build(), clear(), and ~PostlistBuilder().
size_t aitools::invertedindex::PostlistBuilder::length | ( | ) | const |
Definition at line 107 of file PostlistBuilder.cpp.
References header_, and aitools::invertedindex::Iterator::Header::value_count.
Referenced by BOOST_AUTO_TEST_CASE().
void aitools::invertedindex::PostlistBuilder::set_checksum | ( | uint16_t | checksum | ) |
Definition at line 113 of file PostlistBuilder.cpp.
References aitools::invertedindex::Iterator::Header::checksum, and header_.
Referenced by BOOST_AUTO_TEST_CASE(), aitools::invertedindex::ExternalMergeSort::merge(), and aitools::invertedindex::InternalIntroSort::sort().
void aitools::invertedindex::PostlistBuilder::swap_out_values_ | ( | ) | throw (std::runtime_error) [private] |
Definition at line 119 of file PostlistBuilder.cpp.
References aitools::util::fwrite(), memory_, page_, aitools::util::tmpfile(), and values_.
Definition at line 70 of file PostlistBuilder.hpp.
Referenced by build(), clear(), empty(), length(), and set_checksum().
size_t aitools::invertedindex::PostlistBuilder::memory_ [private] |
Definition at line 73 of file PostlistBuilder.hpp.
Referenced by clear(), and swap_out_values_().
FILE* aitools::invertedindex::PostlistBuilder::page_ [private] |
Definition at line 74 of file PostlistBuilder.hpp.
Referenced by build(), clear(), has_page_file_(), swap_out_values_(), and ~PostlistBuilder().
Definition at line 71 of file PostlistBuilder.hpp.
Referenced by build(), clear(), and swap_out_values_().
Definition at line 72 of file PostlistBuilder.hpp.
Referenced by build(), clear(), and ~PostlistBuilder().