Package org.aksw.iguana.cc.worker
Interface Worker
-
- All Superinterfaces:
java.lang.Runnable
- All Known Implementing Classes:
AbstractRandomQueryChooserWorker
,AbstractWorker
,CLIInputFileWorker
,CLIInputPrefixWorker
,CLIInputWorker
,CLIWorker
,HttpGetWorker
,HttpPostWorker
,HttpWorker
,MultipleCLIInputWorker
,SPARQLWorker
,UPDATEWorker
public interface Worker extends java.lang.Runnable
Interface for the Worker Thread used in theStresstest
- Author:
- f.conrads
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
executeQuery(java.lang.String query, java.lang.String queryID)
This method executes a query and adds the results to the Result Processor for proper result and metric calculations.long
getExecutedQueries()
This will return the amount of executed queries so farvoid
getNextQuery(java.lang.StringBuilder queryStr, java.lang.StringBuilder queryID)
This method saves the next query in the queryStr StringBuilder and the query id in the queryID.long
getNoOfQueries()
Returns the no of queries in the queryset of the workerboolean
hasExecutedNoOfQueryMixes(double noOfQueryMixes)
Returns if the no of query mixes were already executedboolean
isTerminated()
java.util.Collection<java.util.Properties>
popQueryResults()
Get and remove all internal stored results of finished queriesvoid
stopSending()
This should stop the next sending process.void
waitTimeMs()
This will simulate the Time in ms to wait before testing the next query.
-
-
-
Method Detail
-
executeQuery
void executeQuery(java.lang.String query, java.lang.String queryID)
This method executes a query and adds the results to the Result Processor for proper result and metric calculations. Note: Some of the Worker implementations employ background threads to process the result of the query. Due to this, this method does not return anything and each implementation of this method must also add the results to Result Processor within this method. This can be done by calling AbstractWorker.addResults(QueryExecutionStats)- Parameters:
query
- The query which should be executedqueryID
- the ID of the query which should be executed
-
getNextQuery
void getNextQuery(java.lang.StringBuilder queryStr, java.lang.StringBuilder queryID) throws java.io.IOException
This method saves the next query in the queryStr StringBuilder and the query id in the queryID.- Parameters:
queryStr
- The query should be stored in here!queryID
- The queryID should be stored in here!- Throws:
java.io.IOException
-
stopSending
void stopSending()
This should stop the next sending process. If an execution started before this method was called, but answered after, it should not be counted!
-
waitTimeMs
void waitTimeMs()
This will simulate the Time in ms to wait before testing the next query. It can be used to simulate network delay.
-
getExecutedQueries
long getExecutedQueries()
This will return the amount of executed queries so far- Returns:
- no. of executed queries
-
popQueryResults
java.util.Collection<java.util.Properties> popQueryResults()
Get and remove all internal stored results of finished queries- Returns:
- list of Properties to send to RabbitMQ
-
isTerminated
boolean isTerminated()
-
getNoOfQueries
long getNoOfQueries()
Returns the no of queries in the queryset of the worker- Returns:
-
hasExecutedNoOfQueryMixes
boolean hasExecutedNoOfQueryMixes(double noOfQueryMixes)
Returns if the no of query mixes were already executed- Parameters:
noOfQueryMixes
-- Returns:
-
-