diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2021-02-05 19:43:42 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2021-02-05 19:43:42 -0500 |
commit | c2990810e9c50ef78f116ffcb2a55a24cdcc6e0c (patch) | |
tree | 4192a340f73fc2577aae6a8c7e7f94de0097165b /org.eclipse.jgit | |
parent | f077158acf64dfee6fafba46d2db375a1c938809 (diff) | |
parent | b832b068d2efdf09edf29d015748039b5be27e76 (diff) | |
download | jgit-c2990810e9c50ef78f116ffcb2a55a24cdcc6e0c.tar.gz jgit-c2990810e9c50ef78f116ffcb2a55a24cdcc6e0c.zip |
Merge "reftable: add random suffix to table names"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java index db454b92b8..e422767f09 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/FileReftableStack.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.nio.file.Files; import java.nio.file.StandardCopyOption; +import java.security.SecureRandom; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -65,6 +66,8 @@ public class FileReftableStack implements AutoCloseable { private final Runnable onChange; + private final SecureRandom random = new SecureRandom(); + private final Supplier<Config> configSupplier; // Used for stats & testing. @@ -365,8 +368,9 @@ public class FileReftableStack implements AutoCloseable { } private String filename(long low, long high) { - return String.format("%012x-%012x", //$NON-NLS-1$ - Long.valueOf(low), Long.valueOf(high)); + return String.format("%012x-%012x-%08x", //$NON-NLS-1$ + Long.valueOf(low), Long.valueOf(high), + random.nextInt()); } /** |