summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorOla Aunrønning <olaa@verizonmedia.com>2022-01-28 15:21:01 +0100
committerOla Aunrønning <olaa@verizonmedia.com>2022-01-28 15:21:01 +0100
commit58dcb2771a5c7fe968375557581ba581bafefc48 (patch)
treec9d070bcdee4f127d16835ba0c1b47ae719121d4 /controller-server
parent1540a0c6527f28634631bee9ae2efc89526a5273 (diff)
Use different hashing
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java
index f5910f2a98e..da62175089d 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/ApplicationPackage.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.application.pkg;
+import com.google.common.hash.Funnel;
import com.google.common.hash.Hashing;
import com.yahoo.component.Version;
import com.yahoo.config.application.FileSystemWrapper;
@@ -223,7 +224,11 @@ public class ApplicationPackage {
private String calculateBundleHash() {
Predicate<String> entryMatcher = name -> !name.endsWith(deploymentFile) && !name.endsWith(buildMetaFile);
SortedMap<String, Long> entryCRCs = ZipStreamReader.getEntryCRCs(new ByteArrayInputStream(zippedContent), entryMatcher);
- return String.valueOf(entryCRCs.hashCode());
+ Funnel<SortedMap<String, Long>> funnel = (from, into) -> from.entrySet().forEach(entry -> {
+ into.putBytes(entry.getKey().getBytes());
+ into.putLong(entry.getValue());
+ });
+ return Hashing.sha1().hashObject(entryCRCs, funnel).toString();
}