|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.miningmart.operator.ExecutableOperator
Abstract superclass of all executable operators in
MiningMart. It provides, among others, the methods
load()
, execute()
and get(Single)Parameter()
.
Its direct subclasses are ConceptOperator
and
FeatureConstruction
.
Field Summary | |
protected java.lang.String[] |
generatedSQLDefinitions
|
Constructor Summary | |
ExecutableOperator()
|
Method Summary | |
void |
autoPrint()
Prints all the parameters of this operator for the current Step
in the order given by the table OP_PARAMS_T. |
protected void |
checkConditions()
|
abstract void |
compileStatement()
Abstract method for compiling the generated sql-statement. |
abstract void |
createStatement(boolean lazy)
Abstract method for generating an sql-statement. |
void |
doPrint(java.lang.Exception ex)
Method to be used by all subclasses to print exception messages to the screen or log file. |
void |
doPrint(java.util.logging.Level verbosity,
java.lang.String printString)
Method to be used by all subclasses to print messages to the screen or log file. |
abstract EstimatedStatistics |
estimateStatistics(Step theStep)
Abstract method for estimating statistics for a concept. |
void |
execute(boolean lazy)
Execute everything to be done to compile an operator. |
java.lang.String |
executeBusinessSingleValueSqlRead(java.lang.String query)
|
java.lang.Long |
executeBusinessSingleValueSqlReadL(java.lang.String query)
|
java.sql.ResultSet |
executeBusinessSqlRead(java.lang.String query)
Method to comfortably read from the business database. |
void |
executeBusinessSqlWrite(java.lang.String query)
Method to comfortably write to the business database. |
java.lang.String |
executeM4SingleValueSqlRead(java.lang.String query)
|
java.lang.Long |
executeM4SingleValueSqlReadL(java.lang.String query)
|
java.sql.ResultSet |
executeM4SqlRead(java.lang.String query)
Method to comfortably read from the M4 database. |
void |
executeM4SqlWrite(java.lang.String query)
Method to comfortably write to the M4 database. |
protected java.lang.String |
getArtificalColumnName(java.lang.String otherColumns)
Service method for subclasses. |
protected short |
getBusinessDbms()
|
protected int |
getHighestLoopNr()
Gets the numberOfLoops from the table STEP_T. |
CompilerDatabaseService |
getM4Db()
This method returns the instance of CompilerDatabaseService
that is used in this Case . |
protected short |
getM4Dbms()
|
M4Object |
getM4ObjectFromCache(long Id)
This method returns the object with the given Id if it is in the Cache. |
java.lang.String |
getName()
|
long |
getNextM4SequenceValue()
|
int |
getNumberOfLoops()
Get the number of loops that this operator is to be applied in in a way that the return value can be used as the loop number of getParameter .
|
Operator |
getOperator()
|
java.util.Iterator |
getOpParamsIterator()
|
ParameterObject[] |
getParameter(java.lang.String name)
This method is the same as getParameter(String,int) ,
but for parameters that are not looped. |
ParameterObject[] |
getParameter(java.lang.String name,
int loopNr)
For loopable parameters. |
M4Object |
getSingleParameter(java.lang.String name)
This method is similar to Step.getParameter , but it returns
a single M4Object. |
M4Object |
getSingleParameter(java.lang.String name,
int loopNr)
Same as getSingleParameter(String) , but with loop number |
Step |
getStep()
|
protected void |
handleAssertions()
|
protected boolean |
isDeselectedParameter(M4Object m4o)
Check if an M4Object has been deselected by an automatic
FeatureSelection operator. |
boolean |
isLoopable()
|
boolean |
isManual()
|
boolean |
isStepable()
|
void |
load(Step step)
Loads all parameters for this operator. |
void |
print()
Print-method for all operator parameters. |
void |
putM4ObjectToCache(M4Object m4o)
This method stores an M4 object in the Cache, using its ID as the key for the underlying data structure. |
void |
showCreateStatement()
Print-method for the generated sql-statement. |
protected boolean |
storedProceduresAvailable()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String[] generatedSQLDefinitions
Constructor Detail |
public ExecutableOperator()
Method Detail |
public void load(Step step) throws ParameterDeselectedError, M4CompilerError
step
- This executable operator's step
ParameterDeselectedError
M4CompilerError
public ParameterObject[] getParameter(java.lang.String name, int loopNr) throws M4CompilerError
name
- the name of a parameter to be looked uploopNr
- the loop for which the parameter should be returned
ParameterObject
s.
A return value of null
indicates, that the parameter was not found.
M4CompilerError
public ParameterObject[] getParameter(java.lang.String name) throws M4CompilerError
getParameter(String,int)
,
but for parameters that are not looped.
name
- name of the parameter
ParameterObject
s.
A return value of null
indicates, that the parameter was not found.
M4CompilerError
public M4Object getSingleParameter(java.lang.String name) throws M4CompilerError
Step.getParameter
, but it returns
a single M4Object. This is more comfortable if it is known, that a parameter
is no array. If a parameter is not found null
is returned.
If the parameter is an array, the first value is returned.
name
- the name of the parameter
null
if not present
M4CompilerError
public M4Object getSingleParameter(java.lang.String name, int loopNr) throws M4CompilerError
getSingleParameter(String)
, but with loop number
M4CompilerError
getSingleParameter(String)
public CompilerDatabaseService getM4Db() throws M4CompilerError
CompilerDatabaseService
that is used in this Case
. It provides a number
of service methods to access M4.
CompilerDatabaseService
object of this Case
M4CompilerError
public Operator getOperator()
public java.lang.String getName()
public Step getStep()
Step
object associated to this object.public boolean isLoopable()
true
iff this operator is loopable.public boolean isManual()
true
iff this is a manual operatorpublic boolean isStepable()
true
iff this operator is multistepable.protected final int getHighestLoopNr()
0
if loops are not activated for the
Step
; otherwise the number of loops is returned.getNumberOfLoops()
public int getNumberOfLoops()
getParameter
.
Example:for (int loop=0; loop < getNumberOfLoops() ; loop++)
0
(loops not activated) results in a return value of
1
.getHighestLoopNr()
public java.util.Iterator getOpParamsIterator() throws M4CompilerError
Iterator
for the parameters stored in table OP_PARAM_T,
represented as objects of type OpParam
.
M4CompilerError
protected final boolean isDeselectedParameter(M4Object m4o) throws M4CompilerError
M4Object
has been deselected by an automatic
FeatureSelection
operator. Only Feature
s can be
deselected.
m4o
- the M4Object
M4CompilerError
public void doPrint(java.util.logging.Level verbosity, java.lang.String printString)
verbosity
- A verbosity level. Use one of the public
static variables of the class Print
.printString
- The string with the message.edu.udo.cs.miningmart.m4.core.utils.Print
public void doPrint(java.lang.Exception ex)
ex
- An exception object. Its message string will be printed.public final void print()
autoLoad()
mechanism,
this method must be defined at all levels of abstraction
and has to print out all parameters read at this level.
In this case the first statement must always be
super.showParameters()
.
autoLoad()
mechanism
(recommended), then just override the method with a call
to this.autoPrint()
(without calling
super.print()
!).
public final void autoPrint()
this
operator for the current Step
in the order given by the table OP_PARAMS_T. Note that you have to call the
method autoLoad()
before being able to apply autoPrint.
In subclasses you can override the print()
method by just calling this
method, without calling super.print()
.
public void execute(boolean lazy) throws java.sql.SQLException, M4CompilerWarning, M4CompilerError, UserError, M4Exception
lazy
- If TRUE, run the operator in lazy mode
UserError
M4Exception
java.sql.SQLException
M4CompilerWarning
M4CompilerError
protected void handleAssertions() throws M4CompilerError, M4CompilerWarning
M4CompilerError
M4CompilerWarning
protected void checkConditions() throws UserError, M4CompilerError
UserError
M4CompilerError
public abstract void createStatement(boolean lazy) throws java.sql.SQLException, M4CompilerWarning, M4CompilerError
lazy
- If TRUE, run in lazy mode: create atmost one output
ColumnSet
java.sql.SQLException
M4CompilerWarning
M4CompilerError
public void showCreateStatement()
public abstract void compileStatement() throws java.sql.SQLException, M4CompilerWarning, M4CompilerError
java.sql.SQLException
M4CompilerWarning
M4CompilerError
public abstract EstimatedStatistics estimateStatistics(Step theStep) throws M4Exception
theStep
- the step that creates the output concept whose statistics
are to be estimated
EstimatedStatistics
object, some of whose values
may or may not be available, depending on whether they could be guessed
or inferred.
M4Exception
protected short getM4Dbms() throws M4CompilerError, DbConnectionClosed
M4CompilerError
DbConnectionClosed
protected short getBusinessDbms() throws M4CompilerError, DbConnectionClosed
M4CompilerError
DbConnectionClosed
protected boolean storedProceduresAvailable() throws DbConnectionClosed, M4CompilerError
DbConnectionClosed
M4CompilerError
public M4Object getM4ObjectFromCache(long Id) throws M4CompilerError
Id
- The unique M4 Id of the object to be loaded.
null
otherwise.
M4CompilerError
public void putM4ObjectToCache(M4Object m4o) throws M4CompilerError
M4CompilerError
- if the object is null
or
has an ID of 0.public void executeM4SqlWrite(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
query
- an SQL query to be executed. This has to be a write operation to the M4 database,
or an SQL string to execute a procedure in the M4 schema.
java.sql.SQLException
M4CompilerError
DbConnectionClosed
public void executeBusinessSqlWrite(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
query
- an SQL query to be executed. This has to be a write operation to the business database,
or an SQL string to execute a procedure in the business schema.
java.sql.SQLException
M4CompilerError
DbConnectionClosed
public java.sql.ResultSet executeM4SqlRead(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
ResultSet
after usage!
query
- an SQL query to be executed. This has to be a read operation on the M4 database.
ResultSet
java.sql.SQLException
M4CompilerError
DbConnectionClosed
public java.sql.ResultSet executeBusinessSqlRead(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
ResultSet
after usage!
query
- an SQL query to be executed. This has to be a read operation on the business database.
ResultSet
java.sql.SQLException
M4CompilerError
DbConnectionClosed
public java.lang.Long executeM4SingleValueSqlReadL(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
java.sql.SQLException
M4CompilerError
DbConnectionClosed
In contrast to that method, this method creates and then closes its own
Statement
.
public java.lang.Long executeBusinessSingleValueSqlReadL(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
java.sql.SQLException
M4CompilerError
DbConnectionClosed
In contrast to that method, this method creates and then closes its own
Statement
.
public java.lang.String executeM4SingleValueSqlRead(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
java.sql.SQLException
M4CompilerError
DbConnectionClosed
In contrast to that method, this method creates and then closes its own
Statement
.
public java.lang.String executeBusinessSingleValueSqlRead(java.lang.String query) throws java.sql.SQLException, M4CompilerError, DbConnectionClosed
java.sql.SQLException
M4CompilerError
DbConnectionClosed
In contrast to that method, this method creates and then closes its own
Statement
.
public long getNextM4SequenceValue() throws M4CompilerError
M4CompilerError
- if for some reason the sequence does not return a valueprotected java.lang.String getArtificalColumnName(java.lang.String otherColumns)
otherColumns
- The other column names
otherColumns
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |