aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/remote
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2018-06-21 18:57:26 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-21 18:59:08 -0700
commitbda12a1b239235de0169b14760214e43f839bed8 (patch)
treead47596f2e0d52dbaf7faf1fb7239145cbaa8b8f /src/tools/remote
parenta8d7357b7dc66e0531c298e4d369e6342fcf94b7 (diff)
Move HashFunction out of FileSystem, and turn it into a class, instead of an enum.
Now that we aren't using enum names for the hash functions, we also accept the standard names, such as SHA-256. RELNOTES: None. PiperOrigin-RevId: 201624286
Diffstat (limited to 'src/tools/remote')
-rw-r--r--src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java
index 6f6b2c111e..bf4d89123d 100644
--- a/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java
+++ b/src/tools/remote/src/main/java/com/google/devtools/build/remote/worker/RemoteWorker.java
@@ -43,8 +43,9 @@ import com.google.devtools.build.lib.shell.CommandResult;
import com.google.devtools.build.lib.util.OS;
import com.google.devtools.build.lib.util.ProcessUtils;
import com.google.devtools.build.lib.util.SingleLineFormatter;
+import com.google.devtools.build.lib.vfs.DigestHashFunction;
+import com.google.devtools.build.lib.vfs.DigestHashFunction.DigestFunctionConverter;
import com.google.devtools.build.lib.vfs.FileSystem;
-import com.google.devtools.build.lib.vfs.FileSystem.HashFunction;
import com.google.devtools.build.lib.vfs.FileSystemUtils;
import com.google.devtools.build.lib.vfs.JavaIoFileSystem;
import com.google.devtools.build.lib.vfs.Path;
@@ -93,11 +94,11 @@ public final class RemoteWorker {
private final ExecutionImplBase execServer;
static FileSystem getFileSystem() {
- final HashFunction hashFunction;
+ final DigestHashFunction hashFunction;
String value = null;
try {
value = System.getProperty("bazel.DigestFunction", "SHA256");
- hashFunction = new HashFunction.Converter().convert(value);
+ hashFunction = new DigestFunctionConverter().convert(value);
} catch (OptionsParsingException e) {
throw new Error("The specified hash function '" + value + "' is not supported.");
}