public abstract class FileBasedIndex
extends java.lang.Object
FileBasedIndexExtension
Modifier and Type | Class and Description |
---|---|
static interface |
FileBasedIndex.FileTypeSpecificInputFilter |
static interface |
FileBasedIndex.InputFilter |
static interface |
FileBasedIndex.ValueProcessor<V> |
Modifier and Type | Field and Description |
---|---|
static boolean |
ourEnableTracingOfKeyHashToVirtualFileMapping
Deprecated.
inline true
|
static boolean |
ourSnapshotMappingsEnabled |
Constructor and Description |
---|
FileBasedIndex() |
Modifier and Type | Method and Description |
---|---|
abstract <K> void |
ensureUpToDate(ID<K,?> indexId,
Project project,
GlobalSearchScope filter)
DO NOT CALL DIRECTLY IN CLIENT CODE
The method is internal to indexing engine end is called internally.
|
abstract VirtualFile |
findFileById(Project project,
int id)
Deprecated.
|
abstract <K> java.util.Collection<K> |
getAllKeys(ID<K,?> indexId,
Project project)
It is guaranteed to return data which is up-to-date within the given project.
|
abstract <K,V> java.util.Collection<VirtualFile> |
getContainingFiles(ID<K,V> indexId,
K dataKey,
GlobalSearchScope filter) |
DumbModeAccessType |
getCurrentDumbModeAccessType() |
abstract VirtualFile |
getFileBeingCurrentlyIndexed() |
abstract <K,V> java.util.Map<K,V> |
getFileData(ID<K,V> id,
VirtualFile virtualFile,
Project project) |
static int |
getFileId(VirtualFile file) |
abstract <K,V> boolean |
getFilesWithKey(ID<K,V> indexId,
java.util.Set<? extends K> dataKeys,
Processor<? super VirtualFile> processor,
GlobalSearchScope filter) |
abstract <K,V> long |
getIndexModificationStamp(ID<K,V> indexId,
Project project) |
static FileBasedIndex |
getInstance() |
abstract <K,V> java.util.List<V> |
getValues(ID<K,V> indexId,
K dataKey,
GlobalSearchScope filter) |
void |
ignoreDumbMode(java.lang.Runnable command,
Project project,
DumbModeAccessType dumbModeAccessType)
Executes command and allow its to have an index access in dumb mode.
|
void |
invalidateCaches() |
static boolean |
isIndexAccessDuringDumbModeEnabled() |
abstract void |
iterateIndexableFiles(ContentIterator processor,
Project project,
ProgressIndicator indicator) |
static void |
iterateRecursively(VirtualFile root,
ContentIterator processor,
ProgressIndicator indicator,
java.util.Set<? super VirtualFile> visitedRoots,
ProjectFileIndex projectFileIndex) |
<K> boolean |
processAllKeys(ID<K,?> indexId,
Processor<? super K> processor,
GlobalSearchScope scope,
IdFilter idFilter) |
abstract <K> boolean |
processAllKeys(ID<K,?> indexId,
Processor<? super K> processor,
Project project)
It is guaranteed to return data which is up-to-date within the given project.
|
abstract <K,V> boolean |
processFilesContainingAllKeys(ID<K,V> indexId,
java.util.Collection<? extends K> dataKeys,
GlobalSearchScope filter,
Condition<? super V> valueChecker,
Processor<? super VirtualFile> processor) |
abstract <K,V> boolean |
processValues(ID<K,V> indexId,
K dataKey,
VirtualFile inFile,
FileBasedIndex.ValueProcessor<? super V> processor,
GlobalSearchScope filter) |
<K,V> boolean |
processValues(ID<K,V> indexId,
K dataKey,
VirtualFile inFile,
FileBasedIndex.ValueProcessor<? super V> processor,
GlobalSearchScope filter,
IdFilter idFilter) |
abstract void |
registerIndexableSet(IndexableFileSet set,
Project project) |
abstract void |
removeIndexableSet(IndexableFileSet set) |
void |
requestRebuild(ID<?,?> indexId) |
abstract void |
requestRebuild(ID<?,?> indexId,
java.lang.Throwable throwable) |
abstract void |
requestReindex(VirtualFile file) |
abstract <K> void |
scheduleRebuild(ID<K,?> indexId,
java.lang.Throwable e) |
@Deprecated public static final boolean ourEnableTracingOfKeyHashToVirtualFileMapping
public static final boolean ourSnapshotMappingsEnabled
public abstract void iterateIndexableFiles(ContentIterator processor, Project project, ProgressIndicator indicator)
public abstract VirtualFile getFileBeingCurrentlyIndexed()
null
if current thread isn't indexing.public DumbModeAccessType getCurrentDumbModeAccessType()
public abstract void registerIndexableSet(IndexableFileSet set, Project project)
public abstract void removeIndexableSet(IndexableFileSet set)
public static FileBasedIndex getInstance()
public static int getFileId(VirtualFile file)
@Deprecated public abstract VirtualFile findFileById(Project project, int id)
ManagingFS.findFileById(int)
public void requestRebuild(ID<?,?> indexId)
public abstract <K,V> java.util.List<V> getValues(ID<K,V> indexId, K dataKey, GlobalSearchScope filter)
public abstract <K,V> java.util.Collection<VirtualFile> getContainingFiles(ID<K,V> indexId, K dataKey, GlobalSearchScope filter)
public abstract <K,V> boolean processValues(ID<K,V> indexId, K dataKey, VirtualFile inFile, FileBasedIndex.ValueProcessor<? super V> processor, GlobalSearchScope filter)
false
if ValueProcessor.process() returned false
; true
otherwise or if ValueProcessor was not called at allpublic <K,V> boolean processValues(ID<K,V> indexId, K dataKey, VirtualFile inFile, FileBasedIndex.ValueProcessor<? super V> processor, GlobalSearchScope filter, IdFilter idFilter)
false
if ValueProcessor.process() returned false
; true
otherwise or if ValueProcessor was not called at allpublic abstract <K,V> long getIndexModificationStamp(ID<K,V> indexId, Project project)
public abstract <K,V> boolean processFilesContainingAllKeys(ID<K,V> indexId, java.util.Collection<? extends K> dataKeys, GlobalSearchScope filter, Condition<? super V> valueChecker, Processor<? super VirtualFile> processor)
public abstract <K> java.util.Collection<K> getAllKeys(ID<K,?> indexId, Project project)
public abstract <K> void ensureUpToDate(ID<K,?> indexId, Project project, GlobalSearchScope filter)
public abstract void requestRebuild(ID<?,?> indexId, java.lang.Throwable throwable)
public abstract <K> void scheduleRebuild(ID<K,?> indexId, java.lang.Throwable e)
public abstract void requestReindex(VirtualFile file)
public abstract <K,V> boolean getFilesWithKey(ID<K,V> indexId, java.util.Set<? extends K> dataKeys, Processor<? super VirtualFile> processor, GlobalSearchScope filter)
public void ignoreDumbMode(java.lang.Runnable command, Project project, DumbModeAccessType dumbModeAccessType)
IndexNotReadyException
are not expected to be happen here.
In smart mode, the behavior is similar to direct command execution
command
- - a command to executeproject
- - project where dumb mode will be ignoreddumbModeAccessType
- - defines in which manner command should be executed. Does a client expect only reliable data
or any data from index is fine (even outdated and not yet updated)?public abstract <K> boolean processAllKeys(ID<K,?> indexId, Processor<? super K> processor, Project project)
public <K> boolean processAllKeys(ID<K,?> indexId, Processor<? super K> processor, GlobalSearchScope scope, IdFilter idFilter)
public abstract <K,V> java.util.Map<K,V> getFileData(ID<K,V> id, VirtualFile virtualFile, Project project)
public static void iterateRecursively(VirtualFile root, ContentIterator processor, ProgressIndicator indicator, java.util.Set<? super VirtualFile> visitedRoots, ProjectFileIndex projectFileIndex)
public void invalidateCaches()
public static boolean isIndexAccessDuringDumbModeEnabled()