Add a utility to make unique files/dirs easier, closes https://github.com/OpenHFT/Chronicle-Core/issues/149

This commit is contained in:
Peter Lawrey
2020-11-02 13:36:07 +00:00
parent 83e04bce22
commit 13fc38aa49
20 changed files with 28 additions and 2 deletions
@@ -17,6 +17,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.bytes.Byteable;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.values.Array;
import net.openhft.chronicle.values.Values;
@@ -17,6 +17,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import org.junit.Test;
import java.io.File;
@@ -18,7 +18,9 @@ package net.openhft.chronicle.map;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.json.JettisonMappedXmlDriver;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.io.Closeable;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.core.values.LongValue;
import net.openhft.chronicle.map.fromdocs.BondVOInterface;
import net.openhft.chronicle.values.Values;
@@ -17,6 +17,8 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.threads.NamedThreadFactory;
import org.junit.Test;
@@ -20,6 +20,8 @@ import com.google.common.collect.HashBiMap;
import com.google.common.primitives.Ints;
import net.openhft.chronicle.bytes.BytesMarshallable;
import net.openhft.chronicle.bytes.BytesStore;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.core.values.IntValue;
import net.openhft.chronicle.core.values.LongValue;
import net.openhft.chronicle.set.Builder;
@@ -16,6 +16,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.values.LongValue;
import net.openhft.chronicle.threads.NamedThreadFactory;
import org.junit.Ignore;
@@ -36,7 +37,6 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
public class EntryCountMapTest {
static final String TMP = OS.getTarget();
static final int ecmTests = Integer.getInteger("ecm.tests", 5);
double score = 0;
int scoreCount = 0;
@@ -3,6 +3,7 @@ package net.openhft.chronicle.map;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.pool.ClassAliasPool;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.wire.AbstractBytesMarshallable;
import org.junit.Test;
@@ -17,6 +17,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import org.junit.Test;
import java.io.File;
@@ -28,7 +29,7 @@ import java.io.IOException;
public class Issue125Test {
@Test
public void test() throws IOException {
final File cacheRoot = new File(OS.getTarget() + "/test-" + Time.unqiueId + ".cm3");
final File cacheRoot = new File(OS.getTarget() + "/test-" + Time.uniqueId() + ".cm3");
ChronicleMapBuilder<byte[], byte[]> shaToNodeBuilder =
ChronicleMapBuilder.of(byte[].class, byte[].class)
// .name("bytes-to-bytes")
@@ -17,6 +17,8 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.hash.ChronicleHashBuilderPrivateAPI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -16,6 +16,8 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.hash.Data;
import net.openhft.chronicle.hash.serialization.ListMarshaller;
import net.openhft.chronicle.hash.serialization.impl.CharSequenceBytesReader;
@@ -17,6 +17,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.algo.MemoryUnit;
import net.openhft.chronicle.core.OS;
import org.junit.Ignore;
import org.junit.Test;
@@ -17,6 +17,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.map.utility.ProcessInstanceLimiter;
import java.io.File;
@@ -16,6 +16,8 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import org.junit.Test;
import java.io.*;
@@ -16,6 +16,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.core.util.Time;
import org.junit.Ignore;
import org.junit.Test;
@@ -16,6 +16,7 @@
package net.openhft.chronicle.map.example;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import net.openhft.chronicle.threads.NamedThreadFactory;
@@ -17,6 +17,7 @@
package net.openhft.chronicle.map.externalizable;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import org.junit.Test;
@@ -16,6 +16,8 @@
package net.openhft.chronicle.map.fromdocs;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import net.openhft.chronicle.map.ExternalMapQueryContext;
@@ -16,6 +16,7 @@
package net.openhft.chronicle.map.ipc;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import org.slf4j.Logger;
@@ -23,6 +23,7 @@ import net.openhft.chronicle.algo.locks.TryAcquireOperations;
import net.openhft.chronicle.algo.locks.VanillaReadWriteWithWaitsLockingStrategy;
import net.openhft.chronicle.bytes.Byteable;
import net.openhft.chronicle.core.Jvm;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import net.openhft.chronicle.values.Array;
@@ -18,6 +18,7 @@ package net.openhft.lang.values;
import net.openhft.chronicle.core.OS;
import net.openhft.chronicle.core.pool.ClassAliasPool;
import net.openhft.chronicle.core.util.Time;
import net.openhft.chronicle.map.ChronicleMap;
import net.openhft.chronicle.map.ChronicleMapBuilder;
import org.json.JSONException;