use of com.intellij.util.indexing.StorageException in project intellij-community by JetBrains.
the class CompilerReferenceServiceImpl method getReferentFileIds.
@Nullable
private TIntHashSet getReferentFileIds(@NotNull PsiElement element) {
final CompilerElementInfo compilerElementInfo = asCompilerElements(element, true);
if (compilerElementInfo == null)
return null;
myReadDataLock.lock();
try {
if (myReader == null)
return null;
TIntHashSet referentFileIds = new TIntHashSet();
for (LightRef ref : compilerElementInfo.searchElements) {
try {
final TIntHashSet referents = myReader.findReferentFileIds(ref, compilerElementInfo.place == ElementPlace.SRC);
if (referents == null)
return null;
referentFileIds.addAll(referents.toArray());
} catch (StorageException e) {
throw new RuntimeException(e);
}
}
return referentFileIds;
} finally {
myReadDataLock.unlock();
}
}
use of com.intellij.util.indexing.StorageException in project intellij-community by JetBrains.
the class UpdateData method iterateKeys.
public void iterateKeys(KeyValueUpdateProcessor<Key, Value> addProcessor, KeyValueUpdateProcessor<Key, Value> updateProcessor, RemovedKeyProcessor<Key> removeProcessor) throws StorageException {
final InputDataDiffBuilder<Key, Value> currentData;
try {
currentData = getCurrentDataEvaluator().compute();
} catch (IOException e) {
throw new StorageException(e);
}
currentData.differentiate(myNewData, addProcessor, updateProcessor, removeProcessor);
}
use of com.intellij.util.indexing.StorageException in project intellij-community by JetBrains.
the class MapIndexStorage method removeAllValues.
@Override
public void removeAllValues(@NotNull Key key, int inputId) throws StorageException {
try {
myMap.markDirty();
// important: assuming the key exists in the index
read(key).removeAssociatedValue(inputId);
} catch (IOException e) {
throw new StorageException(e);
}
}
use of com.intellij.util.indexing.StorageException in project intellij-community by JetBrains.
the class MapIndexStorage method clear.
@Override
public void clear() throws StorageException {
try {
myMap.close();
} catch (IOException e) {
LOG.error(e);
} catch (RuntimeException e) {
LOG.error(e);
}
try {
IOUtil.deleteAllFilesStartingWith(getStorageFile());
initMapAndCache();
} catch (IOException e) {
throw new StorageException(e);
} catch (RuntimeException e) {
unwrapCauseAndRethrow(e);
}
}
use of com.intellij.util.indexing.StorageException in project intellij-community by JetBrains.
the class IndexDataGetter method buildFileNamesData.
@NotNull
public FileNamesData buildFileNamesData(@NotNull FilePath path) {
FileNamesData result = new FileNamesData();
VirtualFile root = VcsUtil.getVcsRootFor(myProject, path);
if (myRoots.contains(root)) {
try {
myIndexStorage.paths.iterateCommits(Collections.singleton(path), (paths, commit) -> result.add(commit, paths));
result.pack();
} catch (IOException | StorageException e) {
myFatalErrorsConsumer.consume(this, e);
}
}
return result;
}
Aggregations