This commit is contained in:
Rob Austin
2014-11-04 14:44:59 +00:00
parent a0c89935f5
commit 9dec1ed4db
64 changed files with 700 additions and 865 deletions
@@ -16,8 +16,8 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.hash.replication.TcpConfig;
import net.openhft.chronicle.hash.replication.UdpConfig;
import net.openhft.chronicle.hash.TcpReplicationConfig;
import net.openhft.chronicle.hash.UdpReplicationConfig;
import org.jetbrains.annotations.NotNull;
import java.io.Closeable;
@@ -25,18 +25,10 @@ import java.io.IOException;
final class Replicators {
static final String ONLY_UDP_WARN_MESSAGE =
"MISSING TCP REPLICATION : The UdpReplicator only attempts to read data " +
"(it does not enforce or guarantee delivery), you should use" +
"the UdpReplicator if you have a large number of nodes, and you wish" +
"to receive the data before it becomes available on TCP/IP. Since data" +
"delivery is not guaranteed, it is recommended that you only use" +
"the UDP Replicator in conjunction with a TCP Replicator";
private Replicators() {
}
static Replicator tcp(final TcpConfig replicationConfig) {
static Replicator tcp(final TcpReplicationConfig replicationConfig) {
return new Replicator() {
@Override
@@ -50,17 +42,16 @@ final class Replicators {
.keyBuilder, builder.valueBuilder);
StatelessServerConnector statelessServer = new StatelessServerConnector
(keyValueSerializer, (VanillaChronicleMap) chronicleMap,
builder.entrySize(true));
(keyValueSerializer, (VanillaChronicleMap) chronicleMap, builder.entrySize());
return new TcpReplicator(replica, entryExternalizable, replicationConfig,
builder.entrySize(true), statelessServer);
builder.entrySize(), statelessServer);
}
};
}
static Replicator udp(
final UdpConfig replicationConfig) {
final UdpReplicationConfig replicationConfig) {
return new Replicator() {
@Override
@@ -70,7 +61,7 @@ final class Replicators {
final ChronicleMap chronicleMap)
throws IOException {
return new UdpReplicator(map, entryExternalizable, replicationConfig,
builder.entrySize(true));
builder.entrySize());
}
};
}