I have a ChronicleMap
(v2.3.2) running in a server, created using the following call:
ChronicleMapBuilder.of(MyKey.class, MyValue.class).entries(20_000_000).createPersistedTo(pathToData);
There is a possibility that the number of entries stored in the ChronicleMap
will need to evolve. Therefore, I envisage doing the following at application startup:
- load the existing
ChronicleMap
from disk - get maximum number of entries from the existing
ChronicleMap
- if the new size (loaded from a configuration file) isn't different then finish, else...
- create a new
ChronicleMap
with the new size - copy the contents of the old
ChronicleMap
to the new one - close and delete the old
ChronicleMap
However, I can't see anything in the interface exposed by ChronicleMap which will let me find out the value passed into the entries
method when it was created. I assume that longSize()
is just the number of entries actually stored, rather than the map's maximum size.
Is there a way to find out this value? Or perhaps there's a better way to do this kind of migration?