mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Local updates couldn't be late
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user