Skip to content

Commit df5104a

Browse files
committed
GH-1071: enable delta-based cache storage by default
1 parent ad1d5d3 commit df5104a

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/app/BootLanguageServerBootApp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
import org.springframework.ide.vscode.boot.common.RelaxedNameConfig;
4343
import org.springframework.ide.vscode.boot.index.SpringMetamodelIndex;
4444
import org.springframework.ide.vscode.boot.index.cache.IndexCache;
45-
import org.springframework.ide.vscode.boot.index.cache.IndexCacheOnDisc;
45+
import org.springframework.ide.vscode.boot.index.cache.IndexCacheOnDiscDeltaBased;
4646
import org.springframework.ide.vscode.boot.index.cache.IndexCacheVoid;
4747
import org.springframework.ide.vscode.boot.java.JavaDefinitionHandler;
4848
import org.springframework.ide.vscode.boot.java.beans.DependsOnDefinitionProvider;
@@ -150,7 +150,7 @@ public static void main(String[] args) throws Exception {
150150
@Bean
151151
IndexCache symbolCache(BootLsConfigProperties props) {
152152
if (props.isSymbolCacheEnabled()) {
153-
return new IndexCacheOnDisc(new File(props.getSymbolCacheDir()));
153+
return new IndexCacheOnDiscDeltaBased(new File(props.getSymbolCacheDir()));
154154
} else {
155155
return new IndexCacheVoid();
156156
}

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/index/cache/IndexCacheOnDiscDeltaBased.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ private boolean isFileMatch(SortedMap<String, Long> files1, SortedMap<String, Lo
292292

293293
private <T extends IndexCacheable> void compact(IndexCacheKey cacheKey, Class<T> type) {
294294
if (this.compactingCounter.get(cacheKey) > this.compactingCounterBoundary) {
295+
log.info("compacting...");
296+
295297
IndexCacheStore<T> compactedData = retrieveStoreFromIncrementalStorage(cacheKey, type).getLeft();
296298
persist(cacheKey, new DeltaSnapshot<T>(compactedData), false);
297299
this.compactingCounter.put(cacheKey, 0);

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringFactoriesIndexer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public class SpringFactoriesIndexer implements SpringIndexer {
6060

6161
// whenever the implementation of the indexer changes in a way that the stored data in the cache is no longer valid,
6262
// we need to change the generation - this will result in a re-indexing due to no up-to-date cache data being found
63-
private static final String GENERATION = "GEN-6";
63+
private static final String GENERATION = "GEN-7";
6464

6565
private static final String FILE_PATTERN = "**/META-INF/spring/*.factories";
6666

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerJava.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static enum SCAN_PASS {
9393

9494
// whenever the implementation of the indexer changes in a way that the stored data in the cache is no longer valid,
9595
// we need to change the generation - this will result in a re-indexing due to no up-to-date cache data being found
96-
private static final String GENERATION = "GEN-7";
96+
private static final String GENERATION = "GEN-8";
9797
private static final String INDEX_FILES_TASK_ID = "index-java-source-files-task-";
9898

9999
private static final String SYMBOL_KEY = "symbols";

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/utils/SpringIndexerXML.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class SpringIndexerXML implements SpringIndexer {
5454

5555
// whenever the implementation of the indexer changes in a way that the stored data in the cache is no longer valid,
5656
// we need to change the generation - this will result in a re-indexing due to no up-to-date cache data being found
57-
private static final String GENERATION = "GEN-5";
57+
private static final String GENERATION = "GEN-6";
5858

5959
private static final String SYMBOL_KEY = "symbols";
6060
private static final String BEANS_KEY = "beans";

0 commit comments

Comments
 (0)