ModErn Text Analysis
META Enumerates Textual Applications
|
Represents a portion of a disk_index's postings file. More...
#include <chunk.h>
Public Member Functions | |
chunk (const std::string &path) | |
bool | operator< (const chunk &other) const |
uint64_t | size () const |
std::string | path () const |
void | merge_with (const chunk &other) |
After this function ends, the current chunk file will contain information from both chunks, and the "other" chunk file will be deleted. More... | |
template<class Container > | |
void | memory_merge_with (Container &pdata) |
Private Member Functions | |
void | set_size () |
Calculates the size of the file this chunk represents in bytes. | |
Private Attributes | |
std::string | path_ |
The path to this chunk file on disk. | |
uint64_t | size_ |
The number of bytes this chunk takes up. | |
Represents a portion of a disk_index's postings file.
It is an intermediate file mapping primary keys to secondary keys. The chunks are sorted to enable efficient merging, and define an operator< to allow them to be sorted or stored in a priority queue.
meta::index::chunk< PrimaryKey, SecondaryKey >::chunk | ( | const std::string & | path | ) |
path | The path to this chunk file on disk |
bool meta::index::chunk< PrimaryKey, SecondaryKey >::operator< | ( | const chunk< PrimaryKey, SecondaryKey > & | other | ) | const |
other | The other chunk to compare with this one |
uint64_t meta::index::chunk< PrimaryKey, SecondaryKey >::size | ( | ) | const |
std::string meta::index::chunk< PrimaryKey, SecondaryKey >::path | ( | ) | const |
void meta::index::chunk< PrimaryKey, SecondaryKey >::merge_with | ( | const chunk< PrimaryKey, SecondaryKey > & | other | ) |
After this function ends, the current chunk file will contain information from both chunks, and the "other" chunk file will be deleted.
other | The other chunk to merge merge_with |
void meta::index::chunk< PrimaryKey, SecondaryKey >::memory_merge_with | ( | Container & | pdata | ) |
pdata | A collection of postings data to combine with this chunk pdata must:
|