JODA
0.13.1 (59b41972)
JSON On-Demand Analysis
|
#include <JSONStorage.h>
Public Member Functions | |
virtual | ~JSONStorage () |
void | preparePurge () |
JSONStorage (std::string query_string) | |
void | insertDocumentsQueue (JsonContainerQueue::queue_t *queue) |
void | insertDocumentsQueue (JsonContainerQueue::queue_t *queue, size_t &insertedDocs, size_t &insertedConts) |
void | insertDocuments (moodycamel::ConcurrentQueue< std::unique_ptr< JSONContainer >> &queue, const std::atomic_bool &cf, std::atomic_uint &cs) |
void | insertDocuments (std::unique_ptr< JSONContainer > &&cont) |
void | getDocumentsQueue (JsonContainerRefQueue::queue_t *queue) |
unsigned long | size () const |
unsigned long | contSize () const |
size_t | estimatedSize () const |
size_t | estimatedCapacity () const |
void | freeAllMemory () |
size_t | parsedSize () const |
const std::string & | getName () const |
void | writeFile (const std::string &file) |
void | writeFiles (const std::string &file) |
std::vector< std::string > | stringify (unsigned long start=0, unsigned long end=ULONG_MAX) |
std::vector< std::shared_ptr< RJDocument > > | getRaw (unsigned long start=0, unsigned long end=ULONG_MAX) |
template<class Handler > | |
std::vector< bool > | AcceptDocuments (Handler &handler, unsigned long start=0, unsigned long end=ULONG_MAX) |
const std::string & | getRegtmpdir () const |
unsigned long | getLastUsed () const |
void | addQueryString (const std::string &query_string) |
const std::string & | getQueryString () const |
Protected Member Functions | |
const std::vector< std::unique_ptr< JSONContainer > > & | getContainer () const |
size_t | threadCount (size_t containerSize) const |
std::string | getStorageID () const |
Protected Attributes | |
friend | QueryPlan |
std::string | name |
std::string | regtmpdir |
std::string | query |
std::mutex | documentMutex |
std::vector< std::unique_ptr< JSONContainer > > | container |
unsigned long | docCount = 0 |
Represents a logical collection of JSON documents. They are either permanently named or temporary collections of result documents.
|
virtual |
|
explicit |
|
inline |
Accepts a subset of all documents in the Container with the given handler
handler | The handler to use |
start | The (inclusive) start index of the documents to accept |
start | The (inclusive) end index of the documents to accept |
void JSONStorage::addQueryString | ( | const std::string & | query_string | ) |
Add query strings that resulted in the generation of this storage
query_string | The optimized final query string |
unsigned long JSONStorage::contSize | ( | ) | const |
Returns the number of containers in the collection
size_t JSONStorage::estimatedCapacity | ( | ) | const |
Returns the estimated memory capacity of the collection (in bytes)
size_t JSONStorage::estimatedSize | ( | ) | const |
Returns the estimated memory size of the collection (in bytes)
void JSONStorage::freeAllMemory | ( | ) |
Frees all non-essential memory. This includes all document contents (Metadata required for reparsing is excluded)
|
protected |
void JSONStorage::getDocumentsQueue | ( | JsonContainerRefQueue::queue_t * | queue | ) |
Fills the queue with references to all containers within the JSONStorage
queue | the queue through which the containers are sent |
unsigned long JSONStorage::getLastUsed | ( | ) | const |
Returns a UNIX timestamp showing when the collection was last used.
const std::string & JSONStorage::getName | ( | ) | const |
Returns the name of the JSONStorage. If temporary storage, then a reserved name is returned
const std::string & JSONStorage::getQueryString | ( | ) | const |
Returns the query string that resulted in the creation of this Storage
std::vector< std::shared_ptr< RJDocument > > JSONStorage::getRaw | ( | unsigned long | start = 0 , |
unsigned long | end = ULONG_MAX |
||
) |
Returns the internal content of a range of documents (all by default)
start | The start of the range (inclusive) |
end | The end of the range (inclusive) |
const std::string & JSONStorage::getRegtmpdir | ( | ) | const |
Returns the directory used for temporarily serializing documents
|
protected |
void JSONStorage::insertDocuments | ( | moodycamel::ConcurrentQueue< std::unique_ptr< JSONContainer >> & | queue, |
const std::atomic_bool & | cf, | ||
std::atomic_uint & | cs | ||
) |
Consumes containers from the given queue and inserts them into the JSONStorage
queue | the queue through which the containers arrive |
cf | Flag signalling when insertion is finished |
cs | Counter of remaining containers in the queue |
void JSONStorage::insertDocuments | ( | std::unique_ptr< JSONContainer > && | cont | ) |
Inserts a single container into the JSONStorage
cont | The container to insert |
void JSONStorage::insertDocumentsQueue | ( | JsonContainerQueue::queue_t * | queue | ) |
Consumes documents from the given queue and inserts them into the JSONStorage
queue | the queue through which the documents arrive |
void JSONStorage::insertDocumentsQueue | ( | JsonContainerQueue::queue_t * | queue, |
size_t & | insertedDocs, | ||
size_t & | insertedConts | ||
) |
Consumes documents from the given queue and inserts them into the JSONStorage, while keeping statistics
queue | the queue through which the documents arrive |
insertedDocs | Number of inserted documents, which will be increased by the JSONStorage |
insertedConts | Number of inserted containers, which will be increased by the JSONStorage |
size_t JSONStorage::parsedSize | ( | ) | const |
void JSONStorage::preparePurge | ( | ) |
unsigned long JSONStorage::size | ( | ) | const |
Returns the number of documents in the collection
std::vector< std::string > JSONStorage::stringify | ( | unsigned long | start = 0 , |
unsigned long | end = ULONG_MAX |
||
) |
Stringifies all documents in the specified range (all by default) into a list of strings.
start | The start of the range (inclusive) |
end | The end of the range (inclusive) |
|
protected |
void JSONStorage::writeFile | ( | const std::string & | file | ) |
void JSONStorage::writeFiles | ( | const std::string & | file | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |