org.aksw.commons.sparql.api.core
Class QueryExecutionTimeoutHelper

java.lang.Object
  extended by org.aksw.commons.sparql.api.core.QueryExecutionTimeoutHelper

public class QueryExecutionTimeoutHelper
extends Object

Author:
Claus Stadler

Date: 11/19/11 Time: 10:17 PM

A helper for timeouts on QueryExecutions:

Setting maxExecution time will result in a call to queryExecution.abort() after the time limit is reached.

Setting max retrievalTime will result in a call to queryExecution.close() after the time limit has been reached.


Constructor Summary
QueryExecutionTimeoutHelper(com.hp.hpl.jena.query.QueryExecution queryExecution)
           
 
Method Summary
 void setTimeout(long timeout)
          Set time, in milliseconds
 void setTimeout(long timeout1, long timeout2)
          Set time, in milliseconds
 void setTimeout(long timeout, TimeUnit timeoutUnits)
          Set a timeout on the query execution.
 void setTimeout(long timeout1, TimeUnit timeUnit1, long timeout2, TimeUnit timeUnit2)
          Set timeouts on the query execution; the first timeout refers to time to first result, the second refers to overall query execution after the first result.
 void startExecutionTimer()
           
 void startRetrieval()
           
 void stopExecutionTimer()
           
 void stopRetrieval()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryExecutionTimeoutHelper

public QueryExecutionTimeoutHelper(com.hp.hpl.jena.query.QueryExecution queryExecution)
Method Detail

startExecutionTimer

public void startExecutionTimer()

stopExecutionTimer

public void stopExecutionTimer()

startRetrieval

public void startRetrieval()

stopRetrieval

public void stopRetrieval()

setTimeout

public void setTimeout(long timeout,
                       TimeUnit timeoutUnits)
Set a timeout on the query execution. Processing will be aborted after the timeout (which starts when the approprate exec call is made). Not all query execution systems support timeouts. A timeout of less than zero means no timeout.


setTimeout

public void setTimeout(long timeout)
Set time, in milliseconds

See Also:
setTimeout(long, java.util.concurrent.TimeUnit)

setTimeout

public void setTimeout(long timeout1,
                       TimeUnit timeUnit1,
                       long timeout2,
                       TimeUnit timeUnit2)
Set timeouts on the query execution; the first timeout refers to time to first result, the second refers to overall query execution after the first result. Processing will be aborted if a timeout expires. Not all query execution systems support timeouts. A timeout of less than zero means no timeout; this can be used for timeout1 or timeout2.


setTimeout

public void setTimeout(long timeout1,
                       long timeout2)
Set time, in milliseconds

See Also:
setTimeout(long, java.util.concurrent.TimeUnit, long, java.util.concurrent.TimeUnit)


Copyright © 2012. All Rights Reserved.