|
|||||||||
| 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.JobQueue
public class JobQueue
This is the job queue manager class. It is responsible for managing the jobqueue database table.
| Nested Class Summary | |
|---|---|
protected static class |
JobQueue.DuplicateFinder
|
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
static int |
ACTION_REMOVE
|
static int |
ACTION_RESCAN
|
protected static java.util.Map |
actionMap
|
static java.lang.String |
checkActionField
|
static java.lang.String |
checkTimeField
|
static java.lang.String |
docHashField
|
static java.lang.String |
docIDField
|
static java.lang.String |
docPriorityField
|
static java.lang.String |
failCountField
|
static java.lang.String |
failTimeField
|
static java.lang.String |
idField
|
static java.lang.String |
isSeedField
|
static java.lang.String |
jobIDField
|
protected PrereqEventManager |
prereqEventManager
Prerequisite event manager |
static java.lang.String |
prioritySetField
|
static int |
SEEDSTATUS_NEWSEED
|
static int |
SEEDSTATUS_NOTSEED
|
static int |
SEEDSTATUS_SEED
|
protected static java.util.Map |
seedstatusMap
|
static int |
STATUS_ACTIVE
|
static int |
STATUS_ACTIVENEEDRESCAN
|
static int |
STATUS_ACTIVENEEDRESCANPURGATORY
|
static int |
STATUS_ACTIVEPURGATORY
|
static int |
STATUS_BEINGCLEANED
|
static int |
STATUS_BEINGDELETED
|
static int |
STATUS_COMPLETE
|
static int |
STATUS_ELIGIBLEFORDELETE
|
static int |
STATUS_PENDING
|
static int |
STATUS_PENDINGPURGATORY
|
static int |
STATUS_PURGATORY
|
static java.lang.String |
statusField
|
protected static java.util.Map |
statusMap
|
protected IThreadContext |
threadContext
Thread context |
| Fields inherited from class org.apache.manifoldcf.core.database.BaseTable |
|---|
dbInterface, tableName |
| Constructor Summary | |
|---|---|
JobQueue(IThreadContext tc,
IDBInterface database)
Constructor. |
|
| Method Summary | |
|---|---|
static java.lang.String |
actionToString(int action)
Convert integer to action string |
void |
addRemainingDocumentsInitial(java.lang.Long jobID,
java.lang.String[] docIDHashes)
Note the remaining documents that do NOT need to be queued. |
boolean |
checkJobBusy(java.lang.Long jobID)
Check if there are any outstanding active documents for a job |
void |
clearFailTimes(java.lang.Long jobID)
Clear the failtimes for all documents associated with a job. |
void |
deinstall()
Uninstall. |
void |
deleteAllJobRecords(java.lang.Long jobID)
For a job deletion: Delete all records for a job. |
void |
deleteIngestedDocumentIdentifiers(DocumentDescription[] identifiers)
Delete ingested document identifiers (as part of deleting the owning job). |
void |
deleteRecord(java.lang.Long id)
Remove a record entirely. |
void |
deleteRecordMultiple(java.lang.Long[] ids)
Remove multiple records entirely. |
protected void |
doDeletes(java.util.ArrayList list,
java.lang.String queryPart)
Do a batch of deletes. |
void |
doneDocumentsInitial(java.lang.Long jobID,
boolean isPartial)
Complete the initial set of documents. |
java.lang.String[] |
getAllSeeds(java.lang.Long jobID)
Get all the current seeds. |
static java.lang.String |
getHashCode(java.lang.String documentIdentifier)
Get a hash value from a document id string. |
void |
insertNewRecord(java.lang.Long jobID,
java.lang.String docIDHash,
java.lang.String docID,
double desiredDocPriority,
long desiredExecuteTime,
long currentTime,
java.lang.String[] prereqEvents)
Insert a new record into the jobqueue table (as part of adding a child reference). |
void |
insertNewRecordInitial(java.lang.Long jobID,
java.lang.String docHash,
java.lang.String docID,
double desiredDocPriority,
long desiredExecuteTime,
long currentTime,
java.lang.String[] prereqEvents)
Insert a new record into the jobqueue table (as part of adding an initial reference). |
void |
install(java.lang.String jobsTable,
java.lang.String jobsColumn)
Install or upgrade. |
void |
prepareDeleteScan(java.lang.Long jobID)
Prepare for a job delete pass. |
void |
prepareFullScan(java.lang.Long jobID)
Prepare for a "full scan" job. |
void |
prepareIncrementalScan(java.lang.Long jobID)
Prepare for an "incremental" job. |
protected void |
processRemainingDocuments(java.util.Map idMap,
java.lang.String query,
java.util.ArrayList list,
java.util.Map inSet)
Process the specified set of documents. |
void |
resetDocCleanupWorkerStatus()
Reset doc cleaning worker status. |
void |
resetDocDeleteWorkerStatus()
Reset doc delete worker status. |
void |
resetDocumentWorkerStatus()
Reset as part of restoring document worker threads. |
void |
restart()
Restart. |
static java.lang.String |
seedstatusToString(int status)
Convert seedstatus value to a string. |
void |
setCleaningStatus(java.lang.Long id)
Set the status of a document to "being cleaned". |
void |
setDeletingStatus(java.lang.Long id)
Set the status of a document to "being deleted". |
void |
setStatus(java.lang.Long id,
int status,
java.lang.Long checkTime,
int action,
long failTime,
int failCount)
Set the status on a record, including check time and priority. |
void |
setUncleaningStatus(java.lang.Long id,
long checkTime)
Set the status of a document to be "no longer cleaning" |
void |
setUndeletingStatus(java.lang.Long id,
long checkTime)
Set the status of a document to be "no longer deleting" |
static java.lang.String |
statusToString(int status)
Convert status to string. |
static int |
stringToAction(java.lang.String value)
Convert action field value to integer. |
static int |
stringToSeedstatus(java.lang.String x)
Convert seedstatus field value to a boolean. |
static int |
stringToStatus(java.lang.String value)
Convert status field value to integer. |
void |
unconditionallyAnalyzeTables()
Analyze job tables due to major event |
void |
updateActiveRecord(java.lang.Long id,
int currentStatus)
Set the status to active on a record, leaving alone priority or check time. |
void |
updateCompletedRecord(java.lang.Long recID,
int currentStatus)
Set the "completed" status for a record. |
boolean |
updateExistingRecord(java.lang.Long recordID,
int currentStatus,
java.lang.Long checkTimeValue,
long desiredExecuteTime,
long currentTime,
boolean otherChangesSeen,
double desiredPriority,
java.lang.String[] prereqEvents)
Update an existing record (as the result of a reference add). |
boolean |
updateExistingRecordInitial(java.lang.Long recordID,
int currentStatus,
java.lang.Long checkTimeValue,
long desiredExecuteTime,
long currentTime,
double desiredPriority,
java.lang.String[] prereqEvents)
Update an existing record (as the result of an initial add). |
protected void |
updateRemainingDocuments(java.lang.String query,
java.util.ArrayList list)
Update the specified set of documents to be "NEWSEED" |
void |
writeDocPriority(long currentTime,
java.lang.Long rowID,
double priority)
Write out a document priority |
| 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 SEEDSTATUS_NOTSEED
public static final int SEEDSTATUS_SEED
public static final int SEEDSTATUS_NEWSEED
public static final int STATUS_PENDING
public static final int STATUS_ACTIVE
public static final int STATUS_COMPLETE
public static final int STATUS_PENDINGPURGATORY
public static final int STATUS_ACTIVEPURGATORY
public static final int STATUS_PURGATORY
public static final int STATUS_BEINGDELETED
public static final int STATUS_ACTIVENEEDRESCAN
public static final int STATUS_ACTIVENEEDRESCANPURGATORY
public static final int STATUS_BEINGCLEANED
public static final int STATUS_ELIGIBLEFORDELETE
public static final int ACTION_RESCAN
public static final int ACTION_REMOVE
public static final java.lang.String idField
public static final java.lang.String jobIDField
public static final java.lang.String docHashField
public static final java.lang.String docIDField
public static final java.lang.String checkTimeField
public static final java.lang.String statusField
public static final java.lang.String failTimeField
public static final java.lang.String failCountField
public static final java.lang.String isSeedField
public static final java.lang.String docPriorityField
public static final java.lang.String prioritySetField
public static final java.lang.String checkActionField
protected static java.util.Map statusMap
protected static java.util.Map seedstatusMap
protected static java.util.Map actionMap
protected PrereqEventManager prereqEventManager
protected IThreadContext threadContext
| Constructor Detail |
|---|
public JobQueue(IThreadContext tc,
IDBInterface database)
throws ManifoldCFException
database - is the database handle.
ManifoldCFException| Method Detail |
|---|
public void install(java.lang.String jobsTable,
java.lang.String jobsColumn)
throws ManifoldCFException
ManifoldCFException
public void unconditionallyAnalyzeTables()
throws ManifoldCFException
ManifoldCFException
public void deinstall()
throws ManifoldCFException
ManifoldCFException
public void restart()
throws ManifoldCFException
ManifoldCFException
public void clearFailTimes(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public void resetDocumentWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void resetDocDeleteWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void resetDocCleanupWorkerStatus()
throws ManifoldCFException
ManifoldCFException
public void prepareDeleteScan(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public void prepareFullScan(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public void prepareIncrementalScan(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public void deleteIngestedDocumentIdentifiers(DocumentDescription[] identifiers)
throws ManifoldCFException
identifiers - is the set of document identifiers.
ManifoldCFException
public boolean checkJobBusy(java.lang.Long jobID)
throws ManifoldCFException
ManifoldCFException
public void deleteAllJobRecords(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public void writeDocPriority(long currentTime,
java.lang.Long rowID,
double priority)
throws ManifoldCFException
ManifoldCFException
public void updateCompletedRecord(java.lang.Long recID,
int currentStatus)
throws ManifoldCFException
ManifoldCFException
public void updateActiveRecord(java.lang.Long id,
int currentStatus)
throws ManifoldCFException
id - is the job queue id.currentStatus - is the current status
ManifoldCFException
public void setStatus(java.lang.Long id,
int status,
java.lang.Long checkTime,
int action,
long failTime,
int failCount)
throws ManifoldCFException
id - is the job queue id.status - is the desired statuscheckTime - is the check time.
ManifoldCFException
public void setDeletingStatus(java.lang.Long id)
throws ManifoldCFException
ManifoldCFException
public void setUndeletingStatus(java.lang.Long id,
long checkTime)
throws ManifoldCFException
ManifoldCFException
public void setCleaningStatus(java.lang.Long id)
throws ManifoldCFException
ManifoldCFException
public void setUncleaningStatus(java.lang.Long id,
long checkTime)
throws ManifoldCFException
ManifoldCFException
public void deleteRecordMultiple(java.lang.Long[] ids)
throws ManifoldCFException
ids - is the set of job queue id's
ManifoldCFException
protected void doDeletes(java.util.ArrayList list,
java.lang.String queryPart)
throws ManifoldCFException
ManifoldCFException
public void deleteRecord(java.lang.Long id)
throws ManifoldCFException
id - is the job queue id.
ManifoldCFException
public boolean updateExistingRecordInitial(java.lang.Long recordID,
int currentStatus,
java.lang.Long checkTimeValue,
long desiredExecuteTime,
long currentTime,
double desiredPriority,
java.lang.String[] prereqEvents)
throws ManifoldCFException
ManifoldCFException
public void insertNewRecordInitial(java.lang.Long jobID,
java.lang.String docHash,
java.lang.String docID,
double desiredDocPriority,
long desiredExecuteTime,
long currentTime,
java.lang.String[] prereqEvents)
throws ManifoldCFException
jobID - is the job identifier.docHash - is the hash of the local document identifier.docID - is the local document identifier.
ManifoldCFException
public void addRemainingDocumentsInitial(java.lang.Long jobID,
java.lang.String[] docIDHashes)
throws ManifoldCFException
ManifoldCFException
protected void processRemainingDocuments(java.util.Map idMap,
java.lang.String query,
java.util.ArrayList list,
java.util.Map inSet)
throws ManifoldCFException
ManifoldCFException
protected void updateRemainingDocuments(java.lang.String query,
java.util.ArrayList list)
throws ManifoldCFException
ManifoldCFException
public void doneDocumentsInitial(java.lang.Long jobID,
boolean isPartial)
throws ManifoldCFException
jobID - is the job identifier.isPartial - is true of the passed list of seeds is not complete.
ManifoldCFException
public java.lang.String[] getAllSeeds(java.lang.Long jobID)
throws ManifoldCFException
jobID - is the job identifier.
ManifoldCFException
public boolean updateExistingRecord(java.lang.Long recordID,
int currentStatus,
java.lang.Long checkTimeValue,
long desiredExecuteTime,
long currentTime,
boolean otherChangesSeen,
double desiredPriority,
java.lang.String[] prereqEvents)
throws ManifoldCFException
ManifoldCFException
public void insertNewRecord(java.lang.Long jobID,
java.lang.String docIDHash,
java.lang.String docID,
double desiredDocPriority,
long desiredExecuteTime,
long currentTime,
java.lang.String[] prereqEvents)
throws ManifoldCFException
ManifoldCFException
public static java.lang.String seedstatusToString(int status)
throws ManifoldCFException
ManifoldCFException
public static int stringToSeedstatus(java.lang.String x)
throws ManifoldCFException
ManifoldCFException
public static int stringToAction(java.lang.String value)
throws ManifoldCFException
ManifoldCFException
public static java.lang.String actionToString(int action)
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 value.
ManifoldCFException
public static java.lang.String getHashCode(java.lang.String documentIdentifier)
throws ManifoldCFException
documentIdentifier - is the input document id string.
ManifoldCFException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||