indexes: snapshot single value storage should drop caches on index update

GitOrigin-RevId: 146fd6a9601aa09e70a98b8f5a69e8670d32c911
This commit is contained in:
Dmitry Batkovich
2020-05-09 05:25:10 +00:00
committed by intellij-monorepo-bot
parent ab5e1e1fea
commit e79b5b2ea1
2 changed files with 4 additions and 1 deletions
@@ -193,8 +193,9 @@ public class SnapshotInputMappings<Key, Value> implements UpdatableSnapshotInput
int hash = doGetContentHash((FileContentImpl)content);
if (myCompositeHashIdEnumerator != null) {
int subIndexerTypeId = mySubIndexerRetriever.getFileIndexerId(content);
return myCompositeHashIdEnumerator.enumerate(hash, subIndexerTypeId);
hash = myCompositeHashIdEnumerator.enumerate(hash, subIndexerTypeId);
}
return hash;
}
@@ -96,6 +96,7 @@ public class SnapshotSingleValueIndexStorage<Key, Value> implements VfsAwareInde
public void addValue(Key key, int inputId, Value value) {
assert myInitialized;
checkKeyInputIdConsistency(key, inputId);
myCache.remove(key);
// do nothing, all data update is served by forward index, the only one we need to serve here is read access
}
@@ -103,6 +104,7 @@ public class SnapshotSingleValueIndexStorage<Key, Value> implements VfsAwareInde
public void removeAllValues(@NotNull Key key, int inputId) {
assert myInitialized;
checkKeyInputIdConsistency(key, inputId);
myCache.remove(key);
// do nothing, all data update is served by forward index, the only one we need to serve here is read access
}