aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
diff options
context:
space:
mode:
authorGravatar tomlu <tomlu@google.com>2018-08-15 10:06:40 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-08-15 10:08:23 -0700
commit9395d11c2fd14cdc4293ef11f3b30516267a3eb1 (patch)
tree09243ac07f286afc071ae0ad284fbc3537ca60e8 /src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
parent7892f0a14f2016f1897b0a3a292de116b03bbecf (diff)
Have DigestMap support multiple hash functions.
RELNOTES: None PiperOrigin-RevId: 208837641
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java b/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
index 8eb4131793..e0481b98f6 100644
--- a/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
+++ b/src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
@@ -20,6 +20,7 @@ import com.google.common.collect.Multiset;
import com.google.devtools.build.lib.actions.CommandLineItem;
import com.google.devtools.build.lib.actions.CommandLineItem.MapFn;
import com.google.devtools.build.lib.util.Fingerprint;
+import com.google.devtools.build.lib.vfs.DigestHashFunction;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -27,7 +28,6 @@ import java.util.concurrent.ConcurrentHashMap;
/** Computes fingerprints for nested sets, reusing sub-computations from children. */
public class NestedSetFingerprintCache {
- private static final int DIGEST_SIZE = 16;
private static final int EMPTY_SET_DIGEST = 104_395_303;
/** Memoize the subresults. We have to have one cache per type of command item map function. */
@@ -121,6 +121,8 @@ public class NestedSetFingerprintCache {
mapFnClass.getName()));
}
}
- return new DigestMap(DIGEST_SIZE, 1024);
+ // TODO(b/112460990): Use the value from DigestHashFunction.getDefault(), but check for
+ // contention.
+ return new DigestMap(DigestHashFunction.MD5, 1024);
}
}