From 914f27b588ad108d88703d393eca6018df023e33 Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Thu, 6 Sep 2018 19:10:02 +0100 Subject: [PATCH] added " public boolean tryReserve()" and some public methods to the build --- .../net/openhft/chronicle/map/ChronicleMapBuilder.java | 8 ++++---- .../chronicle/map/impl/stage/data/ZeroBytesStore.java | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java index b2011ccc0..d71fa4148 100755 --- a/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java +++ b/src/main/java/net/openhft/chronicle/map/ChronicleMapBuilder.java @@ -250,7 +250,7 @@ public final class ChronicleMapBuilder implements * entries are not even landing the map, because compute() always returns null. */ private static void fileLockedIO( - File file, FileChannel fileChannel, FileIOAction fileIOAction) throws IOException { + File file, FileChannel fileChannel, FileIOAction fileIOAction) { fileLockingControl.compute(file, (k, v) -> { try { try (FileLock ignored = fileChannel.lock()) { @@ -805,7 +805,7 @@ public final class ChronicleMapBuilder implements return valueBuilder.constantSize(); } - boolean constantlySizedKeys() { + public boolean constantlySizedKeys() { return keyBuilder.constantSizeMarshaller() || sampleKey != null; } @@ -891,7 +891,7 @@ public final class ChronicleMapBuilder implements return result; } - boolean constantlySizedValues() { + public boolean constantlySizedValues() { return valueBuilder.constantSizeMarshaller() || sampleValue != null; } @@ -1881,7 +1881,7 @@ public final class ChronicleMapBuilder implements } private void establishReplication( - VanillaChronicleMap map) throws IOException { + VanillaChronicleMap map) { if (map instanceof ReplicatedChronicleMap) { ReplicatedChronicleMap result = (ReplicatedChronicleMap) map; if (cleanupRemovedEntries) diff --git a/src/main/java/net/openhft/chronicle/map/impl/stage/data/ZeroBytesStore.java b/src/main/java/net/openhft/chronicle/map/impl/stage/data/ZeroBytesStore.java index f0f4ec140..66e48eeb9 100644 --- a/src/main/java/net/openhft/chronicle/map/impl/stage/data/ZeroBytesStore.java +++ b/src/main/java/net/openhft/chronicle/map/impl/stage/data/ZeroBytesStore.java @@ -157,6 +157,11 @@ public enum ZeroBytesStore implements BytesStore { return 0; } + @Override + public boolean tryReserve() { + throw new UnsupportedOperationException("todo"); + } + @Override public ZeroBytesStore writeByte(long l, byte b) { throw new UnsupportedOperationException();