|
|||||||||
| 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.HopCount
public class HopCount
This class manages the table that keeps track of hop count, and algorithmically determines this value for a document identifier upon request.
| Nested Class Summary | |
|---|---|
protected static class |
HopCount.Answer
This class represents an answer - which consists both of an answer value, and also the dependencies of that answer (i.e. |
protected class |
HopCount.DocumentHash
The Document Hash structure contains the document nodes we are interested in, including those we need answers for to proceed. |
protected static class |
HopCount.DocumentNode
This class keeps track of the data associated with a node in the hash map. |
protected static class |
HopCount.DocumentReference
This class describes a document reference. |
protected static class |
HopCount.NodeQueue
A queue object allows document nodes to be ordered appropriately for the most efficient execution. |
protected static class |
HopCount.NodeReference
This class describes a node link reference. |
protected static class |
HopCount.Question
A class describing a document identifier and a link type, to be used in looking up the appropriate node in the hash. |
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
static int |
ANSWER_INFINITY
|
static int |
ANSWER_UNKNOWN
|
protected HopDeleteDeps |
deleteDepsManager
Hop "delete" dependencies manager |
static java.lang.String |
distanceField
|
static java.lang.String |
idField
|
protected IntrinsicLink |
intrinsicLinkManager
Intrinsic link table manager. |
static java.lang.String |
jobIDField
|
static java.lang.String |
linkTypeField
|
static int |
MARK_DELETING
|
static int |
MARK_NORMAL
|
static int |
MARK_QUEUED
|
static java.lang.String |
markForDeathField
|
protected static java.util.Map |
markMap
|
static java.lang.String |
parentIDHashField
|
protected IThreadContext |
threadContext
Thread context |
| Fields inherited from class org.apache.manifoldcf.core.database.BaseTable |
|---|
dbInterface, tableName |
| Constructor Summary | |
|---|---|
HopCount(IThreadContext tc,
IDBInterface database)
Constructor. |
|
| Method Summary | |
|---|---|
protected void |
addToProcessingQueue(java.lang.Long jobID,
java.lang.String[] affectedLinkTypes,
java.lang.String[] documentIDHashes,
HopCount.Answer[] startingAnswers,
java.lang.String sourceDocumentIDHash,
java.lang.String linkType,
int hopcountMethod)
Add documents to the processing queue. |
void |
deinstall()
Uninstall. |
void |
deleteDocumentIdentifiers(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] sourceDocumentHashes,
int hopcountMethod)
Remove a set of document identifier hashes. |
void |
deleteMatchingDocuments(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceTableName,
java.lang.String sourceTableIDColumn,
java.lang.String sourceTableJobColumn,
java.lang.String sourceTableCriteria,
java.util.ArrayList sourceTableParams,
int hopcountMethod)
Remove a set of document identifiers specified as a criteria. |
void |
deleteOwner(java.lang.Long jobID)
Delete an owner (and clean up the corresponding hopcount rows). |
protected void |
doDeleteInvalidation(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
boolean existingOnly,
java.lang.String[] sourceDocumentHashes,
java.lang.String sourceTableName,
java.lang.String sourceTableIDColumn,
java.lang.String sourceTableJobColumn,
java.lang.String sourceTableCriteria,
java.util.ArrayList sourceTableParams)
Invalidate links meeting a simple criteria which have a given set of source documents. |
protected void |
doFinish(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] sourceDocumentHashes,
int hopcountMethod)
Method that does the work of "finishing" a set of child references. |
protected void |
doRecord(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceDocumentIDHash,
java.lang.String[] targetDocumentIDHashes,
java.lang.String linkType,
int hopcountMethod)
Do the work of recording source-target references. |
int[] |
findHopCounts(java.lang.Long jobID,
java.lang.String[] parentIdentifierHashes,
java.lang.String linkType)
Calculate a bunch of hop-counts. |
void |
finishParents(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] sourceDocumentHashes,
int hopcountMethod)
Complete a recalculation pass for a set of source documents. |
void |
finishSeedReferences(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
int hopcountMethod)
Finish seed references. |
protected IResultSet |
getDocumentChildren(java.lang.Long jobID,
java.lang.String documentIDHash)
Get document's children. |
void |
install(java.lang.String jobsTable,
java.lang.String jobsColumn)
Install or upgrade. |
protected void |
markForDelete(java.lang.String query,
java.util.ArrayList list,
java.lang.String commonNewExpression,
java.util.ArrayList commonNewList)
|
static java.lang.String |
markToString(int mark)
Go from mark to string. |
protected void |
performFindMissingRecords(java.lang.String query,
java.util.ArrayList list,
java.util.Map matchMap)
Limited find for missing records. |
protected void |
performGetCachedDistanceDeps(java.util.Map depsMap,
java.lang.String query,
java.util.ArrayList list)
Do a limited fetch of cached distance dependencies |
protected void |
performGetCachedDistances(HopCount.DocumentNode[] rval,
java.util.Map indexMap,
java.util.Map depsMap,
java.lang.String query,
java.util.ArrayList list)
Do a limited fetch of cached distances |
protected void |
performMarkAddDeps(java.lang.String query,
java.util.ArrayList list)
Do the work of marking add-dep-dependent links in the hopcount table. |
protected void |
processFind(int[] rval,
java.util.Map rvalMap,
java.lang.String query,
java.util.ArrayList list)
Process a portion of a find request for hopcount information. |
boolean |
processQueue(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
int hopcountMethod)
Process a stage of the propagation queue for a job. |
protected HopCount.DocumentNode[] |
readCachedNodes(java.lang.Long jobID,
HopCount.Question[] unansweredQuestions)
Find the cached distance from a set of identifiers to the root. |
void |
recordReference(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceDocumentIDHash,
java.lang.String targetDocumentIDHash,
java.lang.String linkType,
int hopcountMethod)
Record a reference from source to target. |
void |
recordReferences(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceDocumentIDHash,
java.lang.String[] targetDocumentIDHashes,
java.lang.String linkType,
int hopcountMethod)
Record a set of references from source to target. |
void |
recordSeedReferences(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] targetDocumentIDHashes,
int hopcountMethod)
Record a references from a set of documents to the root. |
void |
reset()
Reset, at startup time. |
static int |
stringToMark(java.lang.String value)
Go from string to mark. |
protected void |
writeCachedDistance(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
HopCount.DocumentNode dn,
int hopcountMethod)
Write a distance into the cache. |
| 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 ANSWER_UNKNOWN
public static final int ANSWER_INFINITY
public static final java.lang.String idField
public static final java.lang.String jobIDField
public static final java.lang.String linkTypeField
public static final java.lang.String parentIDHashField
public static final java.lang.String distanceField
public static final java.lang.String markForDeathField
public static final int MARK_NORMAL
public static final int MARK_QUEUED
public static final int MARK_DELETING
protected static java.util.Map markMap
protected IntrinsicLink intrinsicLinkManager
protected HopDeleteDeps deleteDepsManager
protected IThreadContext threadContext
| Constructor Detail |
|---|
public HopCount(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 deinstall()
throws ManifoldCFException
ManifoldCFException
public static int stringToMark(java.lang.String value)
throws ManifoldCFException
value - is the string.
ManifoldCFException
public static java.lang.String markToString(int mark)
throws ManifoldCFException
mark - is the mark.
ManifoldCFException
public void deleteOwner(java.lang.Long jobID)
throws ManifoldCFException
ManifoldCFException
public void reset()
throws ManifoldCFException
ManifoldCFException
public void recordSeedReferences(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] targetDocumentIDHashes,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public void finishSeedReferences(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public void recordReference(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceDocumentIDHash,
java.lang.String targetDocumentIDHash,
java.lang.String linkType,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public void recordReferences(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceDocumentIDHash,
java.lang.String[] targetDocumentIDHashes,
java.lang.String linkType,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public void finishParents(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] sourceDocumentHashes,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
protected void doRecord(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceDocumentIDHash,
java.lang.String[] targetDocumentIDHashes,
java.lang.String linkType,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public void deleteMatchingDocuments(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String sourceTableName,
java.lang.String sourceTableIDColumn,
java.lang.String sourceTableJobColumn,
java.lang.String sourceTableCriteria,
java.util.ArrayList sourceTableParams,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public void deleteDocumentIdentifiers(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] sourceDocumentHashes,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
public int[] findHopCounts(java.lang.Long jobID,
java.lang.String[] parentIdentifierHashes,
java.lang.String linkType)
throws ManifoldCFException
ManifoldCFException
protected void processFind(int[] rval,
java.util.Map rvalMap,
java.lang.String query,
java.util.ArrayList list)
throws ManifoldCFException
ManifoldCFException
public boolean processQueue(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
int hopcountMethod)
throws ManifoldCFException
jobID - is the job we need to have the hopcount propagated for.
ManifoldCFException
protected void performFindMissingRecords(java.lang.String query,
java.util.ArrayList list,
java.util.Map matchMap)
throws ManifoldCFException
ManifoldCFException
protected void addToProcessingQueue(java.lang.Long jobID,
java.lang.String[] affectedLinkTypes,
java.lang.String[] documentIDHashes,
HopCount.Answer[] startingAnswers,
java.lang.String sourceDocumentIDHash,
java.lang.String linkType,
int hopcountMethod)
throws ManifoldCFException
jobID - is the job the documents belong to.affectedLinkTypes - are the set of affected link types.documentIDHashes - are the documents to add.startingAnswers - are the hopcounts for the documents as they are currently known.sourceDocumentIDHash - is the source document identifier for the links from source to target documents.linkType - is the link type for this queue addition.hopcountMethod - is the desired method of managing hopcounts.
ManifoldCFException
protected void performMarkAddDeps(java.lang.String query,
java.util.ArrayList list)
throws ManifoldCFException
ManifoldCFException
protected void doFinish(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
java.lang.String[] sourceDocumentHashes,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
protected void doDeleteInvalidation(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
boolean existingOnly,
java.lang.String[] sourceDocumentHashes,
java.lang.String sourceTableName,
java.lang.String sourceTableIDColumn,
java.lang.String sourceTableJobColumn,
java.lang.String sourceTableCriteria,
java.util.ArrayList sourceTableParams)
throws ManifoldCFException
ManifoldCFException
protected void markForDelete(java.lang.String query,
java.util.ArrayList list,
java.lang.String commonNewExpression,
java.util.ArrayList commonNewList)
throws ManifoldCFException
ManifoldCFException
protected IResultSet getDocumentChildren(java.lang.Long jobID,
java.lang.String documentIDHash)
throws ManifoldCFException
ManifoldCFException
protected HopCount.DocumentNode[] readCachedNodes(java.lang.Long jobID,
HopCount.Question[] unansweredQuestions)
throws ManifoldCFException
ManifoldCFException
protected void performGetCachedDistanceDeps(java.util.Map depsMap,
java.lang.String query,
java.util.ArrayList list)
throws ManifoldCFException
ManifoldCFException
protected void performGetCachedDistances(HopCount.DocumentNode[] rval,
java.util.Map indexMap,
java.util.Map depsMap,
java.lang.String query,
java.util.ArrayList list)
throws ManifoldCFException
ManifoldCFException
protected void writeCachedDistance(java.lang.Long jobID,
java.lang.String[] legalLinkTypes,
HopCount.DocumentNode dn,
int hopcountMethod)
throws ManifoldCFException
ManifoldCFException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||