Local updates couldn't be late

This commit is contained in:
leventov
2015-02-19 19:42:25 +07:00
parent 053284750d
commit 0a2726ac4a
5 changed files with 139 additions and 538 deletions
@@ -27,6 +27,7 @@ import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.InetSocketAddress;
import java.util.Arrays;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
@@ -60,6 +61,18 @@ public class Builder {
return file;
}
public static void waitTillEqual(Map map1, Map map2, int timeOut) {
for (int t = 0; t < timeOut; t++) {
if (map1.equals(map2))
break;
try {
Thread.sleep(1);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}
public static <T extends ChronicleMap<Integer, DummyValue>> T newMapDummyValue(
final byte identifier,
final int serverPort,