HCOLL-163 renamed chronicle custer to chronicle channel

This commit is contained in:
Rob Austin
2014-10-13 18:23:24 +01:00
parent d01b5d8c59
commit 200322d268
7 changed files with 62 additions and 62 deletions
@@ -32,7 +32,7 @@ import static org.junit.Assert.assertTrue;
*
* @author Rob Austin.
*/
public class ClusterReplicationTest {
public class ChannelReplicationTest {
private ChronicleMap<Integer, CharSequence> map1a;
private ChronicleMap<Integer, CharSequence> map2a;
@@ -40,8 +40,8 @@ public class ClusterReplicationTest {
private ChronicleMap<Integer, CharSequence> map1b;
private ChronicleMap<Integer, CharSequence> map2b;
private ReplicatingChannel clusterB;
private ReplicatingChannel clusterA;
private ChannelReplicator channelReplicatorA;
private ChannelReplicator channelReplicatorB;
@Before
@@ -52,12 +52,13 @@ public class ClusterReplicationTest {
.of(8086, new InetSocketAddress("localhost", 8087))
.heartBeatInterval(1, SECONDS);
clusterA = new ReplicatingChannelBuilder((byte) 1, 1024).tcpReplication(tcpConfig)
.create();
channelReplicatorA = new ChannelReplicatorBuilder((byte) 1, 1024)
.tcpReplication(tcpConfig)
.create();
map1a = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterA.createChannel((short) 1))
.channel(channelReplicatorA.createChannel((short) 1))
.create(getPersistenceFile());
}
@@ -65,12 +66,12 @@ public class ClusterReplicationTest {
TcpReplicationConfig tcpConfig =
TcpReplicationConfig.of(8087).heartBeatInterval(1, SECONDS);
clusterB = new ReplicatingChannelBuilder((byte) 2, 1024).tcpReplication(tcpConfig)
channelReplicatorB = new ChannelReplicatorBuilder((byte) 2, 1024).tcpReplication(tcpConfig)
.create();
map1b = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterB.createChannel((short) 1))
.channel(channelReplicatorB.createChannel((short) 1))
.create(getPersistenceFile());
}
}
@@ -78,7 +79,7 @@ public class ClusterReplicationTest {
@After
public void tearDown() throws InterruptedException {
for (final Closeable closeable : new Closeable[]{clusterA, clusterB}) {
for (final Closeable closeable : new Closeable[]{channelReplicatorA, channelReplicatorB}) {
try {
closeable.close();
} catch (IOException e) {
@@ -93,13 +94,13 @@ public class ClusterReplicationTest {
map2b = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterB.createChannel((short) 2))
.channel(channelReplicatorB.createChannel((short) 2))
.create(getPersistenceFile());
map2a = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterA.createChannel((short) 2))
.channel(channelReplicatorA.createChannel((short) 2))
.create(getPersistenceFile());
map2a.put(1, "EXAMPLE-2");
@@ -43,11 +43,8 @@ public class PostClusterMapCreationTest {
private ChronicleMap<Integer, CharSequence> map1b;
private ChronicleMap<Integer, CharSequence> map2b;
private ReplicatingChannel clusterB;
private ReplicatingChannel clusterA;
private ReplicatingChannelBuilder replicatingClusterBuilder1;
private ChannelReplicator channelReplicatorA;
private ChannelReplicator channelReplicatorB;
public static File getPersistenceFile() {
String TMP = System.getProperty("java.io.tmpdir");
@@ -66,18 +63,18 @@ public class PostClusterMapCreationTest {
.of(8086, new InetSocketAddress("localhost", 8087))
.heartBeatInterval(1, SECONDS);
clusterA = new ReplicatingChannelBuilder((byte) 1, 1024)
channelReplicatorA = new ChannelReplicatorBuilder((byte) 1, 1024)
.tcpReplication(tcpReplicationConfig).create();
// this is how you add maps after the custer is created
map1a = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterA.createChannel((short) 1))
.channel(channelReplicatorA.createChannel((short) 1))
.create(getPersistenceFile());
map2a = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterA.createChannel((short) 2))
.channel(channelReplicatorA.createChannel((short) 2))
.create(getPersistenceFile());
}
@@ -87,18 +84,18 @@ public class PostClusterMapCreationTest {
.of(8087, new InetSocketAddress("localhost", 8086))
.heartBeatInterval(1, SECONDS);
clusterB = new ReplicatingChannelBuilder((byte) 2, 1024)
channelReplicatorB = new ChannelReplicatorBuilder((byte) 2, 1024)
.tcpReplication(tcpReplicationConfig).create();
// this is how you add maps after the custer is created
map1b = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterB.createChannel((short) 1))
.channel(channelReplicatorB.createChannel((short) 1))
.create(getPersistenceFile());
map2b = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterB.createChannel((short) 2))
.channel(channelReplicatorB.createChannel((short) 2))
.create(getPersistenceFile());
}
@@ -108,7 +105,7 @@ public class PostClusterMapCreationTest {
@After
public void tearDown() throws InterruptedException {
for (final Closeable closeable : new Closeable[]{clusterA, clusterB}) {
for (final Closeable closeable : new Closeable[]{channelReplicatorA, channelReplicatorB}) {
try {
closeable.close();
} catch (IOException e) {
@@ -41,9 +41,8 @@ public class SingleMapClusterTest {
private ChronicleMap<Integer, CharSequence> map1b;
private ReplicatingChannel clusterB;
private ReplicatingChannel clusterA;
private ChannelReplicator channelReplicatorA;
private ChannelReplicator channelReplicatorB;
public static File getPersistenceFile() {
String TMP = System.getProperty("java.io.tmpdir");
@@ -61,12 +60,12 @@ public class SingleMapClusterTest {
.of(8086, new InetSocketAddress("localhost", 8087))
.heartBeatInterval(1, SECONDS);
clusterA = new ReplicatingChannelBuilder((byte) 1, 1024)
channelReplicatorA = new ChannelReplicatorBuilder((byte) 1, 1024)
.tcpReplication(tcpReplicationConfig).create();
// this is how you add maps after the custer is created
map1a = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.entries(1000)
.channel(clusterA.createChannel((short) 1))
.channel(channelReplicatorA.createChannel((short) 1))
.create(getPersistenceFile());
}
@@ -76,11 +75,11 @@ public class SingleMapClusterTest {
.of(8087, new InetSocketAddress("localhost", 8086))
.heartBeatInterval(1, SECONDS);
clusterB = new ReplicatingChannelBuilder((byte) 2, 1024)
channelReplicatorB = new ChannelReplicatorBuilder((byte) 2, 1024)
.tcpReplication(tcpReplicationConfig).create();
// this is how you add maps after the custer is created
map1b = ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.channel(clusterB.createChannel((short) 1))
.channel(channelReplicatorB.createChannel((short) 1))
.entries(1000)
.create(getPersistenceFile());
}
@@ -89,7 +88,7 @@ public class SingleMapClusterTest {
@After
public void tearDown() throws InterruptedException {
for (final Closeable closeable : new Closeable[]{clusterA, clusterB}) {
for (final Closeable closeable : new Closeable[]{channelReplicatorA, channelReplicatorB}) {
try {
closeable.close();
} catch (IOException e) {