mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Merge branch 'master' into new-license
This commit is contained in:
@@ -618,7 +618,7 @@ public class ChronicleMapTest {
|
||||
.entries((long) entries)
|
||||
.minSegments(1)
|
||||
.averageKeySize(10)
|
||||
.entryAndValueOffsetAlignment(4)
|
||||
.entryAndValueOffsetAlignment(8)
|
||||
.create()) {
|
||||
LongValue value4 = Values.newNativeReference(LongValue.class);
|
||||
LongValue value22 = Values.newNativeReference(LongValue.class);
|
||||
@@ -650,9 +650,9 @@ public class ChronicleMapTest {
|
||||
try (ChronicleMap<CharSequence, LongValue> map1 = ChronicleMapBuilder.of(CharSequence.class,
|
||||
LongValue.class)
|
||||
.entries((long) entries)
|
||||
.minSegments(1)
|
||||
// .minSegments(1)
|
||||
.averageKeySize(10)
|
||||
.entryAndValueOffsetAlignment(1)
|
||||
// .entryAndValueOffsetAlignment(8)
|
||||
.create()) {
|
||||
LongValue value1 = Values.newNativeReference(LongValue.class);
|
||||
LongValue value21 = Values.newNativeReference(LongValue.class);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.core.Jvm;
|
||||
import net.openhft.chronicle.core.values.IntValue;
|
||||
import net.openhft.chronicle.values.MaxUtf8Length;
|
||||
import net.openhft.chronicle.values.Values;
|
||||
@@ -28,6 +29,7 @@ import java.util.Map;
|
||||
import static net.openhft.chronicle.values.Values.newNativeReference;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assume.assumeFalse;
|
||||
|
||||
interface DemoOrderVOInterface {
|
||||
public CharSequence getSymbol();
|
||||
@@ -47,6 +49,7 @@ public class DemoChronicleMapTest {
|
||||
|
||||
@Test
|
||||
public void testMap() throws IOException {
|
||||
assumeFalse(Jvm.isArm());
|
||||
File file = File.createTempFile("DummyOrders" + System.currentTimeMillis(), ".test");
|
||||
file.deleteOnExit();
|
||||
int maxEntries = 1000;
|
||||
@@ -55,6 +58,7 @@ public class DemoChronicleMapTest {
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.entries(maxEntries)
|
||||
.entryAndValueOffsetAlignment(8)
|
||||
.createPersistedTo(file)) {
|
||||
IntValue key = Values.newHeapInstance(IntValue.class);
|
||||
|
||||
@@ -89,6 +93,7 @@ public class DemoChronicleMapTest {
|
||||
|
||||
@Test
|
||||
public void testMapLocked() throws IOException {
|
||||
assumeFalse(Jvm.isArm());
|
||||
File file = File.createTempFile("DummyOrders-" + System.currentTimeMillis(), ".test");
|
||||
file.deleteOnExit();
|
||||
int maxEntries = 1000;
|
||||
@@ -97,6 +102,7 @@ public class DemoChronicleMapTest {
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.entries(maxEntries)
|
||||
.entryAndValueOffsetAlignment(8)
|
||||
.createPersistedTo(file)) {
|
||||
IntValue key = Values.newHeapInstance(IntValue.class);
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.core.Jvm;
|
||||
import net.openhft.chronicle.core.values.LongValue;
|
||||
import net.openhft.chronicle.hash.ChecksumEntry;
|
||||
import net.openhft.chronicle.hash.ChronicleHashBuilderPrivateAPI;
|
||||
@@ -39,6 +40,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import static net.openhft.chronicle.map.ChronicleMapTest.getPersistenceFile;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.junit.Assume.assumeFalse;
|
||||
|
||||
public class RecoverTest {
|
||||
|
||||
@@ -125,6 +127,7 @@ public class RecoverTest {
|
||||
|
||||
@Test
|
||||
public void testCorruptedEntryRecovery() throws IOException {
|
||||
assumeFalse(Jvm.isArm());
|
||||
File file = getPersistenceFile();
|
||||
try (ChronicleMap<Integer, LongValue> map = ChronicleMap
|
||||
.of(Integer.class, LongValue.class)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package net.openhft.chronicle.map.fromdocs;
|
||||
|
||||
import net.openhft.chronicle.core.Jvm;
|
||||
import net.openhft.chronicle.core.values.LongValue;
|
||||
import net.openhft.chronicle.hash.ChecksumEntry;
|
||||
import net.openhft.chronicle.map.ChronicleMap;
|
||||
@@ -29,10 +30,13 @@ import org.junit.Test;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assume.assumeFalse;
|
||||
|
||||
public class ChecksumEntryTest {
|
||||
|
||||
@Test
|
||||
public void testChecksumEntriesWithValueInterface() throws IOException {
|
||||
assumeFalse(Jvm.isArm());
|
||||
File file = Builder.getPersistenceFile();
|
||||
|
||||
try (ChronicleMap<Integer, LongValue> map = ChronicleMap
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.openhft.chronicle.map.ExternalMapQueryContext;
|
||||
import net.openhft.chronicle.values.Values;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
@@ -98,8 +99,7 @@ public class OpenJDKAndHashMapExamplesTest {
|
||||
|
||||
BondVOInterface bond = Values.newNativeReference(BondVOInterface.class);
|
||||
// lookup the key and give me a reference I can update in a thread safe way.
|
||||
try (net.openhft.chronicle.core.io.Closeable c =
|
||||
chm.acquireContext("369604103", bond)) {
|
||||
try (Closeable c = chm.acquireContext("369604103", bond)) {
|
||||
// found a key and bond has been set
|
||||
// get directly without touching the rest of the record.
|
||||
long _matDate = bond.getMaturityDate();
|
||||
|
||||
Reference in New Issue
Block a user