mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Use ChronicleMapBuilder to build all ChronicleMap
This commit is contained in:
@@ -18,7 +18,10 @@
|
||||
|
||||
package net.openhft.chronicle.map;
|
||||
|
||||
import net.openhft.chronicle.hash.*;
|
||||
import net.openhft.chronicle.hash.ChronicleHashBuilder;
|
||||
import net.openhft.chronicle.hash.ChronicleHashErrorListener;
|
||||
import net.openhft.chronicle.hash.ChronicleHashErrorListeners;
|
||||
import net.openhft.chronicle.hash.ChronicleHashInstanceBuilder;
|
||||
import net.openhft.chronicle.hash.replication.*;
|
||||
import net.openhft.chronicle.hash.serialization.*;
|
||||
import net.openhft.chronicle.hash.serialization.internal.MetaBytesInterop;
|
||||
@@ -188,6 +191,11 @@ public final class ChronicleMapBuilder<K, V> implements Cloneable,
|
||||
return new ChronicleMapBuilder<>(keyClass, valueClass);
|
||||
}
|
||||
|
||||
public static <K, V> ChronicleMapStatelessClientBuilder<K, V> of(
|
||||
@NotNull Class<K> keyClass, @NotNull Class<V> valueClass, InetSocketAddress socketAddress) {
|
||||
return ChronicleMapStatelessClientBuilder.of(socketAddress);
|
||||
}
|
||||
|
||||
private static long roundUpMapHeaderSize(long headerSize) {
|
||||
long roundUp = (headerSize + 127L) & ~127L;
|
||||
if (roundUp - headerSize < 64)
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class ChronicleMapStatelessClientBuilder<K, V> implements
|
||||
ChronicleMap<K, V>>,
|
||||
MapBuilder<ChronicleMapStatelessClientBuilder<K, V>> {
|
||||
|
||||
public static <K, V> ChronicleMapStatelessClientBuilder<K, V> of(
|
||||
static <K, V> ChronicleMapStatelessClientBuilder<K, V> of(
|
||||
InetSocketAddress serverAddress) {
|
||||
return new ChronicleMapStatelessClientBuilder<>(serverAddress);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package net.openhft.chronicle.set;
|
||||
|
||||
import net.openhft.chronicle.hash.ChronicleHashStatelessClientBuilder;
|
||||
import net.openhft.chronicle.map.ChronicleMapBuilder;
|
||||
import net.openhft.chronicle.map.ChronicleMapStatelessClientBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -34,7 +35,8 @@ public final class ChronicleSetStatelessClientBuilder<E> implements
|
||||
private final ChronicleMapStatelessClientBuilder<E, DummyValue> mapClientBuilder;
|
||||
|
||||
ChronicleSetStatelessClientBuilder(InetSocketAddress serverAddress) {
|
||||
this.mapClientBuilder = ChronicleMapStatelessClientBuilder.of(serverAddress);
|
||||
Class<E> eClass = null;
|
||||
this.mapClientBuilder = ChronicleMapBuilder.of(eClass, DummyValue.class, serverAddress);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user