Hi,
I'm running chronicle map server and client on different machines. While the server is running on a unix machine, the client is running on a windows machine. Replication is enabled on both. Server persists the map in a file, but the client does not. The idea is to see how quickly the client can get the map in memory when it's started from scratch while the server is already running and has populated the map. I'm printing the map size in a loop on the client side to track map build up on the client. With below code, it takes about 30 sec for the client to get all 5M keys from the server when I start the client first time. The problem is if I stop and restart the client, the replication seems to stop after some time (the exact point when this happens varies but it is usually closer to the end of the map, after about 4.9M keys). The map size printed from the client loop does not change after that point. If I then restart the server and then restart client, all keys are replicated on client. But if I again restart the client, without restarting the server, it gets stuck again after about 4.9M keys. How can I ensure that the client gets the entire map whenever it's restarted (without restarting the server)?
SERVER:
long totalKeyCount = 5000000L;
File file = new File(file1);
TcpTransportAndNetworkConfig tcpConfig =
TcpTransportAndNetworkConfig.of(port1, new InetSocketAddress(node2, port2))
.heartBeatInterval(1L, TimeUnit.SECONDS)
.tcpBufferSize(1000000);
final ChronicleMap<String, String> serverMap =
ChronicleMapBuilder.of(String.class, String.class)
.putReturnsNull(true)
.entries(totalKeyCount)
.replication((byte) 1, tcpConfig)
.createPersistedTo(file);
CLIENT:
TcpTransportAndNetworkConfig tcpConfig =
TcpTransportAndNetworkConfig.of(port2, new InetSocketAddress(node1, port1))
.heartBeatInterval(1L, TimeUnit.SECONDS)
.tcpBufferSize(1000000);
final ChronicleMap<String, String> map =
ChronicleMapBuilder
.of(String.class, String.class)
.putReturnsNull(true)
.entries(totalKeyCount)
.replication((byte) 2, tcpConfig)
.create();
Printing map size from client:
while (map.size()<totalKeyCount) {
System.out.println(map.size() + " keys");
Thread.sleep(2000);
}
Thanks.
Arun
--
You received this message because you are subscribed to the Google Groups "Chronicle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-chronicl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<dependency>
<groupId>net.openhft</groupId>
<artifactId>chronicle-map</artifactId>
<version>2.1.7</version>
</dependency>
--