summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorIvan Frade <ifrade@google.com>2024-10-07 16:09:32 +0000
committerGerrit Code Review <support@gerrithub.io>2024-10-07 16:09:32 +0000
commitc213c90d677004d8cc0f59744a75edec9df5424a (patch)
tree6e364c6758cc177255b24b0bd4b36f5a2dee4e82 /org.eclipse.jgit/src/org/eclipse/jgit
parentb1c83bfbd799647ab6762eb493f3c018938488b1 (diff)
parent7e85e7e21e29769c596694ea8492ffbc6dc3d9af (diff)
downloadjgit-c213c90d677004d8cc0f59744a75edec9df5424a.tar.gz
jgit-c213c90d677004d8cc0f59744a75edec9df5424a.zip
Merge "DfsBlockCache: use PackExtBlockCacheTable when configured"
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
index 3e1300c867..0334450fbe 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsBlockCache.java
@@ -97,7 +97,12 @@ public final class DfsBlockCache {
double streamRatio = cfg.getStreamRatio();
maxStreamThroughCache = (long) (maxBytes * streamRatio);
- dfsBlockCacheTable = new ClockBlockCacheTable(cfg);
+ if (!cfg.getPackExtCacheConfigurations().isEmpty()) {
+ dfsBlockCacheTable = PackExtBlockCacheTable
+ .fromBlockCacheConfigs(cfg);
+ } else {
+ dfsBlockCacheTable = new ClockBlockCacheTable(cfg);
+ }
for (int i = 0; i < PackExt.values().length; ++i) {
Integer limit = cfg.getCacheHotMap().get(PackExt.values()[i]);
@@ -158,8 +163,7 @@ public final class DfsBlockCache {
* @return total number of requests (hit + miss), per pack file extension.
*/
public long[] getTotalRequestCount() {
- return dfsBlockCacheTable.getBlockCacheStats()
- .getTotalRequestCount();
+ return dfsBlockCacheTable.getBlockCacheStats().getTotalRequestCount();
}
/**