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

#include <QueryThread.h>

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

Public Types

typedef IPayload ContRef
 
typedef OPayload OwnedCont
 
- Public Types inherited from IWorkerThread< JsonContainerRefQueue, JsonContainerQueue, QueryThreadConfig >
typedef IQueueStruct::queue_t IQueue
 
typedef OQueueStruct::queue_t OQueue
 
typedef IQueueStruct::payload_t IPayload
 
typedef OQueueStruct::payload_t OPayload
 
typedef QueryThreadConfig WConf
 

Public Member Functions

 QueryThread (IQueue *iqueue, OQueue *oqueue, WConf &conf)
 
 ~QueryThread () override
 
const std::string getThreadID () const
 
bool hasAggregators () const
 
- Public Member Functions inherited from IWorkerThread< JsonContainerRefQueue, JsonContainerQueue, QueryThreadConfig >
 IWorkerThread (IQueue *iqueue, OQueue *oqueue, const WConf &conf)
 
 IWorkerThread (IQueue *iqueue, OQueue *oqueue, WConf &&conf)
 
 IWorkerThread (IWorkerThread &&)=default
 
 IWorkerThread (const IWorkerThread &)=delete
 
IWorkerThreadoperator= (IWorkerThread &&)=default
 
IWorkerThreadoperator= (const IWorkerThread &)=delete
 
virtual ~IWorkerThread ()
 
void start ()
 
void waitFor ()
 
void stop ()
 
bool requestedToStop () const
 
bool isRunning () const
 

Protected Member Functions

bool hasToProject () const
 
bool canCreateView () const
 
std::shared_ptr< const DocIndexselect (JSONContainer &cont) const
 
std::vector< std::unique_ptr< RJDocument > > defaultProject (JSONContainer &cont, const DocIndex &ids, RJMemoryPoolAlloc &alloc) const
 
void aggregate (const std::vector< RapidJsonDocument > &docs) const
 
void aggregate (ContRef pipelineCont, const std::shared_ptr< const DocIndex > &selectResult, bool isSelected) const
 
void work () override
 
void logTimers () const
 

Protected Attributes

RecurringTimer bloom_timer
 
RecurringTimer select_timer
 
RecurringTimer project_timer
 
RecurringTimer aggregate_timer
 
RecurringTimer copy_timer
 
RecurringTimer serialize_timer
 
RecurringTimer sample_view_cost_timer
 
- Protected Attributes inherited from IWorkerThread< JsonContainerRefQueue, JsonContainerQueue, QueryThreadConfig >
IQueueiqueue
 
OQueueoqueue
 
WConf conf
 
bool shouldRun
 

Additional Inherited Members

- Static Public Member Functions inherited from IWorkerThread< JsonContainerRefQueue, JsonContainerQueue, QueryThreadConfig >
static constexpr auto getIQueueFlags ()
 
static constexpr auto getOQueueFlags ()
 
static const size_t recommendedThreads ()
 

Detailed Description

The QueryThread class is responsible for actually executing a Query on one or multiple containers. It reads containers from an input queue, executes the query on each container read and then writes the output container to an output queue.

Member Typedef Documentation

◆ ContRef

◆ OwnedCont

Constructor & Destructor Documentation

◆ QueryThread()

QueryThread::QueryThread ( IQueue iqueue,
OQueue oqueue,
WConf conf 
)

Initializes a new QueryThread

Here is the call graph for this function:

◆ ~QueryThread()

QueryThread::~QueryThread ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ aggregate() [1/2]

void QueryThread::aggregate ( const std::vector< RapidJsonDocument > &  docs) const
protected

Aggregates the given list of documents. The results are stored in the aggregator classed within the config objects

Parameters
docsThe documents to aggregate
Here is the caller graph for this function:

◆ aggregate() [2/2]

void QueryThread::aggregate ( QueryThread::ContRef  pipelineCont,
const std::shared_ptr< const DocIndex > &  selectResult,
bool  isSelected 
) const
protected

Aggregates all documents within the container. The results are stored in the aggregator classed within the config objects

Parameters
pipelineContThe container having the documents
selectResultThe index showing which documents have to be aggregated
isSelectedflag dictating if selectResult should be used or not.

◆ canCreateView()

bool QueryThread::canCreateView ( ) const
protected
Here is the caller graph for this function:

◆ defaultProject()

std::vector< std::unique_ptr< RJDocument > > QueryThread::defaultProject ( JSONContainer cont,
const DocIndex ids,
RJMemoryPoolAlloc alloc 
) const
protected

Transforms the the selected documents in the given container

Parameters
contThe container to perform the projection on
idsA DocIndex containing information on which documents are to be projected
allocAn allocator to use for projection. This reduces memory consumption and runtime required by many allocation operations
Returns
A list of all documents obtained by transforming the input documents
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getThreadID()

const std::string QueryThread::getThreadID ( ) const

Returns a unique ID identifying this querythread

Returns
Here is the caller graph for this function:

◆ hasAggregators()

bool QueryThread::hasAggregators ( ) const

Checks whether aggregations have to be performed

Returns
true if yes, false if not
Here is the caller graph for this function:

◆ hasToProject()

bool QueryThread::hasToProject ( ) const
protected
Here is the caller graph for this function:

◆ logTimers()

void QueryThread::logTimers ( ) const
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ select()

std::shared_ptr< const DocIndex > QueryThread::select ( JSONContainer cont) const
protected

Selects the documents adhering to he filter (CHOOSE) step in the query.

Parameters
contThe container to perform the selection on
Returns
A DocIndex containing information on which documents are selected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ work()

void QueryThread::work ( )
overrideprotectedvirtual

Implements IWorkerThread< JsonContainerRefQueue, JsonContainerQueue, QueryThreadConfig >.

Here is the call graph for this function:

Field Documentation

◆ aggregate_timer

RecurringTimer QueryThread::aggregate_timer
protected

◆ bloom_timer

RecurringTimer QueryThread::bloom_timer
protected

◆ copy_timer

RecurringTimer QueryThread::copy_timer
protected

◆ project_timer

RecurringTimer QueryThread::project_timer
protected

◆ sample_view_cost_timer

RecurringTimer QueryThread::sample_view_cost_timer
protected

◆ select_timer

RecurringTimer QueryThread::select_timer
protected

◆ serialize_timer

RecurringTimer QueryThread::serialize_timer
protected

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