From a1954f220d65f16d5755ded6d01e4cdfa01a147d Mon Sep 17 00:00:00 2001 From: leventov Date: Thu, 17 Dec 2015 20:01:24 +0300 Subject: [PATCH] Remove EntryExternalizable.sizeOfEntry() --- .../chronicle/map/ChannelProvider.java | 15 --------- .../net/openhft/chronicle/map/Replica.java | 16 --------- .../chronicle/map/ReplicatedChronicleMap.java | 33 ------------------- 3 files changed, 64 deletions(-) diff --git a/src/main/java/net/openhft/chronicle/map/ChannelProvider.java b/src/main/java/net/openhft/chronicle/map/ChannelProvider.java index 25eabf847..257cd7670 100644 --- a/src/main/java/net/openhft/chronicle/map/ChannelProvider.java +++ b/src/main/java/net/openhft/chronicle/map/ChannelProvider.java @@ -88,17 +88,6 @@ final class ChannelProvider implements Closeable { private static final byte BOOTSTRAP_MESSAGE = 'B'; final EntryExternalizable asEntryExternalizable = new EntryExternalizable() { - @Override - public int sizeOfEntry(@NotNull Bytes entry, int chronicleChannel) { - channelDataReadLock(); - try { - - return channelEntryExternalizables[chronicleChannel] - .sizeOfEntry(entry, chronicleChannel); - } finally { - channelDataLock.readLock().unlock(); - } - } @Override public boolean identifierCheck(@NotNull ReplicableEntry entry, int chronicleChannel) { @@ -549,10 +538,6 @@ final class ChannelProvider implements Closeable { } }; final EntryExternalizable asEntryExternalizable = new EntryExternalizable() { - @Override - public int sizeOfEntry(@NotNull Bytes entry, int chronicleId) { - return (int) entry.readRemaining(); - } @Override public boolean identifierCheck(@NotNull ReplicableEntry entry, int chronicleId) { diff --git a/src/main/java/net/openhft/chronicle/map/Replica.java b/src/main/java/net/openhft/chronicle/map/Replica.java index 1a8b0ccd9..9af1fe3c5 100644 --- a/src/main/java/net/openhft/chronicle/map/Replica.java +++ b/src/main/java/net/openhft/chronicle/map/Replica.java @@ -127,16 +127,6 @@ public interface Replica extends Closeable { */ interface EntryExternalizable { - /** - * The size of entry in bytes - * - * @param entry an entry in the map - * @param chronicleId is the channel id used to identify the canonical map or queue - * @return the size of the entry - */ - int sizeOfEntry(@NotNull Bytes entry, int chronicleId); - - /** * check that the identifier in the entry is from this node * @@ -146,7 +136,6 @@ public interface Replica extends Closeable { */ boolean identifierCheck(@NotNull ReplicableEntry entry, int chronicleId); - /** * The map implements this method to save its contents. * @@ -168,8 +157,6 @@ public interface Replica extends Closeable { * @param source bytes to read an entry from */ void readExternalEntry(@NotNull Bytes source); - - } /** @@ -205,7 +192,6 @@ public interface Replica extends Closeable { public void onBeforeEntry() { } - /** * its possible that the entry should now be ignored, for example although rare its * identifier may have recently been changed by another thread, so its no longer applicable @@ -218,7 +204,5 @@ public interface Replica extends Closeable { */ public abstract boolean shouldBeIgnored(final ReplicableEntry entry, final int chronicleId); } - - } diff --git a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java index 4cd0e3531..bda0e3fa4 100644 --- a/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java +++ b/src/main/java/net/openhft/chronicle/map/ReplicatedChronicleMap.java @@ -362,39 +362,6 @@ public class ReplicatedChronicleMap extends VanillaChronicleMap