|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.miningmart.compiler.CompilerAccessLogic
Objects of this class realize a single thread executing a command to the compiler.
This is used by the RMI interface class to create different instances for concurrent
compiler instances, but also by the class
miningmart.compiler.CreateCompiler
to run a single local (non-RMI)
instance for a single compiliation task (e.g. command line based).
edu.udo.cs.miningmart.compiler.CompilerAccessImpl
,
miningmart.compiler.CreateCompiler
Constructor Summary | |
CompilerAccessLogic(DB db,
Print printObject)
This constructor takes all information needed from an existing database connection and shares the cache with the DB
object! |
|
CompilerAccessLogic(java.lang.String myDbConfigFile)
Sets up a new instance of CompilerAccessLogic , using the
default verbosity and the specified configuration file. |
|
CompilerAccessLogic(java.lang.String myDbConfigFile,
java.util.logging.Level verbosity)
Sets up a new instance of CompilerAccessLogic , using the
specified verbosity and configuration file. |
Method Summary | |
void |
changeCompilerOutputVerbosity(long caseId,
java.util.logging.Level newVerbosity)
Change the verbosity level of the compiler log messages for the given case. |
void |
compileAll(long caseId,
boolean lazyMode)
This method is given the ID of a Case to be compiled.
|
void |
compileAll(long caseId,
boolean lazy,
int verbosity)
|
void |
compileRestOfCase(long caseId,
boolean lazyMode)
A call to this method compiles only those steps of a case which have not already been compiled. |
void |
compileStep(long stepId,
boolean lazyMode)
This method is given the ID of the step to be compiled. |
void |
compileStep(long stepId,
boolean lazy,
int verbosity)
|
void |
compileStep(java.lang.String stepName,
boolean lazyMode)
This method is given the name of the step to be compiled, as specified in table STEP_T, attribute ST_NAME. |
void |
compileStepFrom(long stepId,
boolean lazyMode)
This method is given the ID of the first Step of a
subtree to be compiled.
|
void |
compileStepFrom(long stepId,
boolean lazy,
int verbosity)
|
void |
compileStepTo(long stepId,
boolean lazyMode,
boolean ignoreCompiledStatus)
This method compiles all Steps that need to be compiled before the given Step can be compiled; then it compiles the given Step. |
void |
deleteTrashForCase(long caseId)
Runs the garbage collection for all Step s of a
specified Case . |
void |
deleteTrashForStep(long stepId)
Runs the garbage collection for the specified Step
and all subsequent dependent Step s with respect to
the entries in the table STEPSEQUENCE_T. |
Case |
getCase()
|
Print |
getCurrentPrintObject()
Gets the instance of the Case -dependent Print
object, if available. |
CompilerDatabaseService |
getDb()
Gets the instance of class DB representing the database
access to both the M4 and business schema. |
static ExecutableOperator |
getExecutableOperator(Operator operator)
This method bridges the gap between the M4 operator objects and the executable operators. |
DB |
getM4db()
Same as getDb(), but with less specific return type for the implemented interface. |
Print |
getPrintObject()
|
java.lang.String |
getStatusFromLine(long caseId,
int lineNumber)
Reads the status message of a running compiler server thread. |
java.lang.String |
getStatusMessage(long caseId,
int numberOfLines)
Reads the status message of a running compiler server thread. |
boolean |
getStopRequest()
Checked to decide, if an exception should be thrown to stop execution. |
boolean |
isReadyForCompilation(long stepId)
This method checks for a given Step , if it can currently
be compiled. |
boolean |
killCompilerThread(long caseId)
This method kills a running compiler thread. |
void |
updateColumnsetStatistics(long columnsetID)
Uses the stored procedures of the database to update the statistics of the specified column set and of all the columns contained in the column set. |
void |
updateColumnStatistics(long columnID)
Uses the stored procedures of the database to update the statistics of the specified column. |
void |
updateStatisticsForConcept(long conceptID)
Uses the stored procedures of the database to update all the statistics which are related to the specified concept. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CompilerAccessLogic(DB db, Print printObject)
DB
object!
db
- an existing database connection object of type DB
printObject
- the Print object to be used for log messagespublic CompilerAccessLogic(java.lang.String myDbConfigFile) throws java.io.IOException, java.sql.SQLException
CompilerAccessLogic
, using the
default verbosity and the specified configuration file.
myDbConfigFile
- the path to the configuration file describing the
settings of the databaseminingmart.compiler.utils.Print
public CompilerAccessLogic(java.lang.String myDbConfigFile, java.util.logging.Level verbosity) throws java.io.IOException, java.sql.SQLException
CompilerAccessLogic
, using the
specified verbosity and configuration file.
myDbConfigFile
- the path to the configuration file describing the
settings of the databaseverbosity
- the verbosity of the Print
object associated
with this
object.miningmart.compiler.utils.Print
Method Detail |
public void compileStep(long stepId, boolean lazyMode) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
CompilerAccess
An exception is thrown if the step is not present in the according M4 table, if parameters are missing, if references are invalid, if the database connection fails or if the execution of an operator fails.
compileStep
in interface CompilerAccess
stepId
- the ID of the step in STEP_TlazyMode
- a flag indicating if the compiler
should run in lazy mode or not
M4CompilerInterfaceError
M4CompilerWarning
UserError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#compileStep(long, boolean)
public void compileStep(java.lang.String stepName, boolean lazyMode) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
CompilerAccess
An exception is thrown if the step is not present in the according M4 table, if parameters are missing, if references are invalid, if the database connection fails or if the execution of an operator fails.
compileStep
in interface CompilerAccess
stepName
- the name of the step in STEP_TlazyMode
- a flag indicating if the compiler
should run in lazy mode or not
M4CompilerInterfaceError
M4CompilerWarning
UserError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#compileStep(String, boolean)
public static ExecutableOperator getExecutableOperator(Operator operator) throws M4CompilerError
Step.getOperatorClass()
and returns an executable operator.
ExecutableOperator
M4CompilerError
public void compileAll(long caseId, boolean lazyMode) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
CompilerAccess
Case
to be compiled.
The compiler calculates a valid sequential order of the embedded
step
s with respect to the constraints introduced by
the STEPSEQUENCE_T table.
If the lazy mode flag is set, then a less time consuming execution
is performed.An exception is thrown if there is no valid sequence (e.g. cyclic dependencies), if there are no steps connected to the given case, if parameters are missing, if references are invalid, if the database connection fails or if the execution of an operator fails.
compileAll
in interface CompilerAccess
caseId
- the ID of the case to be compiledlazyMode
- a flag indicating if the compiler
should run in lazy mode or not
M4CompilerInterfaceError
M4CompilerWarning
UserError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#compileAll(long, boolean)
public void compileStepFrom(long stepId, boolean lazyMode) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
CompilerAccess
Step
of a
subtree to be compiled.
The compiler calculates a valid sequential order of the subtree
defined by and with respect to the constraints introduced by
the STEPSEQUENCE_T table.
If the lazy mode flag is set, then a less time consuming execution
is performed.An exception is thrown if there is no valid sequence (e.g. cyclic dependencies), if there are no steps connected to the given case, if parameters are missing, if references are invalid, if the database connection fails or if the execution of an operator fails.
compileStepFrom
in interface CompilerAccess
stepId
- the ID of the first step to be compiledlazyMode
- a flag indicating if the compiler
should run in lazy mode or not
M4CompilerInterfaceError
M4CompilerWarning
UserError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#compileStepFrom(long, boolean)
public void compileStepTo(long stepId, boolean lazyMode, boolean ignoreCompiledStatus) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
CompilerAccess
compileStepTo
in interface CompilerAccess
stepId
- the ID of the last step to be compiledlazyMode
- a flag indicating if the compiler
should run in lazy mode or notignoreCompiledStatus
- if TRUE, only the graph structure
determines which Steps are compiled. If FALSE, only those
Steps among the predecessors of the given Step are compiled
that have not been compiled yet. In the latter case, only
Steps on the shortest paths from a compiled step to the given Step
are compiled, and no Steps that precede an already compiled Step
are compiled.
M4CompilerInterfaceError
M4CompilerWarning
UserError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#compileStepTo(long, boolean)
public void updateColumnStatistics(long columnID) throws M4CompilerInterfaceError
CompilerAccess
updateColumnStatistics
in interface CompilerAccess
columnID
- the ID of column set in table
COLUMN_T for which the statistics
shall be updated
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#updateColumnStatistics(long)
public void updateColumnsetStatistics(long columnsetID) throws M4CompilerInterfaceError
CompilerAccess
updateColumnsetStatistics
in interface CompilerAccess
columnsetID
- the ID of column set in table
COLUMNSET_T for which the statistics
shall be updated
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#updateColumnsetStatistics(long)
public void updateStatisticsForConcept(long conceptID) throws M4CompilerInterfaceError
CompilerAccess
updateStatisticsForConcept
in interface CompilerAccess
conceptID
- the ID of the concept in table
CONCEPT_T for which the statistics
shall be updated
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#updateStatisticsForConcept(long)
public void deleteTrashForStep(long stepId) throws M4CompilerInterfaceError
CompilerAccess
Step
and all subsequent dependent Step
s with respect to
the entries in the table STEPSEQUENCE_T.
deleteTrashForStep
in interface CompilerAccess
stepId
- the ID of the (first) Step
to run the
garbage collection for.
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#deleteTrashForStep(long)
public void deleteTrashForCase(long caseId) throws M4CompilerInterfaceError
CompilerAccess
Step
s of a
specified Case
.
deleteTrashForCase
in interface CompilerAccess
caseId
- of the Case
to run the garbage
collection for.
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#deleteTrashForCase(long)
public java.lang.String getStatusMessage(long caseId, int numberOfLines) throws M4CompilerInterfaceError
CompilerAccess
getStatusMessage
in interface CompilerAccess
caseId
- the id of the case to receive log information for.
Because of the case locking mechanism each case is never compiled more
than once at the same time, so this is a unique Thread identifier.
A caseId of 0 or lower is interpreted as the default Print class,
used before having found the right case or in case of severe errors.numberOfLines
- the numberOfLines to be returned
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#getStatusMessage(long, int)
public java.lang.String getStatusFromLine(long caseId, int lineNumber) throws M4CompilerInterfaceError
CompilerAccess
getStatusFromLine
in interface CompilerAccess
caseId
- the id of the case to receive log information for.
Because of the case locking mechanism each case is never compiled more
than once at the same time, so this is a unique Thread identifier.
A caseId of 0 or lower is interpreted as the default Print class,
used before having found the right case or in case of severe errors.lineNumber
- the first line of the logfile to be returned
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#getStatusFromLine(long, int)
public void changeCompilerOutputVerbosity(long caseId, java.util.logging.Level newVerbosity) throws M4CompilerInterfaceError
CompilerAccess
changeCompilerOutputVerbosity
in interface CompilerAccess
caseId
- the id of the case to receive log information for.
Because of the case locking mechanism each case is never compiled more
than once at the same time, so this is a unique Thread identifier.
A caseId of 0 or lower is interpreted as the default Print class,
used before having found the right case or in case of severe errors.newVerbosity
- The new verbosity. Use one of the public constants of
the class edu.udo.cs.miningmart.m4.utils.Print, if possible.
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#changeCompilerOutputVerbosity(long, int)
public boolean isReadyForCompilation(long stepId) throws M4CompilerInterfaceError
CompilerAccess
Step
, if it can currently
be compiled. Validity aspects are not checked, but for all Step
s
the given Step
depends on (regarding to STEPSEQUENCE_T)
it is made sure that they have recently (after the last garbage collection)
been compiled, so the outputs of these Step
s are available in
the database.
isReadyForCompilation
in interface CompilerAccess
stepId
- the ID of the Step
Step
s this Step
depends on have
been compiled
M4CompilerInterfaceError
edu.udo.cs.miningmart.compiler.CompilerAccessImpl#isReadyForCompilation(long)
public void compileRestOfCase(long caseId, boolean lazyMode) throws M4CompilerInterfaceError, M4CompilerWarning
caseId
- the ID of the case to be compiledlazyMode
- indicates if the steps should be compiled in lazy mode
M4CompilerInterfaceError
M4CompilerWarning
public CompilerDatabaseService getDb()
DB
representing the database
access to both the M4 and business schema.
public DB getM4db()
getM4db
in interface M4InterfaceContext
public Print getCurrentPrintObject()
Case
-dependent Print
object, if available. If no such object could be set up, yet, then the
default Print
object is returned instead.
Print
object to be used in the current compiler runpublic boolean getStopRequest()
getStopRequest
in interface M4InterfaceContext
true
iff the Thread should not continue.public Case getCase()
getCase
in interface M4InterfaceContext
Case
associated with this CompilerAccessLogic object.public Print getPrintObject()
getPrintObject
in interface M4InterfaceContext
miningmart.compiler.utils.CompilerAccessLogic.getPrintObject()
public void compileAll(long caseId, boolean lazy, int verbosity) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
M4CompilerInterfaceError
M4CompilerWarning
UserError
public void compileStep(long stepId, boolean lazy, int verbosity) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
M4CompilerInterfaceError
M4CompilerWarning
UserError
public void compileStepFrom(long stepId, boolean lazy, int verbosity) throws M4CompilerInterfaceError, M4CompilerWarning, UserError
M4CompilerInterfaceError
M4CompilerWarning
UserError
public boolean killCompilerThread(long caseId)
CompilerAccess
Case
they are compiling. Nevertheless, for a few seconds after
launching a compileStep
command this method may not succeed in
identifying the right Thread. For this reason, there is a return value.
It is a good idea to send kill request until true
is returned.
A Thread is killed by a special exception, which is finally translated to
an M4CompilerInterfaceError
.
killCompilerThread
in interface CompilerAccess
caseId
- The ID of the case for which the compiler thread should be killed.
true
iff a thread for the given case has been found and the
the kill flag has been set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |