| 
Oracle Data Mining Java API Reference 10g Release 1 (10.1) B12276-01  | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
  |
  +--oracle.dmt.odm.MiningObject
        |
        +--oracle.dmt.odm.LocatableObject
              |
              +--oracle.dmt.odm.task.MiningTask
The abstract class MiningTask is the common superclass for all data mining task classes. A mining task will be executed asynchronously in the database. A mining task must have all the input parameters required for performing the task. This class has utility methods to retrieve the task status information.
A mining task must be persisted using the store(dmsConn, taskName) method before execution. A mining task can be executed more than once in 10.x.x version of the oracle database, oracle.dmt.odm.task.ExecutionHandle object returned when a mining task is executed.
When a MiningTask object is created and stored it will be set to ready state. A mining task can be executed only when it is in ready state. Once persisted, a MiningTask goes through the following states:
queued - task is queued for executioninitiated - task is initiated to executeexecuting - task is actually getting executed in the DMSsuccess - if the task got successfully completed,error - if the task failed to complete.When a mining task is terminated, it will immediately come to terminating state. After succeefully terminating, the task state will come to terminated state. If the task comes to error/success state while terminating the task, then task state will come to error/success state.
A task status history is persisted along with the task details. A user can get the current status information of a task by calling the getCurrentStatus(dmsConn, taskName) method. This returns a MiningTaskStatus object, which provides more details about the state. A user can get the complete status history of a task by calling the getStatusHistory(dmsConn, taskName) method.
To list all the tasks that are currently at a particular state, invoke the listTasks method. For example, to list all the tasks currently getting executed by the user, invoke
listTasks(dmsConn, MiningTaskState.executing, null, null)oracle.dmt.odm.MiningTaskState, oracle.dmt.odm.task.MiningTaskStatus, Serialized Form| Method Summary | |
 ExecutionHandle | 
execute(Connection dmsConn)Submits the mining task for asynchronous execution in the DMS.  | 
static ExecutionHandle | 
getActiveExecutionHandle(Connection dmsConn, java.lang.String taskName)An execution handle is active only when it is in queued/initiated/executing/terminating states.  | 
static MiningTaskStatus | 
getCurrentStatus(Connection dmsConn, java.lang.String taskName)Returns the current status of the task.  | 
static long | 
getExecutionDuration(Connection dmsConn, java.lang.String taskName)Returns the duration of the execution of a succesfully completed task.  | 
static ExecutionHandle | 
getExecutionHandle(Connection dmsConn, java.lang.String taskName, java.lang.String execID)Execution handle associated with the specified task and the id.  | 
static ExecutionHandle | 
getLatestExecutionHandle(Connection dmsConn, java.lang.String taskName)Latest execution handle associated with the task.  | 
 java.lang.String | 
getName()Returns the task name of a stored mining task, because name is assigned to a task only after storing the task in DMS.  | 
static MiningTaskStatus[] | 
getStatusHistory(Connection dmsConn, java.lang.String taskName)Returns an array of task statuses sorted by timestamp in decending order of the status entry timestamp.  | 
static java.lang.String | 
getTaskType(Connection dmsConn, java.lang.String taskName)Returns the task type of a mining task.  | 
 MiningTaskType | 
getType()Returns the task Type Enumeration  | 
static MiningTask[] | 
listTasks(Connection dmsConn, MiningTaskState currentState, java.util.Date afterStateEntryTime, java.util.Date beforeStateEntryTime)Returns the tasks that are currently in the specified state.  | 
static boolean | 
remove(Connection dmsConn, java.lang.String taskName)Removes the named task from the database.  | 
static boolean | 
rename(Connection dmsConn, java.lang.String oldTaskName, java.lang.String newTaskName)Renames the specified mining task.  | 
 void | 
store(Connection dmsConn, java.lang.String taskName)Persist the mining task details in the DMS with the specified name.  | 
static void | 
terminate(Connection dmsConn, java.lang.String taskName)Terminates (kills) a queued/initiated/executing task in the DMS.  | 
 MiningTaskStatus | 
waitForCompletion(Connection dmsConn)Waits for task completion after executing the task.  | 
 MiningTaskStatus | 
waitForCompletion(Connection dmsConn, long timeOutInSeconds)Waits for the task completion after executing the task.  | 
| Methods inherited from class java.lang.Object | 
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
public void store(Connection dmsConn,
                  java.lang.String taskName)
           throws InvalidArgumentException,
MiningTaskException,
                  java.sql.SQLException,
ODMException
dmsConn - Data mining server connection.taskName - Task name.InvalidArgumentException - is throwndmsConn or taskName is nulltaskName length > 25MiningTaskException - is throwntaskName is already in useSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLExceptionODMExceptionpublic java.lang.String getName()
public MiningTaskType getType()
public static java.lang.String getTaskType(Connection dmsConn,
                                           java.lang.String taskName)
                                    throws InvalidArgumentException,
MiningTaskException,
                                           java.sql.SQLException
InvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public ExecutionHandle execute(Connection dmsConn)
                                            throws InvalidArgumentException,
MiningTaskException,
                                                   java.sql.SQLException
MiningTask must be stored before executing it. This method returns after enqueuing the task to the specified DMS. To wait for task completion, use waitForCompletion(dmsConn) method.dmsConn - Data mining server connectionInvalidArgumentException - is throwndmsConn is nullMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public MiningTaskStatus waitForCompletion(Connection dmsConn)
                                                       throws InvalidArgumentException,
MiningTaskException,
                                                              java.sql.SQLException
dmsConn - Data mining server connectionInvalidArgumentException - is throwndmsConn is nullMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public MiningTaskStatus waitForCompletion(Connection dmsConn,
                                          long timeOutInSeconds)
                                                       throws InvalidArgumentException,
MiningTaskException,
                                                              java.sql.SQLException
dmsConn - Data mining server connectiontimeOutInSeconds - number of seconds until the method will return unless it returns sooner because the task completesInvalidArgumentException - is throwndmsConn is nullMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public static MiningTaskStatus getCurrentStatus(Connection dmsConn,
                                                java.lang.String taskName)
                                                             throws InvalidArgumentException,
MiningTaskException,
                                                                    java.sql.SQLException
dmsConn - Data mining server connectiontaskName - Name of the taskInvalidArgumentException - is thrownMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public static MiningTaskStatus[] getStatusHistory(Connection dmsConn,
                                                  java.lang.String taskName)
                                                               throws InvalidArgumentException,
MiningTaskException,
                                                                      java.sql.SQLException,
ODMException
dmsConn - Data mining server connectiontaskName - Name of the taskMiningTaskStatus[] - history of statusesInvalidArgumentException - is throwndmsConn or taskName are null or if the taskName length exceeds the limitMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLExceptionODMException
public static void terminate(Connection dmsConn,
                             java.lang.String taskName)
                      throws InvalidArgumentException,
MiningTaskException,
                             java.sql.SQLException,
ODMException
dmsConn - Data mining server connectiontaskName - Name of the taskInvalidArgumentException - is throwndmsConn or taskName are nulltaskName length exceeds the limitMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLExceptionODMException
public static boolean rename(Connection dmsConn,
                             java.lang.String oldTaskName,
                             java.lang.String newTaskName)
                      throws java.sql.SQLException,
MiningObjectException,
InvalidArgumentException,
ODMException
dmsConn - A connection to the data mining serveroldTaskName - The name of the mining task to be renamednewTaskName - The new name of the mining task to be assignedboolean - A flag indicating whether the specified object has been renamed successfully.InvalidArgumentException - is throwndmsConn is null, oroldTaskName is null,newTaskName is null.ODMException - is thrownoldTaskName is empty or exceeds 64 characters in length.newTaskName is empty or length exceeds 25 characters.SQLException - is thrownjava.sql.SQLExceptionMiningObjectException
public static boolean remove(Connection dmsConn,
                             java.lang.String taskName)
                      throws InvalidArgumentException,
MiningTaskException,
                             java.sql.SQLException,
ODMException
dmsConn - Data mining server connectiontaskName - Name of the taskInvalidArgumentException - is throwndmsConn or taskName are null or taskName length exceeds 64 characters in length.MiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLExceptionODMException
public static MiningTask[] listTasks(Connection dmsConn,
MiningTaskState currentState,
                                     java.util.Date afterStateEntryTime,
                                     java.util.Date beforeStateEntryTime)
                                                  throws InvalidArgumentException,
MiningTaskException,
                                                         java.sql.SQLException,
ODMException
listTasks(dmsConn, MiningTaskState.executing, null, null);To list the tasks currently at a specified state and their state entry time is after 'afterStateEntryTime', invoke
listTasks(dmsConn, MiningTaskState.executing, afterStateEntryTime, null);Similarly, to list the tasks currently at a specified state and their state entry time is before 'beforeStateEntryTime', invoke
listTasks(dmsConn, MiningTaskState.executing, null, beforeStateEntryTime);To list the tasks currently at a specified state whose state entry time is between 'afterStateEntryTime' and 'beforeStateEntryTime', invoke
listTasks(dmsConn, MiningTaskState.executing, afterStateEntryTime, beforeStateEntryTime);listTasks(dmsConn, null, null, null);dmsConn - Data mining server connectioncurrentState - Current state of the taskafterStateEntryTime - After the task state entry timebeforeStateEntryTime - Before the task state entry timeInvalidArgumentException - is throwndmsConn is nullMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLExceptionODMException
public static long getExecutionDuration(Connection dmsConn,
                                        java.lang.String taskName)
                                 throws InvalidArgumentException,
MiningTaskException,
                                        java.sql.SQLException,
ODMException
dmsConn - Data mining server connectiontaskName - Name of the taskInvalidArgumentException - is thrownMiningTaskException - is thrownjava.sql.SQLException - is thrownODMException
public static ExecutionHandle getActiveExecutionHandle(Connection dmsConn,
                                                       java.lang.String taskName)
                                                                    throws InvalidArgumentException,
MiningTaskException,
                                                                           java.sql.SQLException
dmsConn - Data mining server connectiontaskName - Name of the taskInvalidArgumentException - is throwndmsConn is null - when the taskName is null or length exceeds the limitMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public static ExecutionHandle getLatestExecutionHandle(Connection dmsConn,
                                                       java.lang.String taskName)
                                                                    throws InvalidArgumentException,
MiningTaskException,
                                                                           java.sql.SQLException
dmsConn - Data mining server connectiontaskName - Name of the taskInvalidArgumentException - is throwndmsConn is null - when the taskName is null or length exceeds the limitMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException
public static ExecutionHandle getExecutionHandle(Connection dmsConn,
                                                 java.lang.String taskName,
                                                 java.lang.String execID)
                                                              throws InvalidArgumentException,
MiningTaskException,
                                                                     java.sql.SQLException
dmsConn - Data mining server connectiontaskName - Name of the taskexecID - execution id of the taskInvalidArgumentException - is throwndmsConn is null - when the taskName is null or length exceeds the limitMiningTaskException - is thrownSQLException - is thrownInvalidArgumentExceptionMiningTaskExceptionjava.sql.SQLException 
  | 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||