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
FieldsModifier and TypeFieldDescriptionprotected booleanprotected static final AtomicIntegerprotected Set<ParallelTask<?>> -
Constructor Summary
ConstructorsConstructorDescriptionQueryInfo(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 TypeMethodDescriptionvoidabort()Mark the query as aborted and abort all scheduled (future) tasks known at this point in time.protected voidAbort any scheduled future tasksvoidclose()Close this query.booleanbooleanlonggetQuery()Returns aTupleQueryResultHandlerif this query is executed using.inthashCode()voidregisterScheduledTask(ParallelTask<?> task) Register a new scheduled task for this query.voidsetResultHandler(TupleQueryResultHandler resultHandler) Set theTupleQueryResultHandlerif 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- theFederationContextdataset- 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
FederationEvalStrategyactive in the current query context
-
getFederationContext
- Returns:
- the
FederationContextin 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 aTupleQueryResultHandlerif this query is executed using.TupleQuery.evaluate(TupleQueryResultHandler).- Returns:
- the
TupleQueryResultHandlerthat can be used for pass through - See Also:
-
setResultHandler
Set theTupleQueryResultHandlerif 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
-