This commit is contained in:
Rob Austin
2014-11-04 14:29:06 +00:00
parent cff7c5bea8
commit a0c89935f5
76 changed files with 1248 additions and 2153 deletions
@@ -51,7 +51,7 @@ public class TCPSocketReplicationBootStrapTests {
newTcpSocketShmBuilder(Integer.class, CharSequence.class,
(byte) 2, 8076, new InetSocketAddress("localhost", 8079));
final ChronicleMap<Integer, CharSequence> map2a =
map2aBuilder.file(getPersistenceFile()).create();
map2aBuilder.createPersistedTo(getPersistenceFile());
map2a.put(10, "EXAMPLE-10"); // this will be the last time that map1 go an update from map2
long lastModificationTime;
@@ -69,16 +69,14 @@ public class TCPSocketReplicationBootStrapTests {
// restart map 2 but don't doConnect it to map one
final ChronicleMap<Integer, CharSequence> map2b =
ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.file(map2File)
.create();
.createPersistedTo(map2File);
// add data into it
map2b.put(11, "ADDED WHEN DISCONNECTED TO MAP1");
map2b.close();
}
// now restart map2a and doConnect it to map1, map1 should bootstrap the missing entry
map2aBuilder.file(map2File);
map2 = map2aBuilder.create();
map2 = map2aBuilder.createPersistedTo(map2File);
// add data into it
waitTillEqual(5000);
@@ -96,7 +94,7 @@ public class TCPSocketReplicationBootStrapTests {
final ReplicatedChronicleMap<Integer, ?, ?, CharSequence, ?, ?> map2a =
(ReplicatedChronicleMap<Integer, ?, ?, CharSequence, ?, ?>)
map2aBuilder.file(getPersistenceFile()).create();
map2aBuilder.createPersistedTo(getPersistenceFile());
map2a.put(10, "EXAMPLE-10"); // this will be the last time that map1 go an update from map2
@@ -113,18 +111,16 @@ public class TCPSocketReplicationBootStrapTests {
{
// restart map 2 but don't doConnect it to map one
ChronicleMapBuilder.of(Integer.class, CharSequence.class).file(map2File);
final ChronicleMap<Integer, CharSequence> map2b =
ChronicleMapBuilder.of(Integer.class, CharSequence.class).file(map2File).
create();
ChronicleMapBuilder.of(Integer.class, CharSequence.class)
.createPersistedTo(map2File);
// add data into it
map2b.put(11, "ADDED WHEN DISCONNECTED TO MAP1");
map2b.close();
}
// now restart map2a and doConnect it to map1, map1 should bootstrap the missing entry
map2aBuilder.file(map2File);
map2 = map2aBuilder.create();
map2 = map2aBuilder.createPersistedTo(map2File);
// add data into it
waitTillEqual(20000);