mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Renamed TcpConfig static factories back to of()
This commit is contained in:
@@ -72,7 +72,7 @@ public class Builder {
|
||||
final byte identifier,
|
||||
final int serverPort,
|
||||
final InetSocketAddress... endpoints) throws IOException {
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.forUnknownTopology(serverPort, Arrays.asList(endpoints))
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.of(serverPort, Arrays.asList(endpoints))
|
||||
.heartBeatInterval(1L, TimeUnit.SECONDS);
|
||||
return ChronicleMapBuilder.of(kClass, vClass)
|
||||
.replication(identifier, tcpConfig);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ChannelReplicationTest {
|
||||
public void setup() throws IOException {
|
||||
{
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.forSendingNode(8086, new InetSocketAddress("localhost", 8087))
|
||||
.of(8086, new InetSocketAddress("localhost", 8087))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
|
||||
hubA = ReplicationHub.builder()
|
||||
@@ -68,7 +68,7 @@ public class ChannelReplicationTest {
|
||||
|
||||
{
|
||||
TcpTransportAndNetworkConfig tcpConfig =
|
||||
TcpTransportAndNetworkConfig.forReceivingOnlyNode(8087).heartBeatInterval(1, SECONDS);
|
||||
TcpTransportAndNetworkConfig.of(8087).heartBeatInterval(1, SECONDS);
|
||||
|
||||
hubB = ReplicationHub.builder().tcpTransportAndNetwork(tcpConfig)
|
||||
.createWithId((byte) 2);
|
||||
|
||||
+2
-4
@@ -30,8 +30,6 @@ import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import static net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig.forSendingNode;
|
||||
|
||||
/**
|
||||
* Test ReplicatedChronicleMap where the Replicated is over a TCP Socket
|
||||
*
|
||||
@@ -240,7 +238,7 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
}
|
||||
|
||||
private ChronicleMapBuilder<Integer, CharSequence> clientBuilder() {
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.forReceivingOnlyNode(8077);
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.of(8077);
|
||||
return ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.entries(20000L)
|
||||
.replication((byte) 1, tcpConfig)
|
||||
@@ -259,7 +257,7 @@ public class EventListenerTestWithTCPSocketReplication {
|
||||
}
|
||||
|
||||
private ChronicleMapBuilder<Integer, CharSequence> serverBuilder() {
|
||||
TcpTransportAndNetworkConfig tcpConfig = forSendingNode(8076, new InetSocketAddress("localhost", 8077));
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.of(8076, new InetSocketAddress("localhost", 8077));
|
||||
return ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.entries(20000L)
|
||||
.replication((byte) 2, tcpConfig);
|
||||
|
||||
@@ -63,7 +63,7 @@ public class PostChannelCreationTest {
|
||||
|
||||
{
|
||||
final TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.forSendingNode(8086, new InetSocketAddress("localhost", 8087))
|
||||
.of(8086, new InetSocketAddress("localhost", 8087))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
|
||||
hubA = ReplicationHub.builder().tcpTransportAndNetwork(tcpConfig)
|
||||
@@ -82,7 +82,7 @@ public class PostChannelCreationTest {
|
||||
|
||||
{
|
||||
final TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.forSendingNode(8087, new InetSocketAddress("localhost", 8086))
|
||||
.of(8087, new InetSocketAddress("localhost", 8086))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
|
||||
hubB = ReplicationHub.builder().tcpTransportAndNetwork(tcpConfig)
|
||||
|
||||
@@ -61,7 +61,7 @@ public class SingleMapChannelTest {
|
||||
|
||||
{
|
||||
final TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.forSendingNode(8086, new InetSocketAddress("localhost", 8087))
|
||||
.of(8086, new InetSocketAddress("localhost", 8087))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
int maxEntrySize = 1024;
|
||||
byte identifier= 1;
|
||||
@@ -78,7 +78,7 @@ public class SingleMapChannelTest {
|
||||
|
||||
{
|
||||
final TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.forSendingNode(8087, new InetSocketAddress("localhost", 8086))
|
||||
.of(8087, new InetSocketAddress("localhost", 8086))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
|
||||
hubB = ReplicationHub.builder().tcpTransportAndNetwork(tcpConfig).createWithId((byte) 2);
|
||||
|
||||
@@ -56,7 +56,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
|
||||
serverMap.put(10, "EXAMPLE-10");
|
||||
}
|
||||
@@ -212,7 +212,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
|
||||
serverMap.put(10, "EXAMPLE-10");
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +287,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086))
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086))
|
||||
.putReturnsNull(true)
|
||||
.create();
|
||||
}
|
||||
@@ -333,7 +333,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086))
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086))
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.create();
|
||||
@@ -372,7 +372,7 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086))
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086))
|
||||
.putReturnsNull(true)
|
||||
.removeReturnsNull(true)
|
||||
.create();
|
||||
@@ -415,9 +415,9 @@ public class StatelessClientTest {
|
||||
// server
|
||||
{
|
||||
serverMap1 = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8086)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8086)).create();
|
||||
serverMap2 = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8077)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8077)).create();
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class TCPSocketReplication3wayPutReturnsNullTest {
|
||||
final byte identifier,
|
||||
final int serverPort,
|
||||
final InetSocketAddress... endpoints) throws IOException {
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.forUnknownTopology(serverPort, Arrays.asList(endpoints));
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig.of(serverPort, Arrays.asList(endpoints));
|
||||
|
||||
return (T) ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.putReturnsNull(true)
|
||||
|
||||
@@ -44,7 +44,7 @@ public class TwoMapOnDifferentServersTest {
|
||||
public void setup() throws IOException {
|
||||
|
||||
final TcpTransportAndNetworkConfig tcpConfig =
|
||||
TcpTransportAndNetworkConfig.forSendingNode(8076, new InetSocketAddress("localhost", 8077))
|
||||
TcpTransportAndNetworkConfig.of(8076, new InetSocketAddress("localhost", 8077))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TwoMapOnDifferentServersTest {
|
||||
|
||||
map2 = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
|
||||
.entries(20000)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(8077)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(8077)
|
||||
.heartBeatInterval(1, SECONDS)).create();
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class ChannelExample {
|
||||
byte identifier = (byte) 1;
|
||||
|
||||
TcpTransportAndNetworkConfig tcpConfig = TcpTransportAndNetworkConfig
|
||||
.forSendingNode(8086, new InetSocketAddress("localhost", 8087))
|
||||
.of(8086, new InetSocketAddress("localhost", 8087))
|
||||
.heartBeatInterval(1, SECONDS);
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ public class ChannelExample {
|
||||
byte identifier = (byte) 2;
|
||||
|
||||
TcpTransportAndNetworkConfig tcpConfig =
|
||||
TcpTransportAndNetworkConfig.forReceivingOnlyNode(8087).heartBeatInterval(1, SECONDS);
|
||||
TcpTransportAndNetworkConfig.of(8087).heartBeatInterval(1, SECONDS);
|
||||
|
||||
hubOnServer2 = ReplicationHub.builder()
|
||||
.tcpTransportAndNetwork(tcpConfig)
|
||||
|
||||
@@ -192,7 +192,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
|
||||
final ChronicleMap<Integer, String> serverMap =
|
||||
ChronicleMapBuilder.of(Integer.class, String.class)
|
||||
.replication((byte) 1, TcpTransportAndNetworkConfig.forReceivingOnlyNode(port)).create();
|
||||
.replication((byte) 1, TcpTransportAndNetworkConfig.of(port)).create();
|
||||
|
||||
final ChronicleMap<Integer, String> statelessMap = ChronicleMapBuilder.of(Integer
|
||||
.class, String.class)
|
||||
@@ -206,7 +206,7 @@ public class StatelessChronicleMapTest extends JSR166TestCase {
|
||||
IOException {
|
||||
|
||||
final ChronicleMap<CharSequence, CharSequence> serverMap = ChronicleMapBuilder.of(CharSequence.class, CharSequence.class)
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.forReceivingOnlyNode(port)).create();
|
||||
.replication((byte) 2, TcpTransportAndNetworkConfig.of(port)).create();
|
||||
|
||||
|
||||
final ChronicleMap<CharSequence, CharSequence> statelessMap = ChronicleMapBuilder.of(CharSequence
|
||||
|
||||
@@ -52,7 +52,7 @@ public class SetForTCPSocketReplication3wayTest {
|
||||
final int serverPort,
|
||||
final InetSocketAddress... endpoints) throws IOException {
|
||||
return (T) ChronicleSetBuilder.of(Integer.class)
|
||||
.replication(identifier, TcpTransportAndNetworkConfig.forUnknownTopology(serverPort, asList(endpoints))
|
||||
.replication(identifier, TcpTransportAndNetworkConfig.of(serverPort, asList(endpoints))
|
||||
.heartBeatInterval(1L, SECONDS))
|
||||
.createPersistedTo(getPersistenceFile());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user