}
private void removeDataFromIndicesForFile(final int fileId) {
- // All (indices) IDs should be valid in this running session (e.g. we can have ID instance existing but index is not registered)
- final List<ID<?, ?>> currentFileIndexedStates = IndexingStamp.getNontrivialFileIndexedStates(fileId);
- Collection<ID<?, ?>> states = currentFileIndexedStates;
- IndexConfiguration state = getState();
-
- for(ID<?,?> currentFileIndexedState: currentFileIndexedStates) {
- if (!state.hasIndex(currentFileIndexedState)) {
- states = ContainerUtil.intersection(currentFileIndexedStates, state.getIndexIDs());
- break;
- }
- }
+ final List<ID<?, ?>> states = IndexingStamp.getNontrivialFileIndexedStates(fileId);
if (!states.isEmpty()) {
- final Collection<ID<?, ?>> finalStates = states;
ProgressManager.getInstance().executeNonCancelableSection(new Runnable() {
@Override
public void run() {
- removeFileDataFromIndices(finalStates, fileId);
+ removeFileDataFromIndices(states, fileId);
}
});
}
ID<?, ?> id = ID.findById(DataInputOutputUtil.readINT(stream));
if (id != null) {
long stamp = getIndexCreationStamp(id);
+ if (stamp == 0) continue; // All (indices) IDs should be valid in this running session (e.g. we can have ID instance existing but index is not registered)
if (myIndexStamps == null) myIndexStamps = new TObjectLongHashMap<ID<?, ?>>(5, 0.98f);
if (stamp <= dominatingIndexStamp) myIndexStamps.put(id, stamp);
}
}
private void set(ID<?, ?> id, long tmst) {
- try {
- if (myIndexStamps == null) myIndexStamps = new TObjectLongHashMap<ID<?, ?>>(5, 0.98f);
+ if (myIndexStamps == null) myIndexStamps = new TObjectLongHashMap<ID<?, ?>>(5, 0.98f);
- myIndexStamps.put(id, tmst);
- }
- finally {
- myIsDirty = true;
- }
+ long previous = myIndexStamps.put(id, tmst);
+ if (previous != tmst) myIsDirty = true;
}
public boolean isDirty() {