|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.manifoldcf.core.database.BaseTable
org.apache.manifoldcf.crawler.jobs.Jobs
public class Jobs
This class manages the jobs table.
| Nested Class Summary | |
|---|---|
protected static class |
Jobs.JobObjectDescription
Job object description class. |
protected static class |
Jobs.JobObjectExecutor
This is the executor object for locating job objects. |
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
protected ICacheManager |
cacheManager
|
protected IRepositoryConnectionManager |
connectionMgr
|
static java.lang.String |
connectionNameField
|
static java.lang.String |
descriptionField
|
static java.lang.String |
documentSpecField
|
static java.lang.String |
endTimeField
If inactive, the end time of the LAST session, if any. |
static java.lang.String |
errorField
If non-null, this is the last error that occurred (which aborted the last task, either running the job or doing the delete cleanup). |
static java.lang.String |
expirationField
This is the expiration time of documents for a given job (in ms.) |
static int |
HOPCOUNT_ACCURATE
|
static int |
HOPCOUNT_NEVERDELETE
|
static int |
HOPCOUNT_NODELETE
|
static java.lang.String |
hopcountModeField
For a job whose connector supports hopcounts, this describes how those hopcounts are handled. |
protected HopFilterManager |
hopFilterManager
|
protected static java.util.Map |
hopmodeMap
|
static java.lang.String |
idField
|
static java.lang.String |
intervalField
This is the minimum reschedule interval for a document being crawled adaptively (in ms.) |
static java.lang.String |
lastCheckTimeField
The time of the LAST session, if any. |
static java.lang.String |
lastTimeField
The last time this job was assessed, in ms. |
protected IOutputConnectionManager |
outputMgr
|
static java.lang.String |
outputNameField
|
static java.lang.String |
outputSpecField
|
static java.lang.String |
priorityField
This is the job's priority vs. |
static java.lang.String |
reseedIntervalField
If this is an adaptive job, what should the reseed interval be (in milliseconds) |
static java.lang.String |
reseedTimeField
For an adaptive job, this is the next time to reseed the job. |
protected ScheduleManager |
scheduleManager
|
static int |
START_DISABLE
|
static int |
START_WINDOWBEGIN
|
static int |
START_WINDOWINSIDE
|
protected static java.util.Map |
startMap
|
static java.lang.String |
startMethodField
How/when to start the job |
static java.lang.String |
startTimeField
If active, paused, activewait, or pausedwait, the start time of the current session, else null. |
static int |
STATUS_ABORTING
|
static int |
STATUS_ABORTINGFORRESTART
|
static int |
STATUS_ABORTINGFORRESTARTSEEDING
|
static int |
STATUS_ABORTINGSEEDING
|
static int |
STATUS_ABORTINGSTARTINGUP
|
static int |
STATUS_ABORTINGSTARTINGUPFORRESTART
|
static int |
STATUS_ACTIVE
|
static int |
STATUS_ACTIVE_NEITHER
|
static int |
STATUS_ACTIVE_NOOUTPUT
|
static int |
STATUS_ACTIVE_UNINSTALLED
|
static int |
STATUS_ACTIVESEEDING
|
static int |
STATUS_ACTIVESEEDING_NEITHER
|
static int |
STATUS_ACTIVESEEDING_NOOUTPUT
|
static int |
STATUS_ACTIVESEEDING_UNINSTALLED
|
static int |
STATUS_ACTIVEWAIT
|
static int |
STATUS_ACTIVEWAITSEEDING
|
static int |
STATUS_DELETESTARTINGUP
|
static int |
STATUS_DELETING
|
static int |
STATUS_DELETING_NOOUTPUT
|
static int |
STATUS_INACTIVE
|
static int |
STATUS_NOTIFYINGOFCOMPLETION
|
static int |
STATUS_PAUSED
|
static int |
STATUS_PAUSEDSEEDING
|
static int |
STATUS_PAUSEDWAIT
|
static int |
STATUS_PAUSEDWAITSEEDING
|
static int |
STATUS_READYFORDELETE
|
static int |
STATUS_READYFORNOTIFY
|
static int |
STATUS_READYFORSTARTUP
|
static int |
STATUS_SHUTTINGDOWN
|
static int |
STATUS_STARTINGUP
|
static java.lang.String |
statusField
Status of this job. |
protected static java.util.Map |
statusMap
|
protected IThreadContext |
threadContext
|
static int |
TYPE_CONTINUOUS
|
static int |
TYPE_SPECIFIED
|
static java.lang.String |
typeField
|
protected static java.util.Map |
typeMap
|
static java.lang.String |
windowEndField
If non-null, this is the time that the current execution window closes, in ms since epoch. |
| Fields inherited from class org.apache.manifoldcf.core.database.BaseTable |
|---|
dbInterface, tableName |
| Constructor Summary | |
|---|---|
Jobs(IThreadContext threadContext,
IDBInterface database)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
abortJob(java.lang.Long jobID,
java.lang.String errorText)
Abort a job. |
void |
abortRestartJob(java.lang.Long jobID)
Restart a job. |
boolean |
activeJobsPresent()
Return true if there is a job in either the ACTIVE or the ACTIVESEEDING state. |
void |
analyzeTables()
Analyze job tables that need analysis. |
boolean |
checkIfOutputReference(java.lang.String connectionName)
See if there's a reference to an output connection name. |
boolean |
checkIfReference(java.lang.String connectionName)
See if there's a reference to a connection name. |
boolean |
checkJobActive(java.lang.Long jobID)
Check whether a job's status indicates that it is in ACTIVE or ACTIVESEEDING state. |
boolean |
cleaningJobsPresent()
Return true if there is a job in the SHUTTINGDOWN state. |
IJobDescription |
create()
Create a job. |
void |
deinstall()
Uninstall. |
void |
delete(java.lang.Long id)
Delete a job. |
boolean |
deletingJobsPresent()
Return true if there is a job in the DELETING state. |
static java.lang.String |
enumeratedValueToString(EnumeratedValues values)
Go from enumerated value to string. |
IJobDescription[] |
findJobsForConnection(java.lang.String connectionName)
Get the job IDs associated with a given connection name. |
void |
finishAbortJob(java.lang.Long jobID,
long abortTime)
Finish a job (abort). |
void |
finishJob(java.lang.Long jobID,
long finishTime)
Finish a job. |
java.lang.String[] |
getActiveConnectionNames()
Get unique connection names for all active jobs. |
IResultSet |
getActiveJobConnections()
Get a list of active job identifiers and their associated connection names. |
IJobDescription[] |
getAll()
Get a list of all jobs which are not in the process of being deleted already. |
int |
getAnalyzeTime()
Come up with a maximum time (in minutes) for re-analyzing tables. |
protected static java.lang.String |
getJobIDKey(java.lang.Long jobID)
|
protected void |
getJobsChunk(java.util.Map returnValues,
java.lang.String idList,
java.util.ArrayList params)
Read a chunk of repository connections. |
protected static java.lang.String |
getJobsKey()
|
protected JobDescription[] |
getJobsMultiple(java.lang.Long[] ids)
Get multiple jobs (without caching) |
protected static java.lang.String |
getJobStatusKey()
|
boolean |
hasPriorityJobs(int priority)
Are there any jobs that have a specified priority level |
static java.lang.String |
hopcountModeToString(int value)
Go from hopcount mode to string. |
void |
install(java.lang.String outputTableName,
java.lang.String outputNameField,
java.lang.String connectionTableName,
java.lang.String connectionNameField)
Install or upgrade this table. |
IJobDescription |
load(java.lang.Long id,
boolean readOnly)
Load a job for editing. |
IJobDescription[] |
loadMultiple(java.lang.Long[] ids,
boolean[] readOnlies)
Load multiple jobs for editing. |
void |
noteConnectionChange(java.lang.String connectionName)
Note a change in connection configuration. |
void |
noteConnectorDeregistration(java.lang.Long jobID,
int oldStatusValue)
Signal to a job that its underlying connector has gone away. |
void |
noteConnectorRegistration(java.lang.Long jobID,
int oldStatusValue)
Signal to a job that its underlying connector has returned. |
void |
noteJobDeleteStarted(java.lang.Long jobID,
long startTime)
Put job into "deleting" state, and set the start time field. |
void |
noteJobSeeded(java.lang.Long jobID,
long seedTime)
Note job seeded. |
void |
noteJobStarted(java.lang.Long jobID,
long startTime)
Make job active, and set the start time field. |
void |
noteOutputConnectionChange(java.lang.String connectionName)
Note a change in output connection configuration. |
void |
noteOutputConnectorDeregistration(java.lang.Long jobID,
int oldStatusValue)
Signal to a job that its underlying output connector has gone away. |
void |
noteOutputConnectorRegistration(java.lang.Long jobID,
int oldStatusValue)
Signal to a job that its underlying output connector has returned. |
void |
notificationComplete(java.lang.Long jobID)
Mark job as having properly notified the output connector of completion. |
void |
pauseJob(java.lang.Long jobID)
Pause a job. |
ScheduleRecord[][] |
readScheduleRecords(java.lang.Long[] jobIDs)
Read schedule records for a specified set of jobs. |
void |
resetDeleteStartupWorkerStatus()
Reset delete startup worker thread status. |
void |
resetNotificationWorkerStatus()
Reset notification worker thread status. |
void |
resetSeedingWorkerStatus()
Reset as part of restoring seeding worker threads. |
void |
resetStartupWorkerStatus()
Reset startup worker thread status. |
void |
restart()
This method is called on a restart. |
void |
restartJob(java.lang.Long jobID)
Restart a job. |
void |
returnJobToActive(java.lang.Long jobID)
Put job back into active state, from the shutting-down state. |
void |
save(IJobDescription jobDescription)
Save a job description. |
void |
startJob(java.lang.Long jobID,
java.lang.Long windowEnd)
Write job status and window end, and clear the endtime field. |
static java.lang.String |
startMethodToString(int startMethod)
Get from start method to string. |
static java.lang.String |
statusToString(int status)
Go from status to string. |
static EnumeratedValues |
stringToEnumeratedValue(java.lang.String value)
Go from string to enumerated value. |
static int |
stringToHopcountMode(java.lang.String value)
Go from string to hopcount mode. |
static int |
stringToStartMethod(java.lang.String value)
Go from string to start method. |
static int |
stringToStatus(java.lang.String value)
Go from string to status. |
static int |
stringToType(java.lang.String value)
Go from string to type. |
static java.lang.String |
typeToString(int type)
Go from type to string. |
void |
unwaitJob(java.lang.Long jobID,
int newStatus,
java.lang.Long windowEnd)
Cause job that is in "wait" state to become un-waited. |
void |
updateLastTime(java.lang.Long jobID,
long currentTime)
Update a job's last-time field. |
void |
waitJob(java.lang.Long jobID,
int newStatus)
Cause job that is in active or paused state to become waited. |
void |
writeStatus(java.lang.Long jobID,
int status)
Update a job's status. |
void |
writeStatus(java.lang.Long jobID,
int status,
java.lang.Long reseedTime)
Update a job's status, and its reseed time. |
| Methods inherited from class org.apache.manifoldcf.core.database.BaseTable |
|---|
addTableIndex, analyzeTable, beginTransaction, constructDistinctOnClause, constructOffsetLimitClause, constructRegexpClause, constructSubstringClause, endTransaction, getDatabaseCacheKey, getDBInterface, getMaxInClause, getMaxOrClause, getTableIndexes, getTableName, getTableSchema, getTransactionID, makeTableKey, noteModifications, performAddIndex, performAlter, performCreate, performDelete, performDrop, performInsert, performLock, performModification, performQuery, performQuery, performRemoveIndex, performUpdate, prepareRowForSave, readRow, reindexTable, signalRollback |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String _rcsid
public static final int STATUS_INACTIVE
public static final int STATUS_ACTIVE
public static final int STATUS_PAUSED
public static final int STATUS_SHUTTINGDOWN
public static final int STATUS_ACTIVEWAIT
public static final int STATUS_PAUSEDWAIT
public static final int STATUS_ABORTING
public static final int STATUS_STARTINGUP
public static final int STATUS_ABORTINGSTARTINGUP
public static final int STATUS_READYFORSTARTUP
public static final int STATUS_READYFORDELETE
public static final int STATUS_ACTIVESEEDING
public static final int STATUS_ABORTINGSEEDING
public static final int STATUS_PAUSEDSEEDING
public static final int STATUS_ACTIVEWAITSEEDING
public static final int STATUS_PAUSEDWAITSEEDING
public static final int STATUS_ABORTINGFORRESTART
public static final int STATUS_ABORTINGFORRESTARTSEEDING
public static final int STATUS_ABORTINGSTARTINGUPFORRESTART
public static final int STATUS_READYFORNOTIFY
public static final int STATUS_NOTIFYINGOFCOMPLETION
public static final int STATUS_DELETING
public static final int STATUS_DELETESTARTINGUP
public static final int STATUS_ACTIVE_UNINSTALLED
public static final int STATUS_ACTIVESEEDING_UNINSTALLED
public static final int STATUS_ACTIVE_NOOUTPUT
public static final int STATUS_ACTIVESEEDING_NOOUTPUT
public static final int STATUS_ACTIVE_NEITHER
public static final int STATUS_ACTIVESEEDING_NEITHER
public static final int STATUS_DELETING_NOOUTPUT
public static final int TYPE_CONTINUOUS
public static final int TYPE_SPECIFIED
public static final int START_WINDOWBEGIN
public static final int START_WINDOWINSIDE
public static final int START_DISABLE
public static final int HOPCOUNT_ACCURATE
public static final int HOPCOUNT_NODELETE
public static final int HOPCOUNT_NEVERDELETE
public static final java.lang.String idField
public static final java.lang.String descriptionField
public static final java.lang.String documentSpecField
public static final java.lang.String connectionNameField
public static final java.lang.String outputSpecField
public static final java.lang.String outputNameField
public static final java.lang.String typeField
public static final java.lang.String intervalField
public static final java.lang.String expirationField
public static final java.lang.String priorityField
public static final java.lang.String startMethodField
public static final java.lang.String reseedIntervalField
public static final java.lang.String statusField
public static final java.lang.String lastTimeField
public static final java.lang.String startTimeField
public static final java.lang.String lastCheckTimeField
public static final java.lang.String endTimeField
public static final java.lang.String windowEndField
public static final java.lang.String errorField
public static final java.lang.String reseedTimeField
public static final java.lang.String hopcountModeField
protected static java.util.Map statusMap
protected static java.util.Map typeMap
protected static java.util.Map startMap
protected static java.util.Map hopmodeMap
protected ICacheManager cacheManager
protected ScheduleManager scheduleManager
protected HopFilterManager hopFilterManager
protected IOutputConnectionManager outputMgr
protected IRepositoryConnectionManager connectionMgr
protected IThreadContext threadContext
| Constructor Detail |
|---|
public Jobs(IThreadContext threadContext,
IDBInterface database)
throws ManifoldCFException
database - is the database handle.
ManifoldCFException| Method Detail |
|---|
public void install(java.lang.String outputTableName,
java.lang.String outputNameField,
java.lang.String connectionTableName,
java.lang.String connectionNameField)
throws ManifoldCFException
ManifoldCFException
public void deinstall()
throws ManifoldCFException
ManifoldCFException
public int getAnalyzeTime()
throws ManifoldCFException
ManifoldCFException
public void analyzeTables()
throws ManifoldCFException
ManifoldCFException
public ScheduleRecord[][] readScheduleRecords(java.lang.Long[] jobIDs)
throws ManifoldCFException
ManifoldCFException
public IJobDescription[] getAll()
throws ManifoldCFException
ManifoldCFException
public IResultSet getActiveJobConnections()
throws ManifoldCFException
ManifoldCFException
public java.lang.String[] getActiveConnectionNames()
throws ManifoldCFException
ManifoldCFException
public boolean hasPriorityJobs(int priority)
throws ManifoldCFException
ManifoldCFException
public IJobDescription create()
throws ManifoldCFException
ManifoldCFException
public void delete(java.lang.Long id)
throws ManifoldCFException
id - is the job id.
ManifoldCFException
public IJobDescription load(java.lang.Long id,
boolean readOnly)
throws ManifoldCFException
id - is the job id.
ManifoldCFException
public IJobDescription[] loadMultiple(java.lang.Long[] ids,
boolean[] readOnlies)
throws ManifoldCFException
ids - is the set of id's to loadreadOnlies - are boolean values, set to true if the job description to be read is to be designated "read only".
ManifoldCFException
public void save(IJobDescription jobDescription)
throws ManifoldCFException
jobDescription - is the job description.
ManifoldCFException
public void restart()
throws ManifoldCFException
ManifoldCFException
public void noteOutputConnectorDeregistration(java.lang.Long jobID,
int oldStatusValue)
throws ManifoldCFException
jobID - is the identifier of the job.oldStatusValue - is the current status value for the job.
ManifoldCFException
public void noteOutputConnectorRegistration(java.lang.Long jobID,
int oldStatusValue)
throws ManifoldCFException
jobID - is the identifier of the job.oldStatusValue - is the current status value for the job.
ManifoldCFException
public void noteConnectorDeregistration(java.lang.Long jobID,
int oldStatusValue)
throws ManifoldCFException
jobID - is the identifier of the job.oldStatusValue - is the current status value for the job.
ManifoldCFException
public void noteConnectorRegistration(java.lang.Long jobID,
int oldStatusValue)
throws ManifoldCFException
jobID - is the identifier of the job.oldStatusValue - is the current status value for the job.
ManifoldCFException
public void noteConnectionChange(java.lang.String connectionName)
throws ManifoldCFException
ManifoldCFException
public void noteOutputConnectionChange(java.lang.String connectionName)
throws ManifoldCFException
ManifoldCFException
public boolean checkJobActive(java.lang.Long jobID)
throws ManifoldCFException
ManifoldCFException
public void resetDeleteStartupWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void resetNotificationWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void resetStartupWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void resetSeedingWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void startJob(java.lang.Long jobID,
java.lang.Long windowEnd)
throws ManifoldCFException
jobID - is the job identifier.windowEnd - is the window end time, if any
ManifoldCFException
public void returnJobToActive(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public void noteJobDeleteStarted(java.lang.Long jobID,
long startTime)
throws ManifoldCFException
jobID - is the job identifier.startTime - is the current time in milliseconds from start of epoch.
ManifoldCFException
public void noteJobStarted(java.lang.Long jobID,
long startTime)
throws ManifoldCFException
jobID - is the job identifier.startTime - is the current time in milliseconds from start of epoch.
ManifoldCFException
public void noteJobSeeded(java.lang.Long jobID,
long seedTime)
throws ManifoldCFException
jobID - is the job id.seedTime - is the job seed time.
ManifoldCFException
public void unwaitJob(java.lang.Long jobID,
int newStatus,
java.lang.Long windowEnd)
throws ManifoldCFException
jobID - is the job identifier.newStatus - is the new status (either STATUS_ACTIVE or STATUS_PAUSED or
STATUS_ACTIVESEEDING or STATUS_PAUSEDSEEDING)windowEnd - is the window end time, if any.
ManifoldCFException
public void waitJob(java.lang.Long jobID,
int newStatus)
throws ManifoldCFException
jobID - is the job identifier.newStatus - is the new status (either STATUS_ACTIVEWAIT or STATUS_PAUSEDWAIT or
STATUS_ACTIVEWAITSEEDING or STATUS_PAUSEDWAITSEEDING)
ManifoldCFException
public boolean abortJob(java.lang.Long jobID,
java.lang.String errorText)
throws ManifoldCFException
jobID - is the job id.errorText - is the error, or null if none.
ManifoldCFException
public void abortRestartJob(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job id.
ManifoldCFException
public void pauseJob(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job id.
ManifoldCFException
public void restartJob(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job id.
ManifoldCFException
public void writeStatus(java.lang.Long jobID,
int status,
java.lang.Long reseedTime)
throws ManifoldCFException
jobID - is the job id.status - is the desired status.reseedTime - is the reseed time.
ManifoldCFException
public void writeStatus(java.lang.Long jobID,
int status)
throws ManifoldCFException
jobID - is the job id.status - is the desired status.
ManifoldCFException
public void updateLastTime(java.lang.Long jobID,
long currentTime)
throws ManifoldCFException
jobID - is the job id.currentTime - is the current time.
ManifoldCFException
public void finishJob(java.lang.Long jobID,
long finishTime)
throws ManifoldCFException
jobID - is the job id.finishTime - is the finish time.
ManifoldCFException
public void finishAbortJob(java.lang.Long jobID,
long abortTime)
throws ManifoldCFException
jobID - is the job id.
ManifoldCFException
public void notificationComplete(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job id.
ManifoldCFException
public boolean checkIfReference(java.lang.String connectionName)
throws ManifoldCFException
connectionName - is the name of the connection.
ManifoldCFException
public boolean checkIfOutputReference(java.lang.String connectionName)
throws ManifoldCFException
connectionName - is the name of the connection.
ManifoldCFException
public IJobDescription[] findJobsForConnection(java.lang.String connectionName)
throws ManifoldCFException
connectionName - is the name of the connection.
ManifoldCFException
public boolean deletingJobsPresent()
throws ManifoldCFException
ManifoldCFException
public boolean cleaningJobsPresent()
throws ManifoldCFException
ManifoldCFException
public boolean activeJobsPresent()
throws ManifoldCFException
ManifoldCFException
public static int stringToStatus(java.lang.String value)
throws ManifoldCFException
value - is the string.
ManifoldCFException
public static java.lang.String statusToString(int status)
throws ManifoldCFException
status - is the status.
ManifoldCFException
public static int stringToType(java.lang.String value)
throws ManifoldCFException
value - is the string.
ManifoldCFException
public static java.lang.String typeToString(int type)
throws ManifoldCFException
type - is the type.
ManifoldCFException
public static int stringToHopcountMode(java.lang.String value)
throws ManifoldCFException
ManifoldCFException
public static java.lang.String hopcountModeToString(int value)
throws ManifoldCFException
ManifoldCFException
public static int stringToStartMethod(java.lang.String value)
throws ManifoldCFException
value - is the string.
ManifoldCFException
public static java.lang.String startMethodToString(int startMethod)
throws ManifoldCFException
startMethod - is the start method.
ManifoldCFException
public static EnumeratedValues stringToEnumeratedValue(java.lang.String value)
throws ManifoldCFException
value - is the input.
ManifoldCFExceptionpublic static java.lang.String enumeratedValueToString(EnumeratedValues values)
values - is the enumerated value.
protected static java.lang.String getJobsKey()
protected static java.lang.String getJobIDKey(java.lang.Long jobID)
protected static java.lang.String getJobStatusKey()
protected JobDescription[] getJobsMultiple(java.lang.Long[] ids)
throws ManifoldCFException
ids - is the set of ids to get jobs for.
ManifoldCFException
protected void getJobsChunk(java.util.Map returnValues,
java.lang.String idList,
java.util.ArrayList params)
throws ManifoldCFException
returnValues - is keyed by id and contains a JobDescription value.idList - is the list of id's.params - is the set of parameters.
ManifoldCFException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||