Class Indexer
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.indexer.Indexer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanstatic booleanstatic booleanstatic intstatic booleanstatic booleanstatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Indexer.Listener newListener)Adds the given listener.protected voiddeleteResource(NdResourceFile toDelete, org.eclipse.core.runtime.IProgressMonitor monitor)Performs a non-atomic delete of the given resource file.voidenableAutomaticIndexing(boolean enabled)Enables or disables the "rescanAll" method.static IndexervoidmakeDirty(org.eclipse.core.resources.IProject project)Schedules a rescan of the given project.voidmakeDirty(org.eclipse.core.runtime.IPath location)Dirties the given filesystem location.voidmakeWorkspacePathDirty(org.eclipse.core.runtime.IPath pathToRescan)Schedules a rescan of the given path (which may be either a workspace path or an absolute path on the local filesystem).voidrebuildIndex(org.eclipse.core.runtime.IProgressMonitor monitor)voidremoveListener(Indexer.Listener oldListener)voidvoidrescan(org.eclipse.core.runtime.IProgressMonitor monitor)voidvoidwaitForIndex(int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor monitor)voidwaitForIndex(org.eclipse.core.runtime.IProgressMonitor monitor)
-
Field Details
-
DEBUG
public static boolean DEBUG -
DEBUG_ALLOCATIONS
public static boolean DEBUG_ALLOCATIONS -
DEBUG_TIMING
public static boolean DEBUG_TIMING -
DEBUG_SCHEDULING
public static boolean DEBUG_SCHEDULING -
DEBUG_INSERTIONS
public static boolean DEBUG_INSERTIONS -
DEBUG_SELFTEST
public static boolean DEBUG_SELFTEST -
DEBUG_LOG_SIZE_MB
public static int DEBUG_LOG_SIZE_MB
-
-
Constructor Details
-
Indexer
-
-
Method Details
-
getInstance
-
enableAutomaticIndexing
public void enableAutomaticIndexing(boolean enabled)Enables or disables the "rescanAll" method. When set to false, rescanAll does nothing and indexing will only be triggered when invokingwaitForIndex(org.eclipse.core.runtime.IProgressMonitor).Normally the indexer runs automatically and asynchronously when resource changes occur. However, if this variable is set to false the indexer only runs when someone invokes
waitForIndex(IProgressMonitor). This can be used to eliminate race conditions when running the unit tests, since indexing will not occur unless it is triggered explicitly.Synchronize on
automaticIndexingMutexbefore accessing. -
rescan
public void rescan(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
deleteResource
protected void deleteResource(NdResourceFile toDelete, org.eclipse.core.runtime.IProgressMonitor monitor)Performs a non-atomic delete of the given resource file. First, it marks the file as being invalid (by clearing out its timestamp). Then it deletes the children of the resource file, one child at a time. Once all the children are deleted, the resource itself is deleted. The result on the database is exactly the same as if the caller had called toDelete.delete(), but doing it this way ensures that a write lock will never be held for a nontrivial amount of time. -
rescanAll
public void rescanAll() -
addListener
Adds the given listener. It will be notified when Nd changes. No strong references will be retained to the listener. -
removeListener
-
waitForIndex
public void waitForIndex(org.eclipse.core.runtime.IProgressMonitor monitor) -
waitForIndex
public void waitForIndex(int waitingPolicy, org.eclipse.core.runtime.IProgressMonitor monitor) -
rebuildIndex
public void rebuildIndex(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException- Throws:
org.eclipse.core.runtime.CoreException
-
requestRebuildIndex
public void requestRebuildIndex() -
makeDirty
public void makeDirty(org.eclipse.core.runtime.IPath location)Dirties the given filesystem location. This must point to a single file (not a folder) that needs to be rescanned. The file may have been added, removed, or changed.- Parameters:
location- an absolute filesystem location
-
makeDirty
public void makeDirty(org.eclipse.core.resources.IProject project)Schedules a rescan of the given project. -
makeWorkspacePathDirty
public void makeWorkspacePathDirty(org.eclipse.core.runtime.IPath pathToRescan)Schedules a rescan of the given path (which may be either a workspace path or an absolute path on the local filesystem). This may point to either a single file or a folder that needs to be rescanned. Any resource that has this path as a prefix will be rescanned.- Parameters:
pathToRescan-
-