public class IndexManager extends JobManager implements IIndexConstants
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
SimpleLookupTable |
indexLocations |
static java.lang.String |
MANAGE_PRODUCT_INDEXES_PROPERTY |
static java.lang.Integer |
REBUILDING_STATE |
static java.lang.Integer |
REUSE_STATE |
static java.lang.Integer |
SAVED_STATE |
static java.lang.Integer |
UNKNOWN_STATE |
static java.lang.Integer |
UPDATING_STATE |
activated, awaitingJobs, executing, jobEnd, jobStart, processingThread, progressJob, VERBOSEAND_PATTERN, ANNOT_REF_PATTERN, ANNOTATION_REF, ANNOTATION_TYPE_SUFFIX, CLASS_AND_ENUM_SUFFIX, CLASS_AND_INTERFACE_SUFFIX, CLASS_SUFFIX, CONSTRUCTOR_DECL, CONSTRUCTOR_PATTERN, CONSTRUCTOR_REF, COUNTS, DEFAULT_CONSTRUCTOR, ENUM_SUFFIX, FIELD_DECL, FIELD_PATTERN, INTERFACE_AND_ANNOTATION_SUFFIX, INTERFACE_SUFFIX, LOCAL_VAR_PATTERN, METHOD_DECL, METHOD_DECL_PLUS, METHOD_PATTERN, METHOD_REF, MODULE_DECL, MODULE_INFO, MODULE_PATTERN, MODULE_REF, OBJECT, ONE_STAR, ONE_STAR_CHAR, ONE_ZERO, ONE_ZERO_CHAR, OR_PATTERN, PARAMETER_SEPARATOR, PKG_DECL_PATTERN, PKG_REF_PATTERN, REF, SECONDARY_SUFFIX, SEPARATOR, SUPER_REF, SUPER_REF_PATTERN, TYPE_DECL, TYPE_DECL_PATTERN, TYPE_PARAM_PATTERN, TYPE_REF_PATTERN, TYPE_SUFFIX, ZERO_CHAR| Constructor and Description |
|---|
IndexManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
aboutToUpdateIndex(IPath containerPath,
java.lang.Integer newIndexState) |
void |
addBinary(IFile resource,
IPath containerPath)
Trigger addition of a resource to an index
Note: the actual operation is performed in background
|
void |
addSource(IFile resource,
IPath containerPath,
SourceElementParser parser)
Trigger addition of a resource to an index
Note: the actual operation is performed in background
|
void |
cleanUpIndexes() |
IndexLocation |
computeIndexLocation(IPath containerPath) |
IndexLocation |
computeIndexLocation(IPath containerPath,
java.net.URL newIndexURL)
Compute the pre-built index location for a specified URL
|
void |
deleteIndexFiles()
|
void |
deleteIndexFiles(IProgressMonitor monitor) |
void |
ensureIndexExists(IndexLocation indexLocation,
IPath containerPath) |
Index |
getIndex(IndexLocation indexLocation)
Returns the index for a given index location
|
Index |
getIndex(IPath containerPath,
boolean reuseExistingFile,
boolean createIfMissing)
Returns the index for a given project, according to the following algorithm:
- if index is already in memory: answers this one back
- if (reuseExistingFile) then read it and return this index and record it in memory
- if (createIfMissing) then create a new empty index and record it in memory
Warning: Does not check whether index is consistent (not being used)
|
Index |
getIndex(IPath containerPath,
IndexLocation indexLocation,
boolean reuseExistingFile,
boolean createIfMissing)
Returns the index for a given project, according to the following algorithm:
- if index is already in memory: answers this one back
- if (reuseExistingFile) then read it and return this index and record it in memory
- if (createIfMissing) then create a new empty index and record it in memory
Warning: Does not check whether index is consistent (not being used)
|
Index[] |
getIndexes(IndexLocation[] locations,
IProgressMonitor progressMonitor)
Returns all the existing indexes for a list of index locations.
|
Index |
getIndexForUpdate(IPath containerPath,
boolean reuseExistingFile,
boolean createIfMissing) |
SourceElementParser |
getSourceElementParser(IJavaProject project,
ISourceElementRequestor requestor) |
void |
indexAll(IProject project)
Trigger addition of the entire content of a project
Note: the actual operation is performed in background
|
void |
indexDocument(SearchDocument searchDocument,
SearchParticipant searchParticipant,
Index index,
IPath indexLocation) |
void |
indexLibrary(IPath path,
IProject requestingProject,
java.net.URL indexURL) |
void |
indexLibrary(IPath path,
IProject requestingProject,
java.net.URL indexURL,
boolean updateIndex)
Trigger addition of a library to an index
Note: the actual operation is performed in background
|
void |
indexResolvedDocument(SearchDocument searchDocument,
SearchParticipant searchParticipant,
Index index,
IPath indexLocation) |
void |
indexSourceFolder(JavaProject javaProject,
IPath sourceFolder,
char[][] inclusionPatterns,
char[][] exclusionPatterns)
Index the content of the given source folder.
|
void |
jobWasCancelled(IPath containerPath) |
protected void |
moveToNextJob()
Advance to the next available job, once the current one has been completed.
|
protected void |
notifyIdle(long idlingTime)
No more job awaiting.
|
java.lang.String |
processName()
Name of the background process
|
Index |
recreateIndex(IPath containerPath)
Recreates the index for a given path, keeping the same read-write monitor.
|
void |
remove(java.lang.String containerRelativePath,
IPath indexedContainer)
Trigger removal of a resource to an index
Note: the actual operation is performed in background
|
void |
removeIndex(IPath containerPath)
Removes the index for a given path.
|
void |
removeIndexFamily(IPath path)
Removes all indexes whose paths start with (or are equal to) the given path.
|
void |
removeIndexPath(IPath path)
Removes all indexes whose paths start with (or are equal to) the given path.
|
void |
removeSourceFolderFromIndex(JavaProject javaProject,
IPath sourceFolder,
char[][] inclusionPatterns,
char[][] exclusionPatterns)
Remove the content of the given source folder from the index.
|
void |
reset()
Flush current state
|
boolean |
resetIndex(IPath containerPath)
Resets the index for a given path.
|
void |
saveIndex(Index index) |
void |
saveIndexes()
Commit all index memory changes to disk
|
void |
savePreBuiltIndex(Index index)
saveIndex(Index) will only update the state if there are no other jobs running against the same
underlying resource for this index. |
void |
scheduleDocumentIndexing(SearchDocument searchDocument,
IPath container,
IndexLocation indexLocation,
SearchParticipant searchParticipant) |
java.lang.String |
toString() |
void |
updateParticipant(IPath indexPath,
IPath containerPath) |
activateProcessing, awaitingJobsCount, currentJob, disable, discardJobs, enable, isJobWaiting, performConcurrentJob, request, run, shutdownpublic SimpleLookupTable indexLocations
public static final java.lang.Integer SAVED_STATE
public static final java.lang.Integer UPDATING_STATE
public static final java.lang.Integer UNKNOWN_STATE
public static final java.lang.Integer REBUILDING_STATE
public static final java.lang.Integer REUSE_STATE
public static final java.lang.String MANAGE_PRODUCT_INDEXES_PROPERTY
public static boolean DEBUG
public void aboutToUpdateIndex(IPath containerPath,
java.lang.Integer newIndexState)
public void addBinary(IFile resource,
IPath containerPath)
public void addSource(IFile resource,
IPath containerPath,
SourceElementParser parser)
public void cleanUpIndexes()
public IndexLocation computeIndexLocation(IPath containerPath, java.net.URL newIndexURL)
public IndexLocation computeIndexLocation(IPath containerPath)
public final void deleteIndexFiles()
public void deleteIndexFiles(IProgressMonitor monitor)
public void ensureIndexExists(IndexLocation indexLocation, IPath containerPath)
public SourceElementParser getSourceElementParser(IJavaProject project, ISourceElementRequestor requestor)
public Index getIndex(IndexLocation indexLocation)
indexLocation - The path of the index filenull if not foundpublic Index getIndex(IPath containerPath, boolean reuseExistingFile, boolean createIfMissing)
public Index getIndex(IPath containerPath, IndexLocation indexLocation, boolean reuseExistingFile, boolean createIfMissing)
public Index[] getIndexes(IndexLocation[] locations, IProgressMonitor progressMonitor)
locations - The list of of the index files pathpublic Index getIndexForUpdate(IPath containerPath, boolean reuseExistingFile, boolean createIfMissing)
public void indexDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation)
public void indexResolvedDocument(SearchDocument searchDocument, SearchParticipant searchParticipant, Index index, IPath indexLocation)
public void indexAll(IProject project)
public void indexLibrary(IPath path,
IProject requestingProject,
java.net.URL indexURL)
public void indexLibrary(IPath path,
IProject requestingProject,
java.net.URL indexURL,
boolean updateIndex)
public void indexSourceFolder(JavaProject javaProject, IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns)
public void jobWasCancelled(IPath containerPath)
protected void moveToNextJob()
moveToNextJob in class JobManagerprotected void notifyIdle(long idlingTime)
notifyIdle in class JobManagerpublic java.lang.String processName()
processName in class JobManagerpublic Index recreateIndex(IPath containerPath)
public void remove(java.lang.String containerRelativePath,
IPath indexedContainer)
public void removeIndex(IPath containerPath)
public void removeIndexPath(IPath path)
public void removeIndexFamily(IPath path)
public void removeSourceFolderFromIndex(JavaProject javaProject, IPath sourceFolder, char[][] inclusionPatterns, char[][] exclusionPatterns)
public void reset()
reset in class JobManagerpublic boolean resetIndex(IPath containerPath)
public void savePreBuiltIndex(Index index) throws java.io.IOException
saveIndex(Index) will only update the state if there are no other jobs running against the same
underlying resource for this index. Pre-built indexes must be in a REUSE_STATE state even if
there is another job to run against it as the subsequent job will find the index and not save it in the
right state.
Refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=405932java.io.IOExceptionpublic void saveIndex(Index index) throws java.io.IOException
java.io.IOExceptionpublic void saveIndexes()
public void scheduleDocumentIndexing(SearchDocument searchDocument, IPath container, IndexLocation indexLocation, SearchParticipant searchParticipant)
public java.lang.String toString()
toString in class JobManagerpublic void updateParticipant(IPath indexPath,
IPath containerPath)