mondrian.server
Class Execution

java.lang.Object
  extended by mondrian.server.Execution
Direct Known Subclasses:
MondrianOlap4jCellSet

public class Execution
extends Object

Execution context.

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.

Version:
$Id: //open/mondrian/src/main/mondrian/server/Execution.java#3 $
Author:
jhyde

Field Summary
static Execution NONE
           
(package private)  StatementImpl statement
           
 
Constructor Summary
Execution(Statement statement, long timeoutIntervalMillis)
           
 
Method Summary
 void cancel()
           
 void checkCancelOrTimeout()
           
 void cleanStatements()
          Called when the execution needs to clean all of its resources for whatever reasons, typically when an exception has occurred or the execution has ended.
(package private)  void end()
          Called when query execution has completed.
 long getElapsedMillis()
           
 long getId()
           
 Statement getMondrianStatement()
           
 QueryTiming getQueryTiming()
           
 long getStartTime()
           
 boolean isCancelOrTimeout()
          Returns whether this execution is currently in a 'timeout' state and will throw an exception as soon as the next check is performed using checkCancelOrTimeout().
 void registerStatement(Locus locus, Statement statement)
          This method is typically called by SqlStatement at construction time.
 void setOutOfMemory(String msg)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statement

final StatementImpl statement

NONE

public static final Execution NONE
Constructor Detail

Execution

public Execution(Statement statement,
                 long timeoutIntervalMillis)
Method Detail

start

public void start()

cancel

public void cancel()

setOutOfMemory

public final void setOutOfMemory(String msg)

checkCancelOrTimeout

public void checkCancelOrTimeout()

isCancelOrTimeout

public boolean isCancelOrTimeout()
Returns whether this execution is currently in a 'timeout' state and will throw an exception as soon as the next check is performed using checkCancelOrTimeout().

Returns:
True or false, depending on the timeout state.

cleanStatements

public void cleanStatements()
Called when the execution needs to clean all of its resources for whatever reasons, typically when an exception has occurred or the execution has ended. Any currently running SQL statements will be canceled.


end

void end()
Called when query execution has completed. Once query execution has ended, it is not possible to cancel or timeout the query until it starts executing again.


getStartTime

public final long getStartTime()

getMondrianStatement

public final Statement getMondrianStatement()

getQueryTiming

public final QueryTiming getQueryTiming()

getId

public final long getId()

getElapsedMillis

public final long getElapsedMillis()

registerStatement

public void registerStatement(Locus locus,
                              Statement statement)
This method is typically called by SqlStatement at construction time. It ties all Statement objects to a particular Execution instance so that we can audit, monitor and gracefully cancel an execution.

Parameters:
statement - The statement used by this execution.

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads