Package org.aksw.iguana.cc.worker.impl
Class SPARQLProtocolWorker
java.lang.Object
org.aksw.iguana.cc.worker.HttpWorker
org.aksw.iguana.cc.worker.impl.SPARQLProtocolWorker
-
Nested Class Summary
Nested classes/interfaces inherited from class org.aksw.iguana.cc.worker.HttpWorker
HttpWorker.CompletionTarget, HttpWorker.ExecutionStats, HttpWorker.QueryMixes, HttpWorker.Result, HttpWorker.TimeLimit
-
Field Summary
Fields inherited from class org.aksw.iguana.cc.worker.HttpWorker
config, querySelector, workerID
-
Constructor Summary
ConstructorDescriptionSPARQLProtocolWorker
(long workerId, ResponseBodyProcessor responseBodyProcessor, SPARQLProtocolWorker.Config config) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Closes the http client and the connection manager.config()
static void
initHttpClient
(int threadCount) Initializes the http client with the given thread count.start()
Starts the worker and returns a CompletableFuture, which will be completed, when the worker has finished the completion target.toString()
Methods inherited from class org.aksw.iguana.cc.worker.HttpWorker
basicAuth, getWorkerID
-
Constructor Details
-
SPARQLProtocolWorker
public SPARQLProtocolWorker(long workerId, ResponseBodyProcessor responseBodyProcessor, SPARQLProtocolWorker.Config config)
-
-
Method Details
-
config
- Overrides:
config
in classHttpWorker
-
initHttpClient
public static void initHttpClient(int threadCount) Initializes the http client with the given thread count. All workers will use the same http client instance.- Parameters:
threadCount
- the number of threads to be used by the http client
-
closeHttpClient
public static void closeHttpClient()Closes the http client and the connection manager. -
start
Starts the worker and returns a CompletableFuture, which will be completed, when the worker has finished the completion target. The CompletableFuture will contain a Result object, which contains the execution stats of the worker. The execution stats contain the execution time, the http status code, the content length and the hash of the response body. If the worker failed to execute a query, the execution stats will contain an exception. If the worker failed to execute a query, because of a set time limit in the worker configuration, the result of that execution will be discarded.- Specified by:
start
in classHttpWorker
- Returns:
- the CompletableFuture the contains the results of the worker.
-
toString
-