HCOLL-143 print a warning on attempt of creation too large ChronicleMap or ChronicleSet on Windows

This commit is contained in:
leventov
2014-12-17 20:18:54 +07:00
parent 7c25596870
commit 0cc07a6a91
3 changed files with 64 additions and 1 deletions
@@ -1172,6 +1172,7 @@ public final class ChronicleMapBuilder<K, V> implements Cloneable,
try {
pushingToMapEventListener();
VanillaChronicleMap<K, ?, ?, V, ?, ?> map = newMap(singleHashReplication, channel);
map.warnOnWindows();
BytesStore bytesStore = new DirectStore(JDKObjectSerializer.INSTANCE,
map.sizeInBytes(), true);
map.createMappedStoreAndSegments(bytesStore);
@@ -1209,7 +1210,8 @@ public final class ChronicleMapBuilder<K, V> implements Cloneable,
}
private VanillaChronicleMap<K, ?, ?, V, ?, ?> newMap(
SingleChronicleHashReplication singleHashReplication, ReplicationChannel channel) throws IOException {
SingleChronicleHashReplication singleHashReplication, ReplicationChannel channel)
throws IOException {
boolean replicated = singleHashReplication != null || channel != null;
preMapConstruction(replicated);
if (replicated) {