public class Execution extends Object
Loosely corresponds to a CellSet. A given statement may be executed several times over its lifetime, but at most one execution can be going on at a time.
Modifier and Type | Class and Description |
---|---|
static class |
Execution.State
Enumeration of the states of an Execution instance.
|
Constructor and Description |
---|
Execution(Statement statement,
long timeoutIntervalMillis) |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the execution instance.
|
void |
cancelSqlStatements()
Called by the RolapResultShepherd when the execution needs to clean all of its resources for whatever reasons,
typically when an exception has occurred or the execution has ended.
|
void |
checkCancelOrTimeout()
Checks the state of this Execution and throws an exception if something is wrong.
|
void |
end()
Called when query execution has completed.
|
long |
getElapsedMillis() |
int |
getExpCacheHitCount() |
int |
getExpCacheMissCount() |
long |
getId() |
Statement |
getMondrianStatement() |
QueryTiming |
getQueryTiming() |
long |
getStartTime() |
boolean |
isCancelOrTimeout()
Returns whether this execution is currently in a failed state and will throw an exception as soon as the next check
is performed using
checkCancelOrTimeout() . |
boolean |
isDone()
Tells whether this execution is done executing.
|
void |
registerStatement(Locus locus,
Statement statement)
This method is typically called by SqlStatement at construction time.
|
void |
setCellCacheHitCount(int cellCacheHitCount) |
void |
setCellCacheMissCount(int cellCacheMissCount) |
void |
setCellCachePendingCount(int cellCachePendingCount) |
void |
setContextMap()
Set the copied mdc into the current MDC.
|
void |
setExpCacheCounts(int hitCount,
int missCount) |
void |
setOutOfMemory(String msg)
This method will change the state of this execution to
Execution.State.ERROR and will set the message to display. |
void |
start()
Marks the start of an Execution instance.
|
void |
tracePhase(int hitCount,
int missCount,
int pendingCount) |
void |
unregisterSegmentRequests()
Calls into the SegmentCacheManager and unregisters all the registrations made for this execution on segments form
the index.
|
public static final Execution NONE
public Execution(Statement statement, long timeoutIntervalMillis)
public void setContextMap()
public void start()
Statement.start(Execution)
automatically. Users
don't need to call this method.public void tracePhase(int hitCount, int missCount, int pendingCount)
public void cancel()
public final void setOutOfMemory(String msg)
Execution.State.ERROR
and will set the message to display.
Cleanup of the resources used by this execution instance will be performed in the background later on.msg
- The message to display to the user, describing the problem encountered with the memory space.public void checkCancelOrTimeout() throws MondrianException
It won't throw anything if the query has successfully completed.
MondrianException
- The exception encountered.public boolean isCancelOrTimeout()
checkCancelOrTimeout()
.public boolean isDone()
public void cancelSqlStatements()
isCancelOrTimeout()
returns true.
This method doesn't need to be called by a user. It will be called internally by Mondrian when the system is ready to clean the remaining resources.
To check if this execution is failed, use isCancelOrTimeout()
instead.
public void end()
public void unregisterSegmentRequests()
public final long getStartTime()
public final Statement getMondrianStatement()
public final QueryTiming getQueryTiming()
public final long getId()
public final long getElapsedMillis()
public void registerStatement(Locus locus, Statement statement)
statement
- The statement used by this execution.public void setCellCacheHitCount(int cellCacheHitCount)
public void setCellCacheMissCount(int cellCacheMissCount)
public void setCellCachePendingCount(int cellCachePendingCount)
public void setExpCacheCounts(int hitCount, int missCount)
public int getExpCacheHitCount()
public int getExpCacheMissCount()
Copyright © 2021 Hitachi Vantara. All rights reserved.