Package org.aksw.iguana.cc.worker.impl
Class UPDATEWorker
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Runnable
,Worker
@Shorthand("UPDATEWorker") public class UPDATEWorker extends HttpPostWorker
A Worker using SPARQL Updates to create service request.- Author:
- f.conrads
-
-
Constructor Summary
Constructors Constructor Description UPDATEWorker(java.lang.String taskID, Connection connection, java.lang.String queriesFile, java.lang.String timerStrategy, java.lang.Integer timeOut, java.lang.Integer timeLimit, java.lang.Integer fixedLatency, java.lang.Integer gaussianLatency, java.lang.Integer workerID)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addResults(QueryExecutionStats results)
void
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.boolean
hasExecutedNoOfQueryMixes(double noOfQueryMixes)
Checks if one queryMix was already executed, as it does not matter how many mixes should be executedvoid
setQueriesList(java.io.File[] updateFiles)
Sets the Query Instances repr.void
startWorker()
This will start the worker.void
waitTimeMs()
This will simulate the Time in ms to wait before testing the next query.-
Methods inherited from class org.aksw.iguana.cc.worker.impl.HttpPostWorker
executeQuery
-
Methods inherited from class org.aksw.iguana.cc.worker.impl.HttpWorker
getProcessedResults, shutdownResultProcessor
-
Methods inherited from class org.aksw.iguana.cc.worker.AbstractWorker
getExecutedQueries, getNoOfQueries, getQueriesFileName, isTerminated, popQueryResults, run, stopSending
-
-
-
-
Constructor Detail
-
UPDATEWorker
public UPDATEWorker(java.lang.String taskID, Connection connection, java.lang.String queriesFile, @Nullable java.lang.String timerStrategy, @Nullable java.lang.Integer timeOut, @Nullable java.lang.Integer timeLimit, @Nullable java.lang.Integer fixedLatency, @Nullable java.lang.Integer gaussianLatency, java.lang.Integer workerID)
-
-
Method Detail
-
startWorker
public void startWorker()
Description copied from class:AbstractWorker
This will start the worker. It will get the next query, wait as long as it should wait before executing the next query, then it will test the query and send it if not aborted yet to the ResultProcessor Module- Overrides:
startWorker
in classAbstractWorker
-
waitTimeMs
public void waitTimeMs()
Description copied from interface:Worker
This will simulate the Time in ms to wait before testing the next query. It can be used to simulate network delay.- Specified by:
waitTimeMs
in interfaceWorker
- Overrides:
waitTimeMs
in classAbstractWorker
-
addResults
public void addResults(QueryExecutionStats results)
- Overrides:
addResults
in classAbstractWorker
-
getNextQuery
public void getNextQuery(java.lang.StringBuilder queryStr, java.lang.StringBuilder queryID) throws java.io.IOException
Description copied from interface:Worker
This method saves the next query in the queryStr StringBuilder and the query id in the queryID.- Specified by:
getNextQuery
in interfaceWorker
- Overrides:
getNextQuery
in classAbstractRandomQueryChooserWorker
- Parameters:
queryStr
- The query should be stored in here!queryID
- The queryID should be stored in here!- Throws:
java.io.IOException
-
setQueriesList
public void setQueriesList(java.io.File[] updateFiles)
Description copied from class:AbstractWorker
Sets the Query Instances repr. in Files.- Overrides:
setQueriesList
in classAbstractRandomQueryChooserWorker
- Parameters:
updateFiles
- File containing the query instances.
-
hasExecutedNoOfQueryMixes
public boolean hasExecutedNoOfQueryMixes(double noOfQueryMixes)
Checks if one queryMix was already executed, as it does not matter how many mixes should be executed- Specified by:
hasExecutedNoOfQueryMixes
in interfaceWorker
- Overrides:
hasExecutedNoOfQueryMixes
in classAbstractWorker
- Parameters:
noOfQueryMixes
-- Returns:
-
-