org.eclipse.datatools.sqltools.plan.internal
Interface IPlanInstance

All Known Implementing Classes:
PlanInstance

public interface IPlanInstance

This class encapsulates the following information a sql plan:

Author:
Hui Cao

Field Summary
static int FAILED
          Indicates it's failed to generated the execution plan
static int RUNNING
          Indicates that this plan is generating, still not finished
static int SUCCESS
          Indicates that the plan is successfully generated
 
Method Summary
 void finishFail(java.lang.Throwable th)
          Failed because of the throwable
 void finishSuccess(java.lang.String rawPlan)
          Successfully finished with the return plan's raw data
 java.lang.Throwable getFailThrowable()
          Returns the fail reason throwable
 IExecutionPlanDocument[] getPlanDocuments()
          Returns the execution plan documents of this plan.
 PlanRequest getPlanRequest()
          Returns the plan request
 java.lang.String getRawPlan()
          Returns the raw data of this plan
 int getStatus()
          Returns the current status
 boolean isFinished()
          Checks if this plan is finished or not
 void setPlanDocuments(IExecutionPlanDocument[] docs)
          Sets the execution plan documents, they should be parsed from the raw data.
 

Field Detail

RUNNING

static final int RUNNING
Indicates that this plan is generating, still not finished

See Also:
Constant Field Values

SUCCESS

static final int SUCCESS
Indicates that the plan is successfully generated

See Also:
Constant Field Values

FAILED

static final int FAILED
Indicates it's failed to generated the execution plan

See Also:
Constant Field Values
Method Detail

finishFail

void finishFail(java.lang.Throwable th)
Failed because of the throwable

Parameters:
th - the throwable

finishSuccess

void finishSuccess(java.lang.String rawPlan)
Successfully finished with the return plan's raw data

Parameters:
rawPlan - the plan's raw data

getFailThrowable

java.lang.Throwable getFailThrowable()
Returns the fail reason throwable

Returns:
null if not finished yet, or not fail.

getPlanRequest

PlanRequest getPlanRequest()
Returns the plan request

Returns:
the plan request

getRawPlan

java.lang.String getRawPlan()
Returns the raw data of this plan

Returns:
the raw data of this plan

getStatus

int getStatus()
Returns the current status

Returns:
@see #RUNNING
See Also:
SUCCESS, FAILED

isFinished

boolean isFinished()
Checks if this plan is finished or not

Returns:
true if finished (success or fail), false otherwise

getPlanDocuments

IExecutionPlanDocument[] getPlanDocuments()
Returns the execution plan documents of this plan. The documents are parsed from raw data of this execution plan

Returns:
the execution plan documents of this plan

setPlanDocuments

void setPlanDocuments(IExecutionPlanDocument[] docs)
Sets the execution plan documents, they should be parsed from the raw data. Note: this is for performance consideration, that is, we don't need to parse the raw data every time when it is shown

Parameters:
docs - the execution plan documents