public class IndexWarmer
extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
IndexWarmer.BgThread
Thread that sits in the background and periodically checks if there are
indexes in need of warming, and warms them.
|
private static class |
IndexWarmer.Entry
An entry mapping indexPath to XtfSearcher
|
Modifier and Type | Field and Description |
---|---|
private IndexWarmer.BgThread |
bgThread |
private HashMap<String,IndexWarmer.Entry> |
entries |
private int |
updateInterval |
private String |
xtfHome |
Constructor and Description |
---|
IndexWarmer(String xtfHome,
int updateInterval)
Construct the warmer and start up the background warming thread.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shuts down the background thread, if it's running.
|
XtfSearcher |
getSearcher(String indexPath)
Get a searcher for the given index path.
|
private String xtfHome
private HashMap<String,IndexWarmer.Entry> entries
private IndexWarmer.BgThread bgThread
private int updateInterval
public IndexWarmer(String xtfHome, int updateInterval)
xtfHome
- Filesystem path to the XTF home directoryupdateInterval
- Minimum number of seconds between
warming one index and the next, or 0 to
disable background warming.public void close()
public XtfSearcher getSearcher(String indexPath) throws IOException
IOException