public class MockRunningQuery extends Object implements IRunningQuery
Constructor and Description |
---|
MockRunningQuery(IBigdataFederation<?> fed,
IIndexManager indexManager)
Note: This constructor DOES NOT check its arguments so unit tests may be
written with the minimum dependencies
|
MockRunningQuery(IBigdataFederation<?> fed,
IIndexManager indexManager,
IQueryContext queryContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning) |
Void |
get() |
Void |
get(long timeout,
TimeUnit unit) |
Throwable |
getAsThrownCause()
Return the first
cause regardless of whether it is
indicative of normal termination and null iff no cause has
been set. |
IQueryAttributes |
getAttributes()
Return an interface which allows attribute values to be associated with
an
IQueryContext . |
Map<Integer,BOp> |
getBOpIndex()
Return an unmodifiable index from
BOp.Annotations#BOP_ID to
BOp . |
Throwable |
getCause()
Return the first
Throwable which caused this process to halt, but
only for abnormal termination. |
long |
getDeadline()
Return the query deadline in milliseconds (the time at which it will
terminate regardless of its run state).
|
long |
getDoneTime()
The timestamp (ms) when the query was done and ZERO (0) if the query is
not yet done.
|
long |
getElapsed()
The elapsed time (ms) for the query.
|
IBigdataFederation<?> |
getFederation()
The
IBigdataFederation IFF the operator is being evaluated on an
IBigdataFederation . |
IIndexManager |
getLocalIndexManager()
The local
IIndexManager . |
IMemoryManager |
getMemoryManager()
Return the
IMemoryManager which may be used to buffer data on
high level data structures, such as the HTree , for this query. |
BOp |
getQuery()
The query.
|
IQueryClient |
getQueryController()
The client coordinate the evaluation of this query (aka the query
controller).
|
QueryEngine |
getQueryEngine()
The query engine class executing the query on this node.
|
UUID |
getQueryId()
The unique identifier for this query.
|
long |
getStartTime()
The timestamp (ms) when the query began execution.
|
StaticAnalysisStats |
getStaticAnalysisStats()
Return statistics associated with the static analysis phase of this
query.
|
Map<Integer,BOpStats> |
getStats()
Return an unmodifiable map exposing the statistics for the operators in
the query and
null unless this is the query controller. |
<T extends Throwable> |
halt(T cause)
Halt (exception thrown).
|
void |
halt(Void v)
Halt (normal termination).
|
boolean |
isCancelled() |
boolean |
isDone() |
IAsynchronousIterator<IBindingSet[]> |
iterator()
Return an iterator which will drain the solutions from the query.
|
void |
setStaticAnalysisStats(StaticAnalysisStats saStats)
Set the static analysis stats associated with this query.
|
public MockRunningQuery(IBigdataFederation<?> fed, IIndexManager indexManager)
fed
- indexManager
- readTimestamp
- writeTimestamp
- public MockRunningQuery(IBigdataFederation<?> fed, IIndexManager indexManager, IQueryContext queryContext)
public IBigdataFederation<?> getFederation()
IRunningQuery
IBigdataFederation
IFF the operator is being evaluated on an
IBigdataFederation
. When evaluating operations against an
IBigdataFederation
, this reference provides access to the
scale-out view of the indices and to other bigdata services.getFederation
in interface IRunningQuery
public IIndexManager getLocalIndexManager()
IRunningQuery
IIndexManager
. Query evaluation occurs
against the local indices. In scale-out, query evaluation proceeds shard
wise and this IIndexManager
MUST be able to read on the
ILocalBTreeView
.getLocalIndexManager
in interface IRunningQuery
public void halt(Void v)
IHaltable
public <T extends Throwable> T halt(T cause)
IHaltable
public QueryEngine getQueryEngine()
IRunningQuery
getQueryEngine
in interface IRunningQuery
public Map<Integer,BOp> getBOpIndex()
IRunningQuery
BOp.Annotations#BOP_ID
to
BOp
. This index may contain operators which are not part of the
pipeline evaluation, such as IPredicate
s.getBOpIndex
in interface IRunningQuery
public Map<Integer,BOpStats> getStats()
IRunningQuery
null
unless this is the query controller.
There will be a single entry in the map for each distinct
PipelineOp
. Entries might not appear until that operator has
either begun or completed at least one evaluation phase. This index only
contains operators which are actually part of the pipeline evaluation.getStats
in interface IRunningQuery
public long getDeadline()
IRunningQuery
getDeadline
in interface IRunningQuery
Long.MAX_VALUE
if no explicit deadline was specified.public long getDoneTime()
IRunningQuery
getDoneTime
in interface IRunningQuery
public long getElapsed()
IRunningQuery
getElapsed
in interface IRunningQuery
public long getStartTime()
IRunningQuery
getStartTime
in interface IRunningQuery
public Throwable getAsThrownCause()
IHaltable
cause
regardless of whether it is
indicative of normal termination and null
iff no cause has
been set.getAsThrownCause
in interface IHaltable<Void>
public BOp getQuery()
IRunningQuery
getQuery
in interface IRunningQuery
public UUID getQueryId()
IRunningQuery
getQueryId
in interface IRunningQuery
getQueryId
in interface IQueryContext
public IAsynchronousIterator<IBindingSet[]> iterator()
IRunningQuery
closed
.iterator
in interface IRunningQuery
public boolean cancel(boolean mayInterruptIfRunning)
public Void get() throws InterruptedException, ExecutionException
get
in interface Future<Void>
InterruptedException
ExecutionException
public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
get
in interface Future<Void>
InterruptedException
ExecutionException
TimeoutException
public boolean isCancelled()
isCancelled
in interface Future<Void>
public IQueryClient getQueryController()
IRunningQuery
QueryEngine
.
For scale-out, this will be the RMI proxy for the QueryEngine
instance to which the query was submitted for evaluation by the
application. The proxy is primarily for light weight RMI messages used to
coordinate the distributed query evaluation. Ideally, all large objects
will be transfered among the nodes of the cluster using NIO buffers.
getQueryController
in interface IRunningQuery
public IMemoryManager getMemoryManager()
IQueryContext
IMemoryManager
which may be used to buffer data on
high level data structures, such as the HTree
, for this query.
Each operator in the query should in general create its own child
IMemoryManager
. While the overall IMemoryManager
context
associated with a query will be released when the query terminates,
operators which create child IMemoryManager
contexts are
responsible for releasing their IMemoryManager
in a timely
fashion when the operator has finished its evaluation.getMemoryManager
in interface IQueryContext
public IQueryAttributes getAttributes()
IQueryContext
IQueryContext
.getAttributes
in interface IQueryContext
public void setStaticAnalysisStats(StaticAnalysisStats saStats)
IRunningQuery
setStaticAnalysisStats
in interface IRunningQuery
public StaticAnalysisStats getStaticAnalysisStats()
IRunningQuery
getStaticAnalysisStats
in interface IRunningQuery
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.