JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Types | Public Member Functions
SimilarityScheduler< SIM > Class Template Reference

#include <SimilarityScheduler.h>

Public Types

typedef size_t ContainerIdentifier
 

Public Member Functions

 SimilarityScheduler (JsonContainerQueue::queue_t *queue, size_t contSize=0)
 
ContainerIdentifier getContainerForDoc (std::string &raw)
 
ContainerIdentifier getContainerForDoc (const RJDocument &doc)
 
ContainerIdentifier getContainerForDoc (rapidjson::IStreamWrapper &stream)
 
std::unique_ptr< RJDocumentgetNewDoc (ContainerIdentifier id)
 
void scheduleDocument (ContainerIdentifier id, std::unique_ptr< RJDocument > &&doc, std::unique_ptr< IOrigin > &&origin, size_t size)
 
virtual ~SimilarityScheduler ()=default
 
void finalize ()
 

Detailed Description

template<typename SIM>
class SimilarityScheduler< SIM >

A document scheduler based on document similarity. Similar documents are grouped into the same containers.

Template Parameters
SIMThe similarity measure to use.

Member Typedef Documentation

◆ ContainerIdentifier

template<typename SIM >
typedef size_t SimilarityScheduler< SIM >::ContainerIdentifier

Constructor & Destructor Documentation

◆ SimilarityScheduler()

template<typename SIM >
SimilarityScheduler< SIM >::SimilarityScheduler ( JsonContainerQueue::queue_t queue,
size_t  contSize = 0 
)
explicit

Constructs a scheduler for use within the parsers.

Parameters
queueThe container queue to use to pass finalized containers through.
contSizeThe size of newly constructed containers.

◆ ~SimilarityScheduler()

template<typename SIM >
virtual SimilarityScheduler< SIM >::~SimilarityScheduler ( )
virtualdefault

Member Function Documentation

◆ finalize()

template<typename SIM >
void SimilarityScheduler< SIM >::finalize

Finalizes the Scheduler. Has to be called before deconstructing it.

◆ getContainerForDoc() [1/3]

template<typename SIM >
SimilarityScheduler< SIM >::ContainerIdentifier SimilarityScheduler< SIM >::getContainerForDoc ( const RJDocument doc)

Uses the document to get the container in which the document should be stored.

Parameters
docThe document
Returns
An identifier representing the container in which the document will be stored.
Here is the call graph for this function:

◆ getContainerForDoc() [2/3]

template<typename SIM >
SimilarityScheduler< SIM >::ContainerIdentifier SimilarityScheduler< SIM >::getContainerForDoc ( rapidjson::IStreamWrapper &  stream)

Uses the stream of a document to get the container in which the document should be stored.

Parameters
streamThe document in a stream (before parsing)
Returns
An identifier representing the container in which the document will be stored.
Here is the call graph for this function:

◆ getContainerForDoc() [3/3]

template<typename SIM >
SimilarityScheduler< SIM >::ContainerIdentifier SimilarityScheduler< SIM >::getContainerForDoc ( std::string &  raw)

Uses the string representation of a document to get the container in which the document should be stored.

Parameters
rawThe document in string representation (before parsing)
Returns
An identifier representing the container in which the document will be stored.
Here is the call graph for this function:

◆ getNewDoc()

template<typename SIM >
std::unique_ptr< RJDocument > SimilarityScheduler< SIM >::getNewDoc ( ContainerIdentifier  id)

Returns a document initialized with the allocator of the container represented by id

Parameters
idThe id representing the container
Returns
A new document

◆ scheduleDocument()

template<typename SIM >
void SimilarityScheduler< SIM >::scheduleDocument ( ContainerIdentifier  id,
std::unique_ptr< RJDocument > &&  doc,
std::unique_ptr< IOrigin > &&  origin,
size_t  size 
)

Schedules the document into the container given by id.

Parameters
idThe id of the container
docThe document to schedule
originThe origin of the document
sizeThe size of the document (bytes)

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