JODA
0.13.1 (59b41972)
JSON On-Demand Analysis
|
#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< RJDocument > | getNewDoc (ContainerIdentifier id) |
void | scheduleDocument (ContainerIdentifier id, std::unique_ptr< RJDocument > &&doc, std::unique_ptr< IOrigin > &&origin, size_t size) |
virtual | ~SimilarityScheduler ()=default |
void | finalize () |
A document scheduler based on document similarity. Similar documents are grouped into the same containers.
SIM | The similarity measure to use. |
typedef size_t SimilarityScheduler< SIM >::ContainerIdentifier |
|
explicit |
Constructs a scheduler for use within the parsers.
queue | The container queue to use to pass finalized containers through. |
contSize | The size of newly constructed containers. |
|
virtualdefault |
void SimilarityScheduler< SIM >::finalize |
Finalizes the Scheduler. Has to be called before deconstructing it.
SimilarityScheduler< SIM >::ContainerIdentifier SimilarityScheduler< SIM >::getContainerForDoc | ( | const RJDocument & | doc | ) |
Uses the document to get the container in which the document should be stored.
doc | The document |
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.
stream | The document in a stream (before parsing) |
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.
raw | The document in string representation (before parsing) |
std::unique_ptr< RJDocument > SimilarityScheduler< SIM >::getNewDoc | ( | ContainerIdentifier | id | ) |
Returns a document initialized with the allocator of the container represented by id
id | The id representing the container |
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.
id | The id of the container |
doc | The document to schedule |
origin | The origin of the document |
size | The size of the document (bytes) |