JASSv2
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
JASS::serialise_integers Class Reference

Serialise an index in integer dump format. More...

#include <serialise_integers.h>

Inheritance diagram for JASS::serialise_integers:
Inheritance graph
[legend]
Collaboration diagram for JASS::serialise_integers:
Collaboration graph
[legend]

Public Member Functions

 serialise_integers (size_t documents_in_collection)
 << the impact-ordered postings list More...
 
void finish (void)
 
virtual void operator() (const slice &term, const index_postings &postings, compress_integer::integer document_frequency, compress_integer::integer *document_ids, index_postings_impact::impact_type *term_frequencies)
 The callback function to serialise the postings (given the term) is operator(). More...
 
virtual void operator() (size_t document_id, const slice &primary_key)
 The callback function to serialise the primary keys (external document ids) is operator(). More...
 
- Public Member Functions inherited from JASS::index_manager::delegate
 delegate (size_t documents)
 Destructor.
 
virtual ~delegate ()
 Destructor.
 

Static Public Member Functions

static void unittest_one_collection (const std::string &document_collection, uint32_t expected_checksum)
 Validate over a single collection - JASS_assert on failure. More...
 
static void unittest (void)
 Unit test this class.
 

Private Attributes

file postings_file
 The postings file.
 
allocator_pool memory
 Memory used to store the impact-ordered postings list.
 
index_postings_impact impact_ordered
 

Additional Inherited Members

- Public Attributes inherited from JASS::index_manager::delegate
size_t documents
 The number of documents in the collection.
 

Detailed Description

Serialise an index in integer dump format.

Serialise just the postings lists (without the vocabulary) as a bunch of 4-byte integers (in Intel byte order). The exact format is: <length> The number of integers in the list <docid> The document identifier The final index file is, therefore of the form: <length><docid>...<docid> <length><docid>...<docid> <length><docid>...<docid> For as many impact segments are there are in the collection.

Constructor & Destructor Documentation

◆ serialise_integers()

JASS::serialise_integers::serialise_integers ( size_t  documents_in_collection)
inline

<< the impact-ordered postings list

Constructor

Parameters
documents_in_collection[in] The number of documents in the collection

Member Function Documentation

◆ finish()

void JASS::serialise_integers::finish ( void  )
inlinevirtual

Do any final cleaning up

Implements JASS::index_manager::delegate.

◆ operator()() [1/2]

void JASS::serialise_integers::operator() ( const slice term,
const index_postings postings,
compress_integer::integer  document_frequency,
compress_integer::integer document_ids,
index_postings_impact::impact_type term_frequencies 
)
virtual

The callback function to serialise the postings (given the term) is operator().

Parameters
term[in] The term name.
postings[in] The postings lists.
document_frequency[in] The document frequency of the term
document_ids[in] An array (of length document_frequency) of document ids.
term_frequencies[in] An array (of length document_frequency) of term frequencies (corresponding to document_ids).

Implements JASS::index_manager::delegate.

◆ operator()() [2/2]

virtual void JASS::serialise_integers::operator() ( size_t  document_id,
const slice primary_key 
)
inlinevirtual

The callback function to serialise the primary keys (external document ids) is operator().

Parameters
document_id[in] The internal document identfier.
primary_key[in] This document's primary key (external document identifier).

Implements JASS::index_manager::delegate.

◆ unittest_one_collection()

void JASS::serialise_integers::unittest_one_collection ( const std::string &  document_collection,
uint32_t  expected_checksum 
)
static

Validate over a single collection - JASS_assert on failure.

Parameters
document_collection[in] the collection to validate over
expected_checksum[in] The expected checksum

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