Class QueryExecutionTimeoutHelper

java.lang.Object
org.aksw.jena_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 Details

    • QueryExecutionTimeoutHelper

      public QueryExecutionTimeoutHelper(org.apache.jena.query.QueryExecution queryExecution)
  • Method Details

    • 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

      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:
    • getExecutionTime

      public long getExecutionTime()
    • getRetrievalTime

      public long getRetrievalTime()