|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object felix.dstruct.DataMovementOperator
public class DataMovementOperator
A Data Movement Operator (DMO) is a bridge from physical database objects (e.g., view, relational table etc.) to logical requirements of the data. A statistical operator (e.g., CRF, Coref etc.) only knows the logic of DMO instead of the physical execution plan. The physical execution plan of the DMO is instantiated by the Optimizer. The logic definition of the DMO is instantiated by corresponding statistical operators.
Nested Class Summary | |
---|---|
class |
DataMovementOperator.QuerySet
A collection containing 1) a set of datalog rules; 2) a conjunctive query or prepared statement. |
Field Summary | |
---|---|
java.util.ArrayList<java.lang.String> |
additionalSelList
Part of the schema of the output of this DMO, which is additionally assigned (i.e., may not be founded in the conjunctive query or prepared statement in logicQueryPlan ). |
boolean |
allowOptimization
Whether this DMO allowing optimizations from the optimizer. |
boolean |
asView
Whether the output (if any) of this DMO should be regarded as view or materialized table. |
tuffy.db.RDB |
db
RDB object on which this DMO works on. |
java.util.ArrayList<java.lang.String> |
finalSelList
The schema for the output of this DMO. |
static int |
globalID
Counter for DMO ID. |
boolean |
hasKnownFetchingOrder
Whether this DMO allows pre-fetching. |
boolean |
hasPrepared
Whether prepare() method has been invoked. |
boolean |
isIntermediaDMO
Whether this DMO can be used as view/table by other DMOs. |
DataMovementOperator.QuerySet |
logicQueryPlan
Conjunctive query or prepared statement acting as the *logic* description of this DMO. |
java.lang.String |
name
Name of table/view generated by this DMO. |
boolean |
needIndex
Do we need to build index for this DMO's output/intermediate results? |
java.util.ArrayList<java.lang.String> |
orderBy
How the result of this DMO is ordered? |
StatOperator |
parentStatOperator
The statistical operator who instantiates this DMO. |
DataMovementOperator.QuerySet |
physicalQueryPlan
Datalog, Conjunctive query or prepared statement acting as the *physical* description of this DMO. |
int |
predictedBB
Estimated number of Bound-Bound invocations. |
int |
PredictedBF
Estimated number of Bound-Free invocations. |
int |
PredictedFF
Estimated number of Free-Free invocations. |
int |
preFetchFactor
Parameter for pre-fetching optimization. |
java.util.ArrayList<java.lang.String> |
selListFromRule
Part of the schema of the output of this DMO, which is from the conjunctive queries or prepared statement in logicQueryPlan . |
java.util.HashSet<java.lang.String> |
whichToBound
Set of variables which will be bounded while evaluating this DMO. |
Constructor Summary | |
---|---|
DataMovementOperator(tuffy.db.RDB _db,
StatOperator _parentStatOperator)
the constructor. |
Method Summary | |
---|---|
void |
closePS()
Cancels rule of this DMO. |
void |
copyLogicPlanToPhysicalPlanDirectly()
Copy logic plan to physical plan directly. |
java.sql.PreparedStatement |
execute(java.lang.String bindingPattern,
java.util.ArrayList<java.lang.Integer> bindings)
Execute this DMO given bindings of variables. |
java.lang.String |
getAllFreeViewName()
Gets the view/table name of this DMO in Free-free case. |
java.lang.Integer |
getNext(int column)
Get int value in the result of this DMO. |
java.lang.Integer |
getNext(java.lang.String columnName)
Get int value in the result of this DMO. |
java.sql.Array |
getNextArray(int column)
Get int value in the result of this DMO. |
java.lang.Double |
getNextDouble(int column)
Get double value in the result of this DMO. |
java.lang.Double |
getNextDouble(java.lang.String columnName)
Get double value in the result of this DMO. |
java.lang.String |
getNextString(int column)
Get String value in the result of this DMO. |
java.sql.PreparedStatement |
getPS(java.lang.String bindingPattern,
java.util.ArrayList<java.lang.Integer> bindings)
Get the prepared statement that will be used to execute this DMO. |
java.lang.Boolean |
next()
Whether there are more tuples in the result of this DMO. |
void |
prepare()
Methods that prepares for the physical execution of this DMO. |
static DataMovementOperator |
Select(tuffy.db.RDB db,
StatOperator _parentStatOperator,
DataMovementOperator fromDMO,
java.util.ArrayList<java.lang.String> bindings,
int... cid)
Generate a DMO which is a SELECT on the given DMO. |
static DataMovementOperator |
SelectOrderBy(tuffy.db.RDB db,
StatOperator _parentStatOperator,
DataMovementOperator fromDMO,
java.util.ArrayList<java.lang.String> bindings,
java.lang.String orderby,
int... cid)
Generate a DMO which is a SELECT ... |
static DataMovementOperator |
UnionAll(tuffy.db.RDB db,
StatOperator _parentStatOperator,
java.util.List<DataMovementOperator> toBeUnioned,
java.lang.String bindingPattern,
java.util.ArrayList<java.lang.Integer> bindings,
int... cid)
Get the union of results from a set of DMOs. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public tuffy.db.RDB db
public int predictedBB
public int PredictedBF
public int PredictedFF
public boolean isIntermediaDMO
public java.lang.String name
public static int globalID
public boolean allowOptimization
public boolean hasKnownFetchingOrder
public int preFetchFactor
public StatOperator parentStatOperator
public DataMovementOperator.QuerySet logicQueryPlan
public java.util.ArrayList<java.lang.String> orderBy
public boolean needIndex
public DataMovementOperator.QuerySet physicalQueryPlan
public java.util.ArrayList<java.lang.String> finalSelList
public java.util.ArrayList<java.lang.String> selListFromRule
logicQueryPlan
.
public java.util.ArrayList<java.lang.String> additionalSelList
logicQueryPlan
).
public boolean hasPrepared
public boolean asView
public java.util.HashSet<java.lang.String> whichToBound
Constructor Detail |
---|
public DataMovementOperator(tuffy.db.RDB _db, StatOperator _parentStatOperator)
_db
- _parentStatOperator
- Method Detail |
---|
public static DataMovementOperator UnionAll(tuffy.db.RDB db, StatOperator _parentStatOperator, java.util.List<DataMovementOperator> toBeUnioned, java.lang.String bindingPattern, java.util.ArrayList<java.lang.Integer> bindings, int... cid)
db
- _parentStatOperator
- toBeUnioned
- set of DMOs to be unioned.bindingPattern
- bindingPattern of the resulting union. See ConjunctiveQuery.psMap
.bindings
-
public static DataMovementOperator Select(tuffy.db.RDB db, StatOperator _parentStatOperator, DataMovementOperator fromDMO, java.util.ArrayList<java.lang.String> bindings, int... cid)
db
- _parentStatOperator
- fromDMO
- the given DMO.bindings
- variables in the WHERE list.
public static DataMovementOperator SelectOrderBy(tuffy.db.RDB db, StatOperator _parentStatOperator, DataMovementOperator fromDMO, java.util.ArrayList<java.lang.String> bindings, java.lang.String orderby, int... cid)
db
- _parentStatOperator
- fromDMO
- the given DMO.bindings
- variables in the WHERE list.orderby
- cid
-
public void prepare()
public java.sql.PreparedStatement execute(java.lang.String bindingPattern, java.util.ArrayList<java.lang.Integer> bindings)
next()
, getNext(int)
,
getNext(String)
etc. can be invoked. This interface
is similar to ResultSet in JDBC.
bindingPattern
- binding patterns. If this DMO is a conjunctive query (in logic plan),
use format as ConjunctiveQuery.psMap
(a null value will correspond to all-free case).
If this DMO is a prepared statement (in logic plan), this value should be set as null.bindings
- ordered list of constants that will be used to bind variables.
public java.sql.PreparedStatement getPS(java.lang.String bindingPattern, java.util.ArrayList<java.lang.Integer> bindings)
execute(String, ArrayList)
(the only difference
is this method does not actually execute this DMO).
public java.lang.String getAllFreeViewName()
public java.lang.Boolean next()
execute(String, ArrayList)
.
public java.lang.Integer getNext(java.lang.String columnName)
execute(String, ArrayList)
.
public java.sql.Array getNextArray(int column)
execute(String, ArrayList)
.
public java.lang.Integer getNext(int column)
execute(String, ArrayList)
.
public java.lang.Double getNextDouble(java.lang.String columnName)
execute(String, ArrayList)
.
public java.lang.Double getNextDouble(int column)
execute(String, ArrayList)
.
public java.lang.String getNextString(int column)
execute(String, ArrayList)
.
public void closePS()
public void copyLogicPlanToPhysicalPlanDirectly()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |