org.cdlib.xtf.textEngine
Class IndexValidator
Object
IndexValidator
public class IndexValidator
- extends Object
This class performs the validation steps for a specified index, checking that
the results are acceptable. This is used at index time to decide whether
to rotate in a new index, and also by the servlets to "warm up" a new index
before presenting it to the user.
- Author:
- Martin Haye
Method Summary |
private void |
traverse(EasyNode node,
int level)
Traverse the validation specification document, visiting each node. |
boolean |
validate(String baseDir,
String indexPath,
IndexReader indexReader)
Run validations for the given index. |
private void |
visit(EasyNode node,
int level)
Process one node of the validation specification document. |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
crossQuery
private TestableCrossQuery crossQuery
dynaXML
private TestableDynaXML dynaXML
nErrs
private int nErrs
IndexValidator
public IndexValidator()
validate
public boolean validate(String baseDir,
String indexPath,
IndexReader indexReader)
throws IOException
- Run validations for the given index.
- Parameters:
baseDir
- XTF home directoryindexPath
- path to the index dataindexReader
- Lucene reader for the index
- Returns:
- true iff all validations passed
- Throws:
IOException
- if the index can't be read
traverse
private void traverse(EasyNode node,
int level)
throws IndexValidator.ValidationError,
ServletException,
IOException
- Traverse the validation specification document, visiting each node.
- Throws:
IndexValidator.ValidationError
ServletException
IOException
visit
private void visit(EasyNode node,
int level)
throws IndexValidator.ValidationError,
ServletException,
IOException
- Process one node of the validation specification document.
- Throws:
IndexValidator.ValidationError
ServletException
IOException