|
IBM DB2 Information Integrator Java API Reference for Developing Wrappers |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.db2.wrapper.ParsedQueryFragment
com.ibm.db2.wrapper.Reply
The Reply class represents the portion of a request that the wrapper processes. In addition to the actions of the ParsedQueryFragment class, the Reply class adds methods and data members to initiate the following actions:
Advanced Customization is available with the Reply class by using an
execution cost (estimated execution time) for the reply query fragment.
The wrapper writer can override the default implementation of the costing
methods with ones that more precisely describe the execution model of the
source. Overriding the default costing is dependent on the default
selectivity estimation for the predicates in the query fragment.
Selectivity estimates are obtained by calling the
UnfencedGenericServer.getSelectivity
method that can also be overloaded by the wrapper writer.
Field Summary | |
static int |
ASC
Constant that indicates the ascending ordering for an order entry. |
static int |
DESC
Constant that indicates the descending ordering for an order entry. |
Constructor Summary | |
Reply(Request request,
UnfencedGenericServer server)
Instantiate a Reply for the specified data source (Server) and Request. |
Method Summary | |
void |
addHeadExp(RequestExp headExp)
Add a head expression in the SELECT clause of the query. |
void |
addOrderEntry(int position,
int direction)
Add an order entry in the ORDER BY clause of the query. |
void |
addPredicate(RequestExp predicate)
Add a predicate in the WHERE clause of the query. |
void |
addQuantifier(Quantifier quantifier)
Add a quantifier in the FROM clause of the query. |
double |
cardinality()
Retrieve the cardinality of the result when running the query fragment that is represented by the reply. |
double |
firstTupleCost()
Retrieve the cost that is required to obtain the first result tuple for the query fragment that is represented by the reply. |
java.io.Serializable |
getExecDesc()
Retrieve the execution descriptor object. |
int |
getNumberOfOrderEntries()
Retrieve the number of order entries. |
int[] |
getOrderEntry(int position)
Retrieve the order entry at the specified position in the ORDER by clause. |
int[] |
getParameterOrder()
Retrieve a list of parameter handles. |
UnfencedGenericServer |
getServer()
Retrieve the data source server that this reply belongs to. |
Reply |
nextReply()
Retrieve the next reply in the chain. |
double |
reExecCost()
Retrieve the cost needed to rerun the query fragment that is represented by the reply. |
void |
setDistinct(boolean distinct)
Set the DISTINCT indicator that is specified in the SELECT DISTINCT statement. |
void |
setExecDesc(java.io.Serializable execDesc)
Set the execution descriptor object. |
void |
setNextReply(Reply nextReply)
Specify the next reply in the chain. |
double |
totalCost()
Retrieve the total execution cost that is needed to run the query fragment that is represented by the reply. |
Methods inherited from class com.ibm.db2.wrapper.ParsedQueryFragment |
getDistinct, getHeadExp, getNickname, getNumberOfHeadExp, getNumberOfPredicates, getNumberOfQuantifiers, getPredicate, getQuantifier, getQuantifierByHandle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ASC
public static final int DESC
Constructor Detail |
public Reply(Request request, UnfencedGenericServer server)
request
- The Request object for which the Reply is generated.
The Request object encapsulates a query fragment that
is to be analyzed and processed by the wrapper.server
- The Server object that is processing the Request and
generates the Reply.Method Detail |
public final void addHeadExp(RequestExp headExp)
headExp
- The head expression to be added in the SELECT clause.RequestExp
public final void addOrderEntry(int position, int direction) throws WrapperException
ASC
or DESC
).
position
- The position of the head expression in the SELECT clause.direction
- The type of ordering: ASC - ascending order or DESC - descending order.
WrapperException
- if the direction is not valid.public final void addPredicate(RequestExp predicate)
predicate
- The predicate expression to be added in the WHERE clause.RequestExp
public final void addQuantifier(Quantifier quantifier)
quantifier
- The quantifier to be added in the FROM clause.Quantifier
public double cardinality()
public double firstTupleCost()
public final java.io.Serializable getExecDesc()
public final int getNumberOfOrderEntries()
public final int[] getOrderEntry(int position) throws WrapperException
ASC
or DESC
).
position
- The position of the order entry in the ORDER BY clause.
The first entry is at position 1.
WrapperException
- if the requested position is not validpublic final int[] getParameterOrder() throws WrapperException
WrapperException
- if the processing fails.public final UnfencedGenericServer getServer()
UnfencedGenericServer
public final Reply nextReply()
public double reExecCost()
public final void setDistinct(boolean distinct)
distinct
- The DISTINCT indicator.public final void setExecDesc(java.io.Serializable execDesc)
execDesc
- The execution descriptor.public final void setNextReply(Reply nextReply)
nextReply
- The Reply object to be added in the chain.public double totalCost()
|
IBM DB2 Information Integrator Java API Reference for Developing Wrappers |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
(C)Copyright IBM Corp. 2002. All rights reserved.
Links on this page are made available for your convenience and may take you to non-IBM sites. IBM does not warrant any sample code provided on these sites.