|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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 DMS. 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 in the DMS using the
store(dmsConn, taskName)
method before execution.
A mining task can be executed only once; it cannot be re-executed.
The DMS stores the state information of a task. When a
MiningTask
object is created and stored in the DMS it
is the ready
state. A mining task can be executed
only when it is in ready state. Once created, a MiningTask
goes through
the following states:
queued
- task is in the DMS Queue initiated
- task is dequeued and waiting to execute executing
- task is actually getting executed in the DMS success
- if the task got successfully completed,error
- if the task failed to complete. terminating
state. After succeefully terminating, the task
state will come to terminated
state.
A task status history is persisted in the DMS 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 in the DMS, invoke
listTasks(dmsConn, MiningTaskState.executing, null, null)
oracle.dmt.odm.MiningTaskState
,
oracle.dmt.odm.task.MiningTaskStatus
, Serialized FormMethod Summary |
Type | Method |
---|---|
void |
execute(Connection dmsConn)
Submits the mining task for asynchronous execution in the DMS. |
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. |
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 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 void |
remove(Connection dmsConn,
java.lang.String taskName)
Removes the named task from the DMS. |
void |
store(Connection dmsConn,
java.lang.String taskName)
Persists persist the mining task details in the DMS with the specified name. |
static void |
terminate(Connection dmsConn,
java.lang.String taskName)
Terminates 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 oracle.dmt.odm.LocatableObject |
deserialize, serialize |
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 thrown dmsConn
or taskName
is null taskName
length > 64MiningTaskException
- is thrown taskName
is already in use SQLException
- is thrown public java.lang.String getName()
public void 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 thrown dmsConn
is nullMiningTaskException
- is thrown SQLException
- is thrown public MiningTaskStatus waitForCompletion(Connection dmsConn) throws InvalidArgumentException, MiningTaskException, java.sql.SQLException
dmsConn
- Data mining server connectionInvalidArgumentException
- is thrown dmsConn
is nullMiningTaskException
- is thrown SQLException
- is thrown 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 completesMiningTaskStatus
- status of the task, after completionInvalidArgumentException
- is thrown dmsConn
is nullMiningTaskException
- is thrown SQLException
- is thrown public static MiningTaskStatus getCurrentStatus(Connection dmsConn, java.lang.String taskName) throws InvalidArgumentException, MiningTaskException, java.sql.SQLException
dmsConn
- Data mining server connectiontaskName
- Name of the taskMiningTaskStatus
- current task statusInvalidArgumentException
- is thrown MiningTaskException
- is thrown SQLException
- is thrown 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 thrown dmsConn
or taskName
are null or if the taskName
length is >64MiningTaskException
- is thrown SQLException
- is thrown public static void terminate(Connection dmsConn, java.lang.String taskName) throws InvalidArgumentException, MiningTaskException, java.sql.SQLException, ODMException, ODMException
dmsConn
- Data mining server connectiontaskName
- Name of the taskInvalidArgumentException
- is thrown dmsConn
or taskName
are null taskName
length is >64MiningTaskException
- is thrown SQLException
- is thrown public static void remove(Connection dmsConn, java.lang.String taskName) throws InvalidArgumentException, MiningTaskException, java.sql.SQLException, ODMException
dmsConn
- Data mining server connectiontaskName
- Name of the taskInvalidArgumentException
- is thrown dmsConn
or taskName
are null or taskName
length is >64MiningTaskException
- is thrown SQLException
- is thrown 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);
dmsConn
- Data mining server connectioncurrentState
- Current state of the taskafterStateEntryTime
- After the task state entry timebeforeStateEntryTime
- Before the task state entry timeInvalidArgumentException
- is thrown dmsConn
or currentState
is nullMiningTaskException
- is thrown SQLException
- is thrown public static long getExecutionDuration(Connection dmsConn, java.lang.String taskName) throws InvalidArgumentException, MiningTaskException, java.sql.SQLException, ODMException
InvalidArgumentException
- is thrown MiningTaskException
- is thrown java.sql.SQLException
- is thrown
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |