diff options
author | 2017-11-30 11:09:35 -0800 | |
---|---|---|
committer | 2017-11-30 11:11:06 -0800 | |
commit | 559a07d2dd88a53d6dac8bf2d77a28db44fd7659 (patch) | |
tree | 1d2d6bc6317d6a8fca6d776510f6cb0cceb6e172 /src/main/java/com/google/devtools/build/lib/unix | |
parent | 1c9b698ede5527ff658b70ee15ef8eed01beb034 (diff) |
Refactor the FileSystem API to allow for different hash functions.
Refactor the FileSystem class to include the hash function as an
instance field. This allows us to have a different hash function
per FileSystem and removes technical debt, as currently that's
somewhat accomplished by a horrible hack that has a static method
to set the hash function for all FileSystem instances.
The FileSystem's default hash function remains MD5.
RELNOTES: None
PiperOrigin-RevId: 177479772
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/unix')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java b/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java index 72476805bc..1a13b461fc 100644 --- a/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java @@ -36,9 +36,14 @@ import java.util.List; */ @ThreadSafe public class UnixFileSystem extends AbstractFileSystemWithCustomStat { + public UnixFileSystem() { } + public UnixFileSystem(HashFunction hashFunction) { + super(hashFunction); + } + /** * Eager implementation of FileStatus for file systems that have an atomic * stat(2) syscall. A proxy for {@link com.google.devtools.build.lib.unix.FileStatus}. |