|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensolaris.opengrok.index.IndexDatabase
public class IndexDatabase
This class is used to create / update the index databases. Currently we use one index database per project.
| Constructor Summary | |
|---|---|
IndexDatabase()
Create a new instance of the Index Database. |
|
IndexDatabase(Project project)
Create a new instance of an Index Database for a given project |
|
| Method Summary | |
|---|---|
boolean |
addDirectory(java.lang.String dir)
By default the indexer will traverse all directories in the project. |
void |
addIndexChangedListener(IndexChangedListener listener)
Register an object to receive events when modifications is done to the index database. |
void |
createSpellingSuggestions()
Generate a spelling suggestion for the definitions stored in defs |
boolean |
equals(java.lang.Object obj)
|
static org.apache.lucene.index.IndexReader |
getIndexReader(java.lang.String path)
Get an indexReader for the Index database where a given file |
int |
hashCode()
|
void |
interrupt()
Interrupt the index generation (and the index generation will stop as soon as possible) |
static void |
listAllFiles()
List all files in all of the index databases |
static void |
listAllFiles(java.util.List<java.lang.String> subFiles)
List all files in some of the index databases |
void |
listFiles()
List all of the files in this index database |
void |
listTokens(int freq)
|
void |
optimize()
Optimize the index database |
void |
removeIndexChangedListener(IndexChangedListener listener)
Remove an object from the lists of objects to receive events when modifications is done to the index database |
void |
update()
Update the content of this index database |
static void |
update(java.util.concurrent.ExecutorService executor,
IndexChangedListener listener,
java.util.List<java.lang.String> paths)
Update the index database for a number of sub-directories |
static void |
updateAll(java.util.concurrent.ExecutorService executor)
Update the index database for all of the projects. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IndexDatabase()
throws java.io.IOException
java.io.IOException - if an error occurs while creating directories
public IndexDatabase(Project project)
throws java.io.IOException
project - the project to create the database for
java.io.IOException - if an errror occurs while creating directories| Method Detail |
|---|
public static void updateAll(java.util.concurrent.ExecutorService executor)
throws java.io.IOException
executor - An executor to run the job
java.io.IOException - if an error occurs
public static void update(java.util.concurrent.ExecutorService executor,
IndexChangedListener listener,
java.util.List<java.lang.String> paths)
throws java.io.IOException
executor - An executor to run the joblistener - where to signal the changes to the databasepaths -
java.io.IOException - if an error occurspublic boolean addDirectory(java.lang.String dir)
dir - The directory to scan
true if the file is added, false oth
public void update()
throws java.io.IOException,
HistoryException
java.io.IOException - if an error occurs
HistoryException - if an error occurs when accessing the historypublic void optimize()
public void createSpellingSuggestions()
public void interrupt()
public void addIndexChangedListener(IndexChangedListener listener)
listener - the object to receive the eventspublic void removeIndexChangedListener(IndexChangedListener listener)
listener - the object to remove
public static void listAllFiles()
throws java.io.IOException
java.io.IOException - if an error occurs
public static void listAllFiles(java.util.List<java.lang.String> subFiles)
throws java.io.IOException
subFiles - Subdirectories for the various projects to list the files
for (or null or an empty list to dump all projects)
java.io.IOException - if an error occurs
public void listFiles()
throws java.io.IOException
java.io.IOException - If an IO error occurs while reading from the database
public void listTokens(int freq)
throws java.io.IOException
java.io.IOExceptionpublic static org.apache.lucene.index.IndexReader getIndexReader(java.lang.String path)
path - the file to get the database for
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||