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
@@ -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.createPersistedTo(getPersistenceFile());
map2aBuilder.file(getPersistenceFile()).create();
map2a.put(10, "EXAMPLE-10"); // this will be the last time that map1 go an update from map2
long lastModificationTime;
@@ -69,14 +69,16 @@ 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)
.createPersistedTo(map2File);
.file(map2File)
.create();
// 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
map2 = map2aBuilder.createPersistedTo(map2File);
map2aBuilder.file(map2File);
map2 = map2aBuilder.create();
// add data into it
waitTillEqual(5000);
@@ -94,7 +96,7 @@ public class TCPSocketReplicationBootStrapTests {
final ReplicatedChronicleMap<Integer, ?, ?, CharSequence, ?, ?> map2a =
(ReplicatedChronicleMap<Integer, ?, ?, CharSequence, ?, ?>)
map2aBuilder.createPersistedTo(getPersistenceFile());
map2aBuilder.file(getPersistenceFile()).create();
map2a.put(10, "EXAMPLE-10"); // this will be the last time that map1 go an update from map2
@@ -111,16 +113,18 @@ 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)
.createPersistedTo(map2File);
ChronicleMapBuilder.of(Integer.class, CharSequence.class).file(map2File).
create();
// 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
map2 = map2aBuilder.createPersistedTo(map2File);
map2aBuilder.file(map2File);
map2 = map2aBuilder.create();
// add data into it
waitTillEqual(20000);