use of com.intellij.util.indexing.impl.MapReduceIndex in project intellij-community by JetBrains.
the class FileBasedIndexImpl method cleanupForNextTest.
@TestOnly
public void cleanupForNextTest() {
myChangedFilesCollector.ensureUpToDate();
myTransactionMap = SmartFMap.emptyMap();
IndexConfiguration state = getState();
for (ID<?, ?> indexId : state.getIndexIDs()) {
final MapReduceIndex index = (MapReduceIndex) state.getIndex(indexId);
assert index != null;
final MemoryIndexStorage memStorage = (MemoryIndexStorage) index.getStorage();
index.getWriteLock().lock();
try {
memStorage.clearCaches();
} finally {
index.getWriteLock().unlock();
}
}
}
use of com.intellij.util.indexing.impl.MapReduceIndex in project intellij-community by JetBrains.
the class FileBasedIndexImpl method setDataBufferingEnabled.
@NotNull
private StorageGuard.StorageModeExitHandler setDataBufferingEnabled(final boolean enabled) {
StorageGuard.StorageModeExitHandler storageModeExitHandler = myStorageLock.enter(enabled);
if (myPreviousDataBufferingState != enabled) {
synchronized (myBufferingStateUpdateLock) {
if (myPreviousDataBufferingState != enabled) {
IndexConfiguration state = getState();
for (ID<?, ?> indexId : state.getIndexIDs()) {
final MapReduceIndex index = (MapReduceIndex) state.getIndex(indexId);
assert index != null;
((MemoryIndexStorage) index.getStorage()).setBufferingEnabled(enabled);
}
myPreviousDataBufferingState = enabled;
}
}
}
return storageModeExitHandler;
}
use of com.intellij.util.indexing.impl.MapReduceIndex in project intellij-community by JetBrains.
the class FileBasedIndexImpl method cleanupMemoryStorage.
private void cleanupMemoryStorage() {
myLastIndexedDocStamps.clear();
waitUntilIndicesAreInitialized();
IndexConfiguration state = getState();
for (ID<?, ?> indexId : state.getIndexIDs()) {
final MapReduceIndex index = (MapReduceIndex) state.getIndex(indexId);
assert index != null;
final MemoryIndexStorage memStorage = (MemoryIndexStorage) index.getStorage();
index.getWriteLock().lock();
try {
memStorage.clearMemoryMap();
} finally {
index.getWriteLock().unlock();
}
memStorage.fireMemoryStorageCleared();
}
}
Aggregations