mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
sleep 10 secs + main for test
This commit is contained in:
@@ -1672,6 +1672,8 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
replicated = replicationIdentifier != -1;
|
||||
persisted = true;
|
||||
|
||||
boolean created = false;
|
||||
|
||||
// It's important to canonicalize the file, because CanonicalRandomAccessFiles.acquire()
|
||||
// relies on java.io.File equality, which doesn't account symlinks itself.
|
||||
final File canonicalFile = file.getCanonicalFile();
|
||||
@@ -1679,7 +1681,8 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
if (recover)
|
||||
throw new FileNotFoundException("file " + canonicalFile + " should exist for recovery");
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
canonicalFile.createNewFile();
|
||||
created = canonicalFile.createNewFile();
|
||||
|
||||
}
|
||||
final RandomAccessFile raf = CanonicalRandomAccessFiles.acquire(canonicalFile);
|
||||
final ChronicleHashResources resources = new PersistedChronicleHashResources(canonicalFile);
|
||||
@@ -1688,6 +1691,11 @@ public final class ChronicleMapBuilder<K, V> implements
|
||||
if (raf.length() > 0) {
|
||||
result = openWithExistingFile(canonicalFile, raf, resources, recover, overrideBuilderConfig, corruptionListener);
|
||||
} else {
|
||||
if (created) {
|
||||
System.out.println("Sleeping before lock acquisition for 10 seconds");
|
||||
|
||||
Jvm.pause(10000);
|
||||
}
|
||||
|
||||
// Atomic* allows lambda modification
|
||||
final AtomicReference<VanillaChronicleMap<K, V, ?>> map = new AtomicReference<>();
|
||||
|
||||
Reference in New Issue
Block a user