JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Member Functions | Protected Member Functions | Protected Attributes
FileJoinManager Class Reference

#include <FileJoinManager.h>

Inheritance diagram for FileJoinManager:
[legend]
Collaboration diagram for FileJoinManager:
[legend]

Public Member Functions

 FileJoinManager (const std::string &name, std::unique_ptr< joda::query::IValueProvider > &&valProv)
 
 ~FileJoinManager () override
 
void join (const RapidJsonDocument &doc) override
 
const std::string & getBaseDir () const
 
- Public Member Functions inherited from JoinManager
 JoinManager (std::string name, std::unique_ptr< joda::query::IValueProvider > &&valProv)
 
virtual ~JoinManager ()
 
virtual void join (JSONContainer &cont)
 
virtual const std::string & getName () const
 

Protected Member Functions

bool createFile (const std::string &file, bool val)
 
bool createFile (const std::string &file, long val)
 
bool createFile (const std::string &file, const std::string &val)
 
std::string getFile (JODA_JOINID id)
 
JODA_JOINID getJoinVal (const RJValue &val)
 
bool appendDocToFile (const RapidJsonDocument &doc, const std::string &file)
 

Protected Attributes

std::string baseDir
 
std::mutex mut
 
JODA_JOINID currID = STARTNORMAL_VAL
 
std::unordered_map< long, JODA_JOINIDlMap
 
std::unordered_map< std::string, JODA_JOINIDsMap
 
std::unordered_map< JODA_JOINID, std::mutex > fLock
 
bool trueValCreated = false
 
bool falseValCreated = false
 
- Protected Attributes inherited from JoinManager
std::string name
 
std::unique_ptr< joda::query::IValueProvidervalProv
 

Additional Inherited Members

- Protected Types inherited from JoinManager
enum  JoinVals { NOT_HASHABLE = 0 , FALSE_VAL = 1 , TRUE_VAL = 2 , STARTNORMAL_VAL = 3 }
 

Detailed Description

The FileJoinManager is responsible for joining/grouping documents using files on the filesystem

Constructor & Destructor Documentation

◆ FileJoinManager()

FileJoinManager::FileJoinManager ( const std::string &  name,
std::unique_ptr< joda::query::IValueProvider > &&  valProv 
)

Initializes the FileJoinManager and creates an temporary directory to store temporary files within

Parameters
nameName/Identifier of the join. It is used to create the directory.
valProvThe IValueProvider to receive the join values from.
Here is the call graph for this function:

◆ ~FileJoinManager()

FileJoinManager::~FileJoinManager ( )
override

Deletes the temporary directory created when initializing the class

Here is the call graph for this function:

Member Function Documentation

◆ appendDocToFile()

bool FileJoinManager::appendDocToFile ( const RapidJsonDocument doc,
const std::string &  file 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createFile() [1/3]

bool FileJoinManager::createFile ( const std::string &  file,
bool  val 
)
protected
Here is the caller graph for this function:

◆ createFile() [2/3]

bool FileJoinManager::createFile ( const std::string &  file,
const std::string &  val 
)
protected

◆ createFile() [3/3]

bool FileJoinManager::createFile ( const std::string &  file,
long  val 
)
protected

◆ getBaseDir()

const std::string & FileJoinManager::getBaseDir ( ) const

Returns the temporary directory used fo the joins.

Returns
the temporary directory used fo the joins.
Here is the caller graph for this function:

◆ getFile()

std::string FileJoinManager::getFile ( JODA_JOINID  id)
protected
Here is the caller graph for this function:

◆ getJoinVal()

JODA_JOINID FileJoinManager::getJoinVal ( const RJValue val)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ join()

void FileJoinManager::join ( const RapidJsonDocument doc)
overridevirtual

Joins a single document with the others

Parameters
docThe RapidJsonDocument to join

Implements JoinManager.

Here is the call graph for this function:

Field Documentation

◆ baseDir

std::string FileJoinManager::baseDir
protected

◆ currID

JODA_JOINID FileJoinManager::currID = STARTNORMAL_VAL
protected

◆ falseValCreated

bool FileJoinManager::falseValCreated = false
protected

◆ fLock

std::unordered_map<JODA_JOINID, std::mutex> FileJoinManager::fLock
protected

◆ lMap

std::unordered_map<long, JODA_JOINID> FileJoinManager::lMap
protected

◆ mut

std::mutex FileJoinManager::mut
protected

◆ sMap

std::unordered_map<std::string, JODA_JOINID> FileJoinManager::sMap
protected

◆ trueValCreated

bool FileJoinManager::trueValCreated = false
protected

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