Class ThrottleSpecManager
- java.lang.Object
-
- org.apache.manifoldcf.core.database.BaseTable
-
- org.apache.manifoldcf.crawler.repository.ThrottleSpecManager
-
public class ThrottleSpecManager extends BaseTable
This class manages the "throttlespec" table, which contains the throttle specifications for each connection. These are basically tuples consisting of a regexp and a fetch rate. There's a description of each tuple, so that a person can attach a description of what they are attempting to do with each limit.
throttlespecField Type Description ownername VARCHAR(32) Reference:repoconnections.connectionname description VARCHAR(255) matchstring VARCHAR(255) throttle FLOAT
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidstatic java.lang.StringdescriptionFieldstatic java.lang.StringmatchFieldstatic java.lang.StringownerNameFieldstatic java.lang.StringthrottleField-
Fields inherited from class org.apache.manifoldcf.core.database.BaseTable
dbInterface, tableName
-
-
Constructor Summary
Constructors Constructor Description ThrottleSpecManager(IDBInterface database)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeinstall()Uninstall.voiddeleteRows(java.lang.String owner)Delete rows.voidgetRows(IRepositoryConnection[] connections, java.util.Map indexMap, java.util.ArrayList ownerNameParams)Fill in a set of throttles corresponding to a set of connection names.voidinstall(java.lang.String ownerTable, java.lang.String owningTablePrimaryKey)Install or upgrade.intmaxClauseGetRows()Calculate the maximum number of clauses we can use with getRows.IResultSetreadRows(java.lang.String name)Read rows for a given owner name.voidwriteRows(java.lang.String owner, IRepositoryConnection connection)Write a throttle spec into the database.-
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
-
ownerNameField
public static final java.lang.String ownerNameField
- See Also:
- Constant Field Values
-
descriptionField
public static final java.lang.String descriptionField
- See Also:
- Constant Field Values
-
matchField
public static final java.lang.String matchField
- See Also:
- Constant Field Values
-
throttleField
public static final java.lang.String throttleField
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ThrottleSpecManager
public ThrottleSpecManager(IDBInterface database) throws ManifoldCFException
Constructor.- Parameters:
database- is the database instance.- Throws:
ManifoldCFException
-
-
Method Detail
-
install
public void install(java.lang.String ownerTable, java.lang.String owningTablePrimaryKey) throws ManifoldCFExceptionInstall or upgrade.- Parameters:
ownerTable- is the name of the table that owns this one.owningTablePrimaryKey- is the primary key of the owning table.- Throws:
ManifoldCFException
-
deinstall
public void deinstall() throws ManifoldCFExceptionUninstall.- Throws:
ManifoldCFException
-
readRows
public IResultSet readRows(java.lang.String name) throws ManifoldCFException
Read rows for a given owner name.- Parameters:
name- is the owner name.- Returns:
- a list, with columns: "description", "match", and "value".
- Throws:
ManifoldCFException
-
maxClauseGetRows
public int maxClauseGetRows()
Calculate the maximum number of clauses we can use with getRows.
-
getRows
public void getRows(IRepositoryConnection[] connections, java.util.Map indexMap, java.util.ArrayList ownerNameParams) throws ManifoldCFException
Fill in a set of throttles corresponding to a set of connection names.- Parameters:
connections- is the set of connections to fill in.indexMap- maps the connection name to the index in the connections array.ownerNameParams- is the corresponding set of connection name parameters.- Throws:
ManifoldCFException
-
writeRows
public void writeRows(java.lang.String owner, IRepositoryConnection connection) throws ManifoldCFExceptionWrite a throttle spec into the database.- Parameters:
owner- is the owning connection name.connection- is the connection to write throttle specs for.- Throws:
ManifoldCFException
-
deleteRows
public void deleteRows(java.lang.String owner) throws ManifoldCFExceptionDelete rows.- Parameters:
owner- is the owner whose rows to delete.- Throws:
ManifoldCFException
-
-