ModErn Text Analysis
META Enumerates Textual Applications
Public Types | Public Member Functions | Private Attributes | List of all members
meta::index::postings_file< PrimaryKey, SecondaryKey, FeatureValue > Class Template Reference

File that stores the postings list for an index on disk. More...

#include <postings_file.h>

Public Types

using postings_data_type = postings_data< PrimaryKey, SecondaryKey, FeatureValue >
 

Public Member Functions

 postings_file (const std::string &filename)
 Opens a postings file. More...
 
util::optional< postings_stream< SecondaryKey, FeatureValue > > find_stream (PrimaryKey pk) const
 Obtains a postings stream object for the given primary key. More...
 
std::shared_ptr< postings_data_typefind (PrimaryKey pk) const
 Obtains a postings data object for the given primary key. More...
 

Private Attributes

io::mmap_file postings_
 
util::disk_vector< uint64_t > byte_locations_
 

Detailed Description

template<class PrimaryKey, class SecondaryKey, class FeatureValue = uint64_t>
class meta::index::postings_file< PrimaryKey, SecondaryKey, FeatureValue >

File that stores the postings list for an index on disk.

Each postings list is indexed via PrimaryKey and consists of pairs of (SecondaryKey, double).

Constructor & Destructor Documentation

§ postings_file()

template<class PrimaryKey, class SecondaryKey, class FeatureValue = uint64_t>
meta::index::postings_file< PrimaryKey, SecondaryKey, FeatureValue >::postings_file ( const std::string &  filename)
inline

Opens a postings file.

Parameters
filenameThe path to the file

Member Function Documentation

§ find_stream()

template<class PrimaryKey, class SecondaryKey, class FeatureValue = uint64_t>
util::optional<postings_stream<SecondaryKey, FeatureValue> > meta::index::postings_file< PrimaryKey, SecondaryKey, FeatureValue >::find_stream ( PrimaryKey  pk) const
inline

Obtains a postings stream object for the given primary key.

Parameters
pkThe primary key to look up
Returns
a postings stream for this primary key, if it is in the postings file

§ find()

template<class PrimaryKey, class SecondaryKey, class FeatureValue = uint64_t>
std::shared_ptr<postings_data_type> meta::index::postings_file< PrimaryKey, SecondaryKey, FeatureValue >::find ( PrimaryKey  pk) const
inline

Obtains a postings data object for the given primary key.

Parameters
pkThe primary key to look up
Returns
a shared pointer to the postings data extracted from the file

The documentation for this class was generated from the following file: