Class QueryInfo
java.lang.Object
org.eclipse.rdf4j.federated.structures.QueryInfo
Structure to maintain query information during evaluation, is attached to algebra nodes. Each instance is uniquely
attached to the query.
The queryId can be used to abort tasks belonging to a particular evaluation.
- Author:
- Andreas Schwarte
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected static final AtomicInteger
protected Set
<ParallelTask<?>> -
Constructor Summary
ConstructorDescriptionQueryInfo
(String query, String baseURI, QueryType queryType, int maxExecutionTime, boolean includeInferred, FederationContext federationContext, FederationEvalStrategy strategy, Dataset dataset) QueryInfo
(Resource subj, IRI pred, Value obj, int maxExecutionTime, boolean includeInferred, FederationContext federationContext, FederationEvalStrategy strategy, Dataset dataset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Mark the query as aborted and abort all scheduled (future) tasks known at this point in time.protected void
Abort any scheduled future tasksvoid
close()
Close this query.boolean
boolean
long
getQuery()
Returns aTupleQueryResultHandler
if this query is executed using.int
hashCode()
void
registerScheduledTask
(ParallelTask<?> task) Register a new scheduled task for this query.void
setResultHandler
(TupleQueryResultHandler resultHandler) Set theTupleQueryResultHandler
if the query is executed usingTupleQuery.evaluate(TupleQueryResultHandler)
allowing for passing through results to the handler.
-
Field Details
-
NEXT_QUERY_ID
-
done
protected boolean done -
scheduledSubtasks
-
-
Constructor Details
-
QueryInfo
public QueryInfo(String query, String baseURI, QueryType queryType, int maxExecutionTime, boolean includeInferred, FederationContext federationContext, FederationEvalStrategy strategy, Dataset dataset) - Parameters:
query
-queryType
-maxExecutionTime
- the maximum explicit query time in seconds, if 0 useFedXConfig.getEnforceMaxQueryTime()
includeInferred
- whether to include inferred statementsfederationContext
- theFederationContext
dataset
- theDataset
-
QueryInfo
public QueryInfo(Resource subj, IRI pred, Value obj, int maxExecutionTime, boolean includeInferred, FederationContext federationContext, FederationEvalStrategy strategy, Dataset dataset)
-
-
Method Details
-
getQueryID
-
getQuery
-
getQueryType
-
getIncludeInferred
public boolean getIncludeInferred() -
getDataset
-
getBaseURI
- Returns:
- the baseURI
-
getStrategy
- Returns:
- the
FederationEvalStrategy
active in the current query context
-
getFederationContext
- Returns:
- the
FederationContext
in which this query is executed
-
getMaxRemainingTimeMS
public long getMaxRemainingTimeMS()- Returns:
- the maximum remaining time in ms until the query runs into a timeout. If negative, timeout has been reached
-
registerScheduledTask
Register a new scheduled task for this query.- Parameters:
task
-- Throws:
QueryEvaluationException
- if the query has been aborted or closed
-
getResultHandler
Returns aTupleQueryResultHandler
if this query is executed using.TupleQuery.evaluate(TupleQueryResultHandler)
.- Returns:
- the
TupleQueryResultHandler
that can be used for pass through - See Also:
-
setResultHandler
Set theTupleQueryResultHandler
if the query is executed usingTupleQuery.evaluate(TupleQueryResultHandler)
allowing for passing through results to the handler.- Parameters:
resultHandler
- theTupleQueryResultHandler
-
abort
public void abort()Mark the query as aborted and abort all scheduled (future) tasks known at this point in time. Also do not accept any new scheduled tasks -
close
public void close()Close this query. If exists, all scheduled (future) tasks known at this point in time are aborted. Also do not accept any new scheduled tasks -
abortScheduledTasks
protected void abortScheduledTasks()Abort any scheduled future tasks -
hashCode
public int hashCode() -
equals
-