Class Carrydown
- java.lang.Object
-
- org.apache.manifoldcf.core.database.BaseTable
-
- org.apache.manifoldcf.crawler.jobs.Carrydown
-
public class Carrydown extends BaseTable
This class manages the table that keeps track of intrinsic relationships between documents.
carrydownField Type Description jobid BIGINT Reference:jobs.id parentidhash VARCHAR(40) childidhash VARCHAR(40) dataname VARCHAR(255) datavaluehash VARCHAR(40) datavalue LONGTEXT isnew CHAR(1) processid VARCHAR(16)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classCarrydown.DuplicateFinderprotected static classCarrydown.ResultDuplicateEliminatorLimit checker which removes duplicate rows, based on datavaluehashprotected static classCarrydown.ValueRecord
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidstatic java.lang.StringchildIDHashFieldstatic java.lang.StringdataNameFieldstatic java.lang.StringdataValueFieldstatic java.lang.StringdataValueHashFieldprotected static intISNEW_BASEThe standard value for the "isnew" field.protected static intISNEW_EXISTINGThis value means that the link existed before, and has been found during this scan.protected static intISNEW_NEWThis value means that the link is brand-new; it did not exist before this pass.protected static java.util.MapisNewMapstatic java.lang.StringjobIDFieldstatic java.lang.StringnewFieldstatic java.lang.StringparentIDHashFieldstatic java.lang.StringprocessIDField-
Fields inherited from class org.apache.manifoldcf.core.database.BaseTable
dbInterface, tableName
-
-
Constructor Summary
Constructors Constructor Description Carrydown(IDBInterface database)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanalyzeTables()Analyze job tables that need analysis.voiddeinstall()Uninstall.voiddeleteOwner(java.lang.Long jobID)Delete an owning job (and clean up the corresponding carrydown rows).voiddeleteRecords(java.lang.Long jobID, java.lang.String[] documentIDHashes)Delete all records that mention a particular set of document identifiers.java.lang.String[]getDataValues(java.lang.Long jobID, java.lang.String documentIdentifierHash, java.lang.String dataName)Get unique values given a document identifier, data name, an job identifierCharacterInput[]getDataValuesAsFiles(java.lang.Long jobID, java.lang.String documentIdentifierHash, java.lang.String dataName)Get unique values given a document identifier, data name, an job identifiervoidinstall(java.lang.String jobsTable, java.lang.String jobsColumn)Install or upgrade.protected intmaxClausePerformDeleteRecords(java.lang.Long jobID)protected voidperformDeleteRecords(java.lang.Long jobID, java.util.List<java.lang.String> list)protected voidperformExistsCheck(java.util.Set<Carrydown.ValueRecord> presentSet, java.lang.String query, java.util.ArrayList list)Do the exists check, in batch.protected voidperformRestoreRecords(java.lang.String query, java.lang.Long jobID, java.util.List<java.lang.String> list)protected voidperformRevertRecords(java.lang.String query, java.lang.Long jobID, java.util.List<java.lang.String> list)booleanrecordCarrydownData(java.lang.Long jobID, java.lang.String parentDocumentIDHash, java.lang.String childDocumentIDHash, java.lang.String[] documentDataNames, java.lang.String[][] documentDataValueHashes, java.lang.Object[][] documentDataValues, java.lang.String processID)Add carrydown data for a given parent/child pair.boolean[]recordCarrydownDataMultiple(java.lang.Long jobID, java.lang.String parentDocumentIDHash, java.lang.String[] childDocumentIDHashes, java.lang.String[][] dataNames, java.lang.String[][][] dataValueHashes, java.lang.Object[][][] dataValues, java.lang.String processID)Add carrydown data to the table.voidrestart()Clean up after all process IDs.voidrestart(java.lang.String processID)Reset, at startup time.voidrestartCluster()Reset, at startup time, entire clustervoidrestoreRecords(java.lang.Long jobID, java.lang.String[] parentDocumentIDHashes)Return all records belonging to the specified parent documents to the base state, and delete the old (eliminated) child records.voidrevertRecords(java.lang.Long jobID, java.lang.String[] parentDocumentIDHashes)Revert all records belonging to the specified parent documents to their original, pre-modified, state.static java.lang.StringstatusToString(int status)Convert link status to stringstatic intstringToStatus(java.lang.String status)Convert string to link status.-
Methods inherited from class org.apache.manifoldcf.core.database.BaseTable
addTableIndex, analyzeTable, beginTransaction, buildConjunctionClause, constructCountClause, constructDistinctOnClause, constructDoubleCastClause, constructOffsetLimitClause, constructRegexpClause, constructSubstringClause, endTransaction, findConjunctionClauseMax, getDatabaseCacheKey, getDBInterface, getMaxInClause, getMaxOrClause, getSleepAmt, getTableIndexes, getTableName, getTableSchema, getTransactionID, getWindowedReportMaxRows, makeTableKey, noteModifications, performAddIndex, performAlter, performCommit, performCreate, performDelete, performDrop, performInsert, performModification, performQuery, performQuery, performRemoveIndex, performUpdate, prepareRowForSave, readRow, reindexTable, signalRollback, sleepFor
-
-
-
-
Field Detail
-
_rcsid
public static final java.lang.String _rcsid
- See Also:
- Constant Field Values
-
jobIDField
public static final java.lang.String jobIDField
- See Also:
- Constant Field Values
-
parentIDHashField
public static final java.lang.String parentIDHashField
- See Also:
- Constant Field Values
-
childIDHashField
public static final java.lang.String childIDHashField
- See Also:
- Constant Field Values
-
dataNameField
public static final java.lang.String dataNameField
- See Also:
- Constant Field Values
-
dataValueHashField
public static final java.lang.String dataValueHashField
- See Also:
- Constant Field Values
-
dataValueField
public static final java.lang.String dataValueField
- See Also:
- Constant Field Values
-
newField
public static final java.lang.String newField
- See Also:
- Constant Field Values
-
processIDField
public static final java.lang.String processIDField
- See Also:
- Constant Field Values
-
ISNEW_BASE
protected static final int ISNEW_BASE
The standard value for the "isnew" field. Means that the link existed prior to this scan, and no new link was found yet.- See Also:
- Constant Field Values
-
ISNEW_NEW
protected static final int ISNEW_NEW
This value means that the link is brand-new; it did not exist before this pass.- See Also:
- Constant Field Values
-
ISNEW_EXISTING
protected static final int ISNEW_EXISTING
This value means that the link existed before, and has been found during this scan.- See Also:
- Constant Field Values
-
isNewMap
protected static java.util.Map isNewMap
-
-
Constructor Detail
-
Carrydown
public Carrydown(IDBInterface database) throws ManifoldCFException
Constructor.- Parameters:
database- is the database handle.- Throws:
ManifoldCFException
-
-
Method Detail
-
install
public void install(java.lang.String jobsTable, java.lang.String jobsColumn) throws ManifoldCFExceptionInstall or upgrade.- Throws:
ManifoldCFException
-
deinstall
public void deinstall() throws ManifoldCFExceptionUninstall.- Throws:
ManifoldCFException
-
analyzeTables
public void analyzeTables() throws ManifoldCFExceptionAnalyze job tables that need analysis.- Throws:
ManifoldCFException
-
deleteOwner
public void deleteOwner(java.lang.Long jobID) throws ManifoldCFExceptionDelete an owning job (and clean up the corresponding carrydown rows).- Throws:
ManifoldCFException
-
restart
public void restart(java.lang.String processID) throws ManifoldCFExceptionReset, at startup time.- Parameters:
processID- is the process ID.- Throws:
ManifoldCFException
-
restart
public void restart() throws ManifoldCFExceptionClean up after all process IDs.- Throws:
ManifoldCFException
-
restartCluster
public void restartCluster() throws ManifoldCFExceptionReset, at startup time, entire cluster- Throws:
ManifoldCFException
-
recordCarrydownData
public boolean recordCarrydownData(java.lang.Long jobID, java.lang.String parentDocumentIDHash, java.lang.String childDocumentIDHash, java.lang.String[] documentDataNames, java.lang.String[][] documentDataValueHashes, java.lang.Object[][] documentDataValues, java.lang.String processID) throws ManifoldCFExceptionAdd carrydown data for a given parent/child pair.- Returns:
- true if new carrydown data was recorded; false otherwise.
- Throws:
ManifoldCFException
-
recordCarrydownDataMultiple
public boolean[] recordCarrydownDataMultiple(java.lang.Long jobID, java.lang.String parentDocumentIDHash, java.lang.String[] childDocumentIDHashes, java.lang.String[][] dataNames, java.lang.String[][][] dataValueHashes, java.lang.Object[][][] dataValues, java.lang.String processID) throws ManifoldCFExceptionAdd carrydown data to the table.- Throws:
ManifoldCFException
-
performExistsCheck
protected void performExistsCheck(java.util.Set<Carrydown.ValueRecord> presentSet, java.lang.String query, java.util.ArrayList list) throws ManifoldCFException
Do the exists check, in batch.- Throws:
ManifoldCFException
-
revertRecords
public void revertRecords(java.lang.Long jobID, java.lang.String[] parentDocumentIDHashes) throws ManifoldCFExceptionRevert all records belonging to the specified parent documents to their original, pre-modified, state.- Throws:
ManifoldCFException
-
performRevertRecords
protected void performRevertRecords(java.lang.String query, java.lang.Long jobID, java.util.List<java.lang.String> list) throws ManifoldCFException- Throws:
ManifoldCFException
-
restoreRecords
public void restoreRecords(java.lang.Long jobID, java.lang.String[] parentDocumentIDHashes) throws ManifoldCFExceptionReturn all records belonging to the specified parent documents to the base state, and delete the old (eliminated) child records.- Throws:
ManifoldCFException
-
performRestoreRecords
protected void performRestoreRecords(java.lang.String query, java.lang.Long jobID, java.util.List<java.lang.String> list) throws ManifoldCFException- Throws:
ManifoldCFException
-
deleteRecords
public void deleteRecords(java.lang.Long jobID, java.lang.String[] documentIDHashes) throws ManifoldCFExceptionDelete all records that mention a particular set of document identifiers.- Throws:
ManifoldCFException
-
maxClausePerformDeleteRecords
protected int maxClausePerformDeleteRecords(java.lang.Long jobID)
-
performDeleteRecords
protected void performDeleteRecords(java.lang.Long jobID, java.util.List<java.lang.String> list) throws ManifoldCFException- Throws:
ManifoldCFException
-
getDataValues
public java.lang.String[] getDataValues(java.lang.Long jobID, java.lang.String documentIdentifierHash, java.lang.String dataName) throws ManifoldCFExceptionGet unique values given a document identifier, data name, an job identifier- Throws:
ManifoldCFException
-
getDataValuesAsFiles
public CharacterInput[] getDataValuesAsFiles(java.lang.Long jobID, java.lang.String documentIdentifierHash, java.lang.String dataName) throws ManifoldCFException
Get unique values given a document identifier, data name, an job identifier- Throws:
ManifoldCFException
-
stringToStatus
public static int stringToStatus(java.lang.String status)
Convert string to link status.
-
statusToString
public static java.lang.String statusToString(int status)
Convert link status to string
-
-