removed preferObject, eager deserialize, and KeyWithRegionContext
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/a6be9497 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/a6be9497 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/a6be9497 Branch: refs/heads/feature/GEODE-1464 Commit: a6be9497caa0db2b809de801d288a8c095cef3b7 Parents: fb3a2c5 Author: Darrel Schneider <[email protected]> Authored: Wed Jun 1 14:50:37 2016 -0700 Committer: Darrel Schneider <[email protected]> Committed: Wed Jun 1 14:50:37 2016 -0700 ---------------------------------------------------------------------- .../internal/cache/AbstractRegionEntry.java | 18 +---- .../cache/CachedDeserializableFactory.java | 7 -- .../internal/cache/DestroyOperation.java | 3 - .../gemfire/internal/cache/DiskEntry.java | 31 +-------- .../cache/DistributedCacheOperation.java | 26 +------- .../cache/DistributedPutAllOperation.java | 24 ++----- .../cache/DistributedRemoveAllOperation.java | 24 ++----- .../gemfire/internal/cache/EntryBits.java | 22 ------ .../gemfire/internal/cache/EntryEventImpl.java | 11 +-- .../internal/cache/InitialImageOperation.java | 67 +------------------ .../internal/cache/InternalRegionArguments.java | 10 --- .../internal/cache/InvalidateOperation.java | 3 - .../internal/cache/KeyWithRegionContext.java | 70 -------------------- .../gemfire/internal/cache/LocalRegion.java | 23 ------- .../gemstone/gemfire/internal/cache/Oplog.java | 22 ++---- .../gemfire/internal/cache/QueuedOperation.java | 16 +---- .../cache/RemoteContainsKeyValueMessage.java | 3 - .../internal/cache/RemoteDestroyMessage.java | 11 +-- .../internal/cache/RemoteFetchEntryMessage.java | 3 - .../cache/RemoteFetchVersionMessage.java | 3 - .../internal/cache/RemoteGetMessage.java | 3 - .../internal/cache/RemoteInvalidateMessage.java | 3 - .../internal/cache/RemotePutAllMessage.java | 6 +- .../internal/cache/RemotePutMessage.java | 32 ++------- .../internal/cache/RemoteRemoveAllMessage.java | 6 +- .../cache/SearchLoadAndWriteProcessor.java | 3 - .../internal/cache/TXRegionLockRequestImpl.java | 14 +--- .../cache/UpdateEntryVersionOperation.java | 5 -- .../gemfire/internal/cache/UpdateOperation.java | 36 ++-------- .../execute/RegionFunctionContextImpl.java | 13 ---- .../partitioned/ContainsKeyValueMessage.java | 4 -- .../cache/partitioned/DestroyMessage.java | 4 -- .../partitioned/FetchBulkEntriesMessage.java | 6 -- .../cache/partitioned/FetchEntriesMessage.java | 6 -- .../cache/partitioned/FetchEntryMessage.java | 4 -- .../cache/partitioned/FetchKeysMessage.java | 6 -- .../internal/cache/partitioned/GetMessage.java | 4 -- .../cache/partitioned/InvalidateMessage.java | 4 -- .../PRUpdateEntryVersionMessage.java | 5 -- .../cache/partitioned/PutAllPRMessage.java | 11 +-- .../internal/cache/partitioned/PutMessage.java | 26 +------- .../partitioned/RemoteFetchKeysMessage.java | 6 -- .../cache/partitioned/RemoveAllPRMessage.java | 11 +-- .../sockets/command/GatewayReceiverCommand.java | 13 ---- .../internal/cache/tx/DistTxEntryEvent.java | 14 +--- .../cache/wan/GatewaySenderEventImpl.java | 7 -- .../FetchEntriesMessageJUnitTest.java | 1 - 47 files changed, 53 insertions(+), 597 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java index c2b81de..937a8d3 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java @@ -308,10 +308,6 @@ public abstract class AbstractRegionEntry implements RegionEntry, } } - final boolean isEagerDeserialize = dst.isEagerDeserialize(); - if (isEagerDeserialize) { - dst.clearEagerDeserialize(); - } dst.setLastModified(mgr, getLastModified()); // fix for bug 31059 if (v == Token.INVALID) { dst.setInvalid(); @@ -324,17 +320,11 @@ public abstract class AbstractRegionEntry implements RegionEntry, } else if (v instanceof CachedDeserializable) { // don't serialize here if it is not already serialized -// if(v instanceof ByteSource && CachedDeserializableFactory.preferObject()) { -// // For SQLFire we prefer eager deserialized -// dst.setEagerDeserialize(); -// } CachedDeserializable cd = (CachedDeserializable) v; if (!cd.isSerialized()) { dst.value = cd.getDeserializedForReading(); } else { - /*if (v instanceof ByteSource && CachedDeserializableFactory.preferObject()) { - dst.value = v; - } else */ { + { Object tmp = cd.getValue(); if (tmp instanceof byte[]) { byte[] bb = (byte[]) tmp; @@ -369,11 +359,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, return false; } } - if (CachedDeserializableFactory.preferObject()) { - dst.value = preparedValue; - dst.setEagerDeserialize(); - } - else { + { try { HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); BlobHelper.serializeTo(preparedValue, hdos); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CachedDeserializableFactory.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CachedDeserializableFactory.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CachedDeserializableFactory.java index 84e44d8..5d03389 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CachedDeserializableFactory.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/CachedDeserializableFactory.java @@ -38,13 +38,6 @@ public class CachedDeserializableFactory { public static boolean STORE_ALL_VALUE_FORMS = Boolean.getBoolean("gemfire.STORE_ALL_VALUE_FORMS"); /** - * Currently GFE always wants a CachedDeserializable wrapper. - */ - public static final boolean preferObject() { - return false; - } - - /** * Creates and returns an instance of CachedDeserializable that contains the * specified byte array. */ http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DestroyOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DestroyOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DestroyOperation.java index e267190..5bfb3cc 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DestroyOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DestroyOperation.java @@ -129,9 +129,6 @@ public class DestroyOperation extends DistributedCacheOperation @Retained protected final InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { - if (rgn.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(rgn); - } EntryEventImpl ev = createEntryEvent(rgn); boolean evReturned = false; try { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java index 9ab2a15..e356f3e 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java @@ -365,10 +365,6 @@ public interface DiskEntry extends RegionEntry { dr.releaseReadLock(); } } - final boolean isEagerDeserialize = entry.isEagerDeserialize(); - if (isEagerDeserialize) { - entry.clearEagerDeserialize(); - } if (Token.isRemovedFromDisk(v)) { // fix for bug 31757 return false; @@ -379,30 +375,15 @@ public interface DiskEntry extends RegionEntry { entry.setSerialized(false); entry.value = cd.getDeserializedForReading(); - //For SQLFire we prefer eager deserialized -// if(v instanceof ByteSource) { -// entry.setEagerDeserialize(); -// } } else { // don't serialize here if it is not already serialized Object tmp = cd.getValue(); - //For SQLFire we prefer eager deserialized -// if(v instanceof ByteSource) { -// entry.setEagerDeserialize(); -// } if (tmp instanceof byte[]) { byte[] bb = (byte[])tmp; entry.value = bb; entry.setSerialized(true); } - else if (isEagerDeserialize && tmp instanceof byte[][]) { - // optimize for byte[][] since it will need to be eagerly deserialized - // for SQLFabric - entry.value = tmp; - entry.setEagerDeserialize(); - entry.setSerialized(true); - } else { try { HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); @@ -430,12 +411,6 @@ public interface DiskEntry extends RegionEntry { entry.value = v; entry.setSerialized(false); } - else if (isEagerDeserialize && v instanceof byte[][]) { - // optimize for byte[][] since it will need to be eagerly deserialized - // for SQLFabric - entry.value = v; - entry.setEagerDeserialize(); - } else if (v == Token.INVALID) { entry.setInvalid(); } @@ -453,11 +428,7 @@ public interface DiskEntry extends RegionEntry { return false; } } - if (CachedDeserializableFactory.preferObject()) { - entry.value = preparedValue; - entry.setEagerDeserialize(); - } - else { + { try { HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); BlobHelper.serializeTo(preparedValue, hdos); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedCacheOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedCacheOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedCacheOperation.java index 6a7b4f2..77e8876 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedCacheOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedCacheOperation.java @@ -101,13 +101,6 @@ public abstract class DistributedCacheOperation { public static final byte DESERIALIZATION_POLICY_NONE = (byte)0; /** - * Deserialization policy: deserialize eagerly (for Deltas) - * - * @since 5.7 - */ - public static final byte DESERIALIZATION_POLICY_EAGER = (byte)1; - - /** * Deserialization policy: deserialize lazily (for all other objects) * * @since 5.7 @@ -115,14 +108,11 @@ public abstract class DistributedCacheOperation { public static final byte DESERIALIZATION_POLICY_LAZY = (byte)2; /** - * @param deserializationPolicy must be one of the following: DESERIALIZATION_POLICY_NONE, DESERIALIZATION_POLICY_EAGER, DESERIALIZATION_POLICY_LAZY. + * @param deserializationPolicy must be one of the following: DESERIALIZATION_POLICY_NONE, DESERIALIZATION_POLICY_LAZY. */ public static void writeValue(final byte deserializationPolicy, final Object vObj, final byte[] vBytes, final DataOutput out) throws IOException { if (vObj != null) { - if (deserializationPolicy == DESERIALIZATION_POLICY_EAGER) { - // for DESERIALIZATION_POLICY_EAGER avoid extra byte array serialization - DataSerializer.writeObject(vObj, out); - } else if (deserializationPolicy == DESERIALIZATION_POLICY_NONE) { + if (deserializationPolicy == DESERIALIZATION_POLICY_NONE) { // We only have NONE with a vObj when vObj is off-heap and not serialized. StoredObject so = (StoredObject) vObj; assert !so.isSerialized(); @@ -131,14 +121,7 @@ public abstract class DistributedCacheOperation { DataSerializer.writeObjectAsByteArray(vObj, out); } } else { - if (deserializationPolicy == DESERIALIZATION_POLICY_EAGER) { - // object is already in serialized form in the byte array. - // So just write the bytes to the stream. - // fromData will call readObject which will deserialize to object form. - out.write(vBytes); - } else { - DataSerializer.writeByteArray(vBytes, out); - } + DataSerializer.writeByteArray(vBytes, out); } } // static values for oldValueIsObject @@ -151,7 +134,6 @@ public abstract class DistributedCacheOperation { */ public static byte valueIsToDeserializationPolicy(boolean oldValueIsSerialized) { if (!oldValueIsSerialized) return DESERIALIZATION_POLICY_NONE; - if (CachedDeserializableFactory.preferObject()) return DESERIALIZATION_POLICY_EAGER; return DESERIALIZATION_POLICY_LAZY; } @@ -180,8 +162,6 @@ public abstract class DistributedCacheOperation { switch (policy) { case DESERIALIZATION_POLICY_NONE: return "NONE"; - case DESERIALIZATION_POLICY_EAGER: - return "EAGER"; case DESERIALIZATION_POLICY_LAZY: return "LAZY"; default: http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedPutAllOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedPutAllOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedPutAllOperation.java index 5cde50c..971dc3d 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedPutAllOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedPutAllOperation.java @@ -415,8 +415,7 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation * {@link PutAllPRMessage#toData(DataOutput)} <br> * {@link RemotePutAllMessage#toData(DataOutput)} <br> */ - public final void toData(final DataOutput out, - final boolean requiresRegionContext) throws IOException { + public final void toData(final DataOutput out) throws IOException { Object key = this.key; final Object v = this.value; DataSerializer.writeObject(key, out); @@ -1131,11 +1130,9 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation * @param rgn * the region the entry is put in */ - public void doEntryPut(PutAllEntryData entry, DistributedRegion rgn, - boolean requiresRegionContext, boolean isPutDML) { + public void doEntryPut(PutAllEntryData entry, DistributedRegion rgn, boolean isPutDML) { @Released EntryEventImpl ev = PutAllMessage.createEntryEvent(entry, getSender(), - this.context, rgn, - requiresRegionContext, this.possibleDuplicate, + this.context, rgn, this.possibleDuplicate, this.needsRouting, this.callbackArg, true, skipCallbacks); ev.setPutDML(isPutDML); // we don't need to set old value here, because the msg is from remote. local old value will get from next step @@ -1157,7 +1154,6 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation * @param sender * @param context * @param rgn - * @param requiresRegionContext * @param possibleDuplicate * @param needsRouting * @param callbackArg @@ -1166,13 +1162,10 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation @Retained public static EntryEventImpl createEntryEvent(PutAllEntryData entry, InternalDistributedMember sender, ClientProxyMembershipID context, - DistributedRegion rgn, boolean requiresRegionContext, + DistributedRegion rgn, boolean possibleDuplicate, boolean needsRouting, Object callbackArg, boolean originRemote, boolean skipCallbacks) { final Object key = entry.getKey(); - if (requiresRegionContext) { - ((KeyWithRegionContext)key).setRegionContext(rgn); - } EventID evId = entry.getEventID(); @Retained EntryEventImpl ev = EntryEventImpl.create(rgn, entry.getOp(), key, null/* value */, callbackArg, @@ -1224,14 +1217,13 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation rgn.syncBulkOp(new Runnable() { public void run() { - final boolean requiresRegionContext = rgn.keyRequiresRegionContext(); final boolean isDebugEnabled = logger.isDebugEnabled(); for (int i = 0; i < putAllDataSize; ++i) { if (isDebugEnabled) { logger.debug("putAll processing {} with {} sender={}", putAllData[i], putAllData[i].versionTag, sender); } putAllData[i].setSender(sender); - doEntryPut(putAllData[i], rgn, requiresRegionContext, isPutDML); + doEntryPut(putAllData[i], rgn, isPutDML); } } }, ev.getEventId()); @@ -1282,10 +1274,6 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation EntryVersionsList versionTags = new EntryVersionsList(putAllDataSize); boolean hasTags = false; - // get the "keyRequiresRegionContext" flag from first element assuming - // all key objects to be uniform - final boolean requiresRegionContext = - (this.putAllData[0].key instanceof KeyWithRegionContext); for (int i = 0; i < this.putAllDataSize; i++) { if (!hasTags && putAllData[i].versionTag != null) { hasTags = true; @@ -1293,7 +1281,7 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation VersionTag<?> tag = putAllData[i].versionTag; versionTags.add(tag); putAllData[i].versionTag = null; - this.putAllData[i].toData(out, requiresRegionContext); + this.putAllData[i].toData(out); this.putAllData[i].versionTag = tag; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRemoveAllOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRemoveAllOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRemoveAllOperation.java index 1d216ce..5b18b44 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRemoveAllOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistributedRemoveAllOperation.java @@ -380,8 +380,7 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO * {@link PutAllPRMessage#toData(DataOutput)} <br> * {@link RemotePutAllMessage#toData(DataOutput)} <br> */ - public final void toData(final DataOutput out, - final boolean requiresRegionContext) throws IOException { + public final void toData(final DataOutput out) throws IOException { Object key = this.key; DataSerializer.writeObject(key, out); @@ -886,11 +885,9 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO * @param rgn * the region the entry is removed from */ - public void doEntryRemove(RemoveAllEntryData entry, DistributedRegion rgn, - boolean requiresRegionContext) { + public void doEntryRemove(RemoveAllEntryData entry, DistributedRegion rgn) { @Released EntryEventImpl ev = RemoveAllMessage.createEntryEvent(entry, getSender(), - this.context, rgn, - requiresRegionContext, this.possibleDuplicate, + this.context, rgn, this.possibleDuplicate, this.needsRouting, this.callbackArg, true, skipCallbacks); // rgn.getLogWriterI18n().info(LocalizedStrings.DEBUG, "RemoveAllMessage.doEntryRemove sender=" + getSender() + // " event="+ev); @@ -922,7 +919,6 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO * @param sender * @param context * @param rgn - * @param requiresRegionContext * @param possibleDuplicate * @param needsRouting * @param callbackArg @@ -931,13 +927,10 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO @Retained public static EntryEventImpl createEntryEvent(RemoveAllEntryData entry, InternalDistributedMember sender, ClientProxyMembershipID context, - DistributedRegion rgn, boolean requiresRegionContext, + DistributedRegion rgn, boolean possibleDuplicate, boolean needsRouting, Object callbackArg, boolean originRemote, boolean skipCallbacks) { final Object key = entry.getKey(); - if (requiresRegionContext) { - ((KeyWithRegionContext)key).setRegionContext(rgn); - } EventID evId = entry.getEventID(); @Retained EntryEventImpl ev = EntryEventImpl.create(rgn, entry.getOp(), key, null/* value */, callbackArg, @@ -985,13 +978,12 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO rgn.syncBulkOp(new Runnable() { public void run() { - final boolean requiresRegionContext = rgn.keyRequiresRegionContext(); for (int i = 0; i < removeAllDataSize; ++i) { if (logger.isTraceEnabled()) { logger.trace("removeAll processing {} with {}", removeAllData[i], removeAllData[i].versionTag); } removeAllData[i].setSender(sender); - doEntryRemove(removeAllData[i], rgn, requiresRegionContext); + doEntryRemove(removeAllData[i], rgn); } } }, ev.getEventId()); @@ -1043,10 +1035,6 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO EntryVersionsList versionTags = new EntryVersionsList(removeAllDataSize); boolean hasTags = false; - // get the "keyRequiresRegionContext" flag from first element assuming - // all key objects to be uniform - final boolean requiresRegionContext = - (this.removeAllData[0].key instanceof KeyWithRegionContext); for (int i = 0; i < this.removeAllDataSize; i++) { if (!hasTags && removeAllData[i].versionTag != null) { hasTags = true; @@ -1054,7 +1042,7 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO VersionTag<?> tag = removeAllData[i].versionTag; versionTags.add(tag); removeAllData[i].versionTag = null; - this.removeAllData[i].toData(out, requiresRegionContext); + this.removeAllData[i].toData(out); this.removeAllData[i].versionTag = tag; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryBits.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryBits.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryBits.java index f95af60..a67a335 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryBits.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryBits.java @@ -30,16 +30,6 @@ public abstract class EntryBits { private static final byte TOMBSTONE = 0x40; private static final byte WITH_VERSIONS = (byte)0x80; // oplog entry contains versions - /** - * Currently for SQLFabric to deserialize byte[][] eagerly in - * InitialImageOperation. Can be made a general flag later for all kinds of - * objects in CachedDeserializable whose serialization is not expensive but - * that are pretty heavy so creating an intermediate byte[] is expensive. - * - * This is a transient bit that clashes with on-disk persisted bits. - */ - private static final byte EAGER_DESERIALIZE = 0x20; - public static boolean isSerialized(byte b) { return (b & SERIALIZED) != 0; } @@ -79,10 +69,6 @@ public abstract class EntryBits { return (b & (INVALID|LOCAL_INVALID|TOMBSTONE)) == 0; } - public static boolean isEagerDeserialize(byte b) { - return (b & EntryBits.EAGER_DESERIALIZE) != 0; - } - public static byte setSerialized(byte b, boolean isSerialized) { return isSerialized ? (byte)(b | SERIALIZED) : (byte)(b & ~SERIALIZED); } @@ -116,12 +102,4 @@ public abstract class EntryBits { public static byte getPersistentBits(byte b) { return (byte)(b & (SERIALIZED|INVALID|LOCAL_INVALID|TOMBSTONE|WITH_VERSIONS)); } - - public static byte setEagerDeserialize(byte b) { - return (byte)(b | EntryBits.EAGER_DESERIALIZE); - } - - public static byte clearEagerDeserialize(byte b) { - return (byte)(b & ~EntryBits.EAGER_DESERIALIZE); - } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryEventImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryEventImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryEventImpl.java index a1e26ee..a694815 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryEventImpl.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/EntryEventImpl.java @@ -1458,11 +1458,7 @@ public class EntryEventImpl public final void setSerializedNewValue(byte[] serializedValue) { Object newVal = null; if (serializedValue != null) { - if (CachedDeserializableFactory.preferObject()) { - newVal = deserialize(serializedValue); - } else { - newVal = CachedDeserializableFactory.create(serializedValue); - } + newVal = CachedDeserializableFactory.create(serializedValue); } this.newValueBytes = serializedValue; basicSetNewValue(newVal); @@ -1472,10 +1468,7 @@ public class EntryEventImpl public void setSerializedOldValue(byte[] serializedOldValue){ this.oldValueBytes = serializedOldValue; final Object ov; - if (CachedDeserializableFactory.preferObject()) { - ov = deserialize(serializedOldValue); - } - else if (serializedOldValue != null) { + if (serializedOldValue != null) { ov = CachedDeserializableFactory.create(serializedOldValue); } else { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java index b15c685..1214f87 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java @@ -806,8 +806,6 @@ public class InitialImageOperation { if (entryCount <= 1000 && isDebugEnabled) { keys = new HashSet(); } - final boolean keyRequiresRegionContext = this.region - .keyRequiresRegionContext(); final ByteArrayDataInput in = new ByteArrayDataInput(); for (int i = 0; i < entryCount; i++) { // stream is null-terminated @@ -856,33 +854,7 @@ public class InitialImageOperation { Object tmpValue = entry.value; byte[] tmpBytes = null; - if (keyRequiresRegionContext) { - final KeyWithRegionContext key = (KeyWithRegionContext)entry.key; - Object keyObject = tmpValue; - if (tmpValue != null) { - if (entry.isEagerDeserialize()) { - tmpValue = CachedDeserializableFactory.create(tmpValue, - CachedDeserializableFactory.getArrayOfBytesSize( - (byte[][])tmpValue, true)); - entry.setSerialized(false); - } - else if (entry.isSerialized()) { - tmpBytes = (byte[])tmpValue; - // force deserialization for passing to key - keyObject = EntryEventImpl.deserialize(tmpBytes, - remoteVersion, in); - tmpValue = CachedDeserializableFactory.create(keyObject, - CachedDeserializableFactory.getByteSize(tmpBytes)); - entry.setSerialized(false); - } - else { - tmpBytes = (byte[])tmpValue; - } - } - key.setRegionContext(this.region); - entry.key = key.afterDeserializationWithValue(keyObject); - } - else { + { if (tmpValue instanceof byte[]) { tmpBytes = (byte[])tmpValue; } @@ -1878,7 +1850,6 @@ public class InitialImageOperation { List chunkEntries = null; chunkEntries = new InitialImageVersionedEntryList(rgn.concurrencyChecksEnabled, MAX_ENTRIES_PER_CHUNK); - final boolean keyRequiresRegionContext = rgn.keyRequiresRegionContext(); DiskRegion dr = rgn.getDiskRegion(); if( dr!=null ){ dr.setClearCountReference(); @@ -1940,9 +1911,6 @@ public class InitialImageOperation { entry = new InitialImageOperation.Entry(); entry.key = key; entry.setVersionTag(stamp.asVersionTag()); - if (keyRequiresRegionContext) { - entry.setEagerDeserialize(); - } fillRes = mapEntry.fillInValue(rgn, entry, in, rgn.getDistributionManager()); if (versionVector != null) { if (logger.isTraceEnabled(LogMarker.GII)) { @@ -1953,9 +1921,6 @@ public class InitialImageOperation { } else { entry = new InitialImageOperation.Entry(); entry.key = key; - if (keyRequiresRegionContext) { - entry.setEagerDeserialize(); - } fillRes = mapEntry.fillInValue(rgn, entry, in, rgn.getDistributionManager()); } } @@ -1975,11 +1940,6 @@ public class InitialImageOperation { entry.setLastModified(rgn.getDistributionManager(), mapEntry .getLastModified()); } - if (keyRequiresRegionContext) { - entry.key = ((KeyWithRegionContext)key) - .beforeSerializationWithValue(entry.isInvalid() - || entry.isLocalInvalid()); - } chunkEntries.add(entry); currentChunkSize += entry.calcSerializedSize(); @@ -2966,18 +2926,6 @@ public class InitialImageOperation { this.entryBits = EntryBits.setSerialized(this.entryBits, isSerialized); } - public boolean isEagerDeserialize() { - return EntryBits.isEagerDeserialize(this.entryBits); - } - - void setEagerDeserialize() { - this.entryBits = EntryBits.setEagerDeserialize(this.entryBits); - } - - void clearEagerDeserialize() { - this.entryBits = EntryBits.clearEagerDeserialize(this.entryBits); - } - public boolean isInvalid() { return (this.value == null) && !EntryBits.isLocalInvalid(this.entryBits); } @@ -3019,12 +2967,7 @@ public class InitialImageOperation { out.writeByte(flags); DataSerializer.writeObject(this.key, out); if (!EntryBits.isTombstone(this.entryBits)) { - if (!isEagerDeserialize()) { - DataSerializer.writeObjectAsByteArray(this.value, out); - } - else { - DataSerializer.writeArrayOfByteArrays((byte[][])this.value, out); - } + DataSerializer.writeObjectAsByteArray(this.value, out); } out.writeLong(this.lastModified); if (this.versionTag != null) { @@ -3044,11 +2987,7 @@ public class InitialImageOperation { if (EntryBits.isTombstone(this.entryBits)) { this.value = Token.TOMBSTONE; } else { - if (!isEagerDeserialize()) { - this.value = DataSerializer.readByteArray(in); - } else { - this.value = DataSerializer.readArrayOfByteArrays(in); - } + this.value = DataSerializer.readByteArray(in); } this.lastModified = in.readLong(); if ((flags & HAS_VERSION) != 0) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java index 419b948..db9dab6 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java @@ -54,7 +54,6 @@ public final class InternalRegionArguments private DiskRegion diskRegion; private PartitionedRegion partitionedRegion; private TestCallable testCallable; - private boolean keyRequiresRegionContext; private AbstractGatewaySender parallelGatewaySender; private AbstractGatewaySender serialGatewaySender; @@ -227,15 +226,6 @@ public final class InternalRegionArguments return this.testCallable; } - public boolean keyRequiresRegionContext() { - return this.keyRequiresRegionContext; - } - - public InternalRegionArguments setKeyRequiresRegionContext(boolean v) { - this.keyRequiresRegionContext = v; - return this; - } - public InternalRegionArguments setUserAttribute(Object userAttr) { this.userAttribute = userAttr; return this; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java index 6e1d91e..1742ad3 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java @@ -112,9 +112,6 @@ public class InvalidateOperation extends DistributedCacheOperation @Retained protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { - if (rgn.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(rgn); - } @Retained EntryEventImpl ev = EntryEventImpl.create( rgn, getOperation(), this.key, null, this.callbackArg, true, getSender()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyWithRegionContext.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyWithRegionContext.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyWithRegionContext.java deleted file mode 100644 index b28a551..0000000 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyWithRegionContext.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.gemstone.gemfire.internal.cache; - -import com.gemstone.gemfire.internal.DataSerializableFixedID; - -/** - * Interface that can be implemented by region keys to allow passing the region - * after deserialization for any region specific initialization. Note that the - * {@link LocalRegion#setKeyRequiresRegionContext(boolean)} should also be set - * for {@link #setRegionContext(LocalRegion)} to be invoked by the GemFire - * layer. It is required that either all keys of the region implement this - * interface (and the flag - * {@link LocalRegion#setKeyRequiresRegionContext(boolean)} is set) or none do. - * - * Currently used by SQLFabric for the optimized - * <code>CompactCompositeRegionKey</code> key implementations that keeps the key - * as a reference to the raw row bytes and requires a handle of the table schema - * to interpret those in hashCode/equals/compareTo methods that have no region - * context information. - * - */ -public interface KeyWithRegionContext extends DataSerializableFixedID { - - /** - * Pass the region of the key for setting up of any region specific context - * for the key. In case of recovery from disk the region may not have been - * fully initialized yet, so the implementation needs to take that into - * consideration. - * - * @param region - * the region of this key - */ - public void setRegionContext(LocalRegion region); - - /** - * Changes required to be done to the key, if any, to optimize serialization - * for sending across when value is also available. - * - * SQLFabric will make the value bytes as null in the key so as to avoid - * serializing the row twice. - */ - public KeyWithRegionContext beforeSerializationWithValue(boolean valueIsToken); - - /** - * Changes required to be done to the key, if any, to after deserializing the - * key in reply with value available. The value is required to be provided in - * deserialized format (e.g. for {@link CachedDeserializable}s the - * deserialized value being wrapped must be passed). - * - * SQLFabric will restore the value bytes that were set as null in - * {@link #beforeSerializationWithValue}. - */ - public KeyWithRegionContext afterDeserializationWithValue(Object val); -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java index eca0f0a..7357f0c 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/LocalRegion.java @@ -535,26 +535,6 @@ public class LocalRegion extends AbstractRegion return initializingRegion.get(); } - /** - * Return true if the keys of this region implement - * {@link KeyWithRegionContext} that require region specific context - * initialization after deserialization or recovery from disk. - * - * Currently used by SQLFabric for the optimized - * <code>CompactCompositeRegionKey</code> that points to the raw row bytes and - * so requires a handle to table schema for interpretation of those bytes. - */ - public boolean keyRequiresRegionContext() { - return this.keyRequiresRegionContext; - } - - /** - * Set the {@link #keyRequiresRegionContext} flag to given value. - */ - public final void setKeyRequiresRegionContext(boolean v) { - this.keyRequiresRegionContext = v; - } - public CancelCriterion getCancelCriterion() { return this.stopper; } @@ -611,7 +591,6 @@ public class LocalRegion extends AbstractRegion if (internalRegionArgs.getUserAttribute() != null) { setUserAttribute(internalRegionArgs.getUserAttribute()); } - setKeyRequiresRegionContext(internalRegionArgs.keyRequiresRegionContext()); initializingRegion.set(this); if (internalRegionArgs.getCachePerfStatsHolder() != null) { @@ -953,8 +932,6 @@ public class LocalRegion extends AbstractRegion final PartitionedRegion pr = internalRegionArgs .getPartitionedRegion(); internalRegionArgs.setUserAttribute(pr.getUserAttribute()); - internalRegionArgs.setKeyRequiresRegionContext(pr - .keyRequiresRegionContext()); if (pr.isShadowPR()) { newRegion = new BucketRegionQueue(subregionName, regionAttributes, this, this.cache, internalRegionArgs); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/Oplog.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/Oplog.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/Oplog.java index 6d0f17a..881d488 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/Oplog.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/Oplog.java @@ -1916,7 +1916,6 @@ public final class Oplog implements CompactableOplog, Flushable { CountingDataInputStream dis = null; try { final LocalRegion currentRegion = LocalRegion.getInitializingRegion(); - final boolean keyRequiresRegionContext = currentRegion != null ? currentRegion.keyRequiresRegionContext() : false; final Version version = getProductVersionIfOld(); final ByteArrayDataInput in = new ByteArrayDataInput(); final HeapDataOutputStream hdos = new HeapDataOutputStream(Version.CURRENT); @@ -1958,7 +1957,7 @@ public final class Oplog implements CompactableOplog, Flushable { } break; case OPLOG_NEW_ENTRY_0ID: - readNewEntry(dis, opCode, deletedIds, recoverValues, currentRegion, keyRequiresRegionContext, version, in, hdos); + readNewEntry(dis, opCode, deletedIds, recoverValues, currentRegion, version, in, hdos); recordCount++; break; case OPLOG_MOD_ENTRY_1ID: @@ -1969,7 +1968,7 @@ public final class Oplog implements CompactableOplog, Flushable { case OPLOG_MOD_ENTRY_6ID: case OPLOG_MOD_ENTRY_7ID: case OPLOG_MOD_ENTRY_8ID: - readModifyEntry(dis, opCode, deletedIds, recoverValues, currentRegion, keyRequiresRegionContext, version, in, hdos); + readModifyEntry(dis, opCode, deletedIds, recoverValues, currentRegion, version, in, hdos); recordCount++; break; case OPLOG_MOD_ENTRY_WITH_KEY_1ID: @@ -1980,7 +1979,7 @@ public final class Oplog implements CompactableOplog, Flushable { case OPLOG_MOD_ENTRY_WITH_KEY_6ID: case OPLOG_MOD_ENTRY_WITH_KEY_7ID: case OPLOG_MOD_ENTRY_WITH_KEY_8ID: - readModifyEntryWithKey(dis, opCode, deletedIds, recoverValues, currentRegion, keyRequiresRegionContext, version, in, + readModifyEntryWithKey(dis, opCode, deletedIds, recoverValues, currentRegion, version, in, hdos); recordCount++; break; @@ -2463,7 +2462,7 @@ public final class Oplog implements CompactableOplog, Flushable { * @throws IOException */ private void readNewEntry(CountingDataInputStream dis, byte opcode, OplogEntryIdSet deletedIds, boolean recoverValue, - final LocalRegion currentRegion, boolean keyRequiresRegionContext, Version version, ByteArrayDataInput in, + final LocalRegion currentRegion, Version version, ByteArrayDataInput in, HeapDataOutputStream hdos) throws IOException { final boolean isPersistRecoveryDebugEnabled = logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY); @@ -2602,9 +2601,6 @@ public final class Oplog implements CompactableOplog, Flushable { } } else { Object key = deserializeKey(keyBytes, version, in); - if (keyRequiresRegionContext) { - ((KeyWithRegionContext) key).setRegionContext(currentRegion); - } { Object oldValue = getRecoveryMap().put(oplogKeyId, key); if (oldValue != null) { @@ -2654,7 +2650,7 @@ public final class Oplog implements CompactableOplog, Flushable { * @throws IOException */ private void readModifyEntry(CountingDataInputStream dis, byte opcode, OplogEntryIdSet deletedIds, boolean recoverValue, - LocalRegion currentRegion, boolean keyRequiresRegionContext, Version version, ByteArrayDataInput in, HeapDataOutputStream hdos) + LocalRegion currentRegion, Version version, ByteArrayDataInput in, HeapDataOutputStream hdos) throws IOException { final boolean isPersistRecoveryDebugEnabled = logger.isTraceEnabled(LogMarker.PERSIST_RECOVERY); @@ -2760,9 +2756,6 @@ public final class Oplog implements CompactableOplog, Flushable { byte[] keyBytes = (byte[]) skippedKeyBytes.get(oplogKeyId); if (keyBytes != null) { key = deserializeKey(keyBytes, version, in); - if (keyRequiresRegionContext) { - ((KeyWithRegionContext) key).setRegionContext(currentRegion); - } } } if (isPersistRecoveryDebugEnabled) { @@ -2878,7 +2871,7 @@ public final class Oplog implements CompactableOplog, Flushable { * @throws IOException */ private void readModifyEntryWithKey(CountingDataInputStream dis, byte opcode, OplogEntryIdSet deletedIds, boolean recoverValue, - final LocalRegion currentRegion, final boolean keyRequiresRegionContext, Version version, ByteArrayDataInput in, + final LocalRegion currentRegion, Version version, ByteArrayDataInput in, HeapDataOutputStream hdos) throws IOException { long oplogOffset = -1; @@ -3015,9 +3008,6 @@ public final class Oplog implements CompactableOplog, Flushable { } } else { Object key = deserializeKey(keyBytes, version, in); - if (keyRequiresRegionContext) { - ((KeyWithRegionContext) key).setRegionContext(currentRegion); - } Object oldValue = getRecoveryMap().put(oplogKeyId, key); if (oldValue != null) { throw new AssertionError(LocalizedStrings.Oplog_DUPLICATE_CREATE.toLocalizedString(oplogKeyId)); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/QueuedOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/QueuedOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/QueuedOperation.java index 2d5a698..655d7cd 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/QueuedOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/QueuedOperation.java @@ -161,13 +161,7 @@ public class QueuedOperation key = DataSerializer.readObject(in); if (op.isUpdate() || op.isCreate()) { deserializationPolicy = in.readByte(); - if (deserializationPolicy == - DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER) { - valueObj = DataSerializer.readObject(in); - } - else { - value = DataSerializer.readByteArray(in); - } + value = DataSerializer.readByteArray(in); } } return new QueuedOperation(op, key, value, valueObj, deserializationPolicy, @@ -183,13 +177,7 @@ public class QueuedOperation DataSerializer.writeObject(this.key, out); if (this.op.isUpdate() || this.op.isCreate()) { out.writeByte(this.deserializationPolicy); - if (this.deserializationPolicy != - DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER) { - DataSerializer.writeByteArray(this.value, out); - } - else { - DataSerializer.writeObject(this.valueObj, out); - } + DataSerializer.writeByteArray(this.value, out); } } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteContainsKeyValueMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteContainsKeyValueMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteContainsKeyValueMessage.java index acf8723..9a044ba 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteContainsKeyValueMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteContainsKeyValueMessage.java @@ -123,9 +123,6 @@ public final class RemoteContainsKeyValueMessage extends RemoteOperationMessageW r.waitOnInitialization(); // bug #43371 - accessing a region before it's initialized } - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } final boolean replyVal; if (this.valueCheck) { replyVal = r.containsValueForKey(this.key); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteDestroyMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteDestroyMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteDestroyMessage.java index f7109bb..bf92eb6 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteDestroyMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteDestroyMessage.java @@ -357,9 +357,6 @@ public class RemoteDestroyMessage extends RemoteOperationMessageWithDirectReply if (eventSender == null) { eventSender = getSender(); } - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } @Released EntryEventImpl event = null; try { if (this.bridgeContext != null) { @@ -595,12 +592,8 @@ public class RemoteDestroyMessage extends RemoteOperationMessageWithDirectReply private void setOldValueIsSerialized(boolean isSerialized) { if (isSerialized) { - if (CachedDeserializableFactory.preferObject()) { - this.oldValueIsSerialized = true; //VALUE_IS_OBJECT; - } else { - // Defer serialization until toData is called. - this.oldValueIsSerialized = true; //VALUE_IS_SERIALIZED_OBJECT; - } + // Defer serialization until toData is called. + this.oldValueIsSerialized = true; //VALUE_IS_SERIALIZED_OBJECT; } else { this.oldValueIsSerialized = false; //VALUE_IS_BYTES; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchEntryMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchEntryMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchEntryMessage.java index 685f0a5..cdd8e1e 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchEntryMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchEntryMessage.java @@ -128,9 +128,6 @@ public final class RemoteFetchEntryMessage extends RemoteOperationMessage } EntrySnapshot val; try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } final KeyInfo keyInfo = r.getKeyInfo(key); Region.Entry re = r.getDataView().getEntry(keyInfo, r, true); if(re==null) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchVersionMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchVersionMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchVersionMessage.java index 12e4de6..78e3fc1 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchVersionMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteFetchVersionMessage.java @@ -122,9 +122,6 @@ public final class RemoteFetchVersionMessage extends RemoteOperationMessage { } VersionTag tag; try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext) this.key).setRegionContext(r); - } RegionEntry re = r.getRegionEntry(key); if (re == null) { if (logger.isTraceEnabled(LogMarker.DM)) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteGetMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteGetMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteGetMessage.java index b565a2c..07faaf2 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteGetMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteGetMessage.java @@ -118,9 +118,6 @@ public final class RemoteGetMessage extends RemoteOperationMessageWithDirectRepl RawValue valueBytes; Object val = null; try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } KeyInfo keyInfo = r.getKeyInfo(key, cbArg); val = r.getDataView().getSerializedValue(r, keyInfo, false, this.context, null, false /*for replicate regions*/); valueBytes = val instanceof RawValue ? (RawValue)val : new RawValue(val); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteInvalidateMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteInvalidateMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteInvalidateMessage.java index c4ed1cc..2602132 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteInvalidateMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteInvalidateMessage.java @@ -188,9 +188,6 @@ public final class RemoteInvalidateMessage extends RemoteDestroyMessage { eventSender = getSender(); } final Object key = getKey(); - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)key).setRegionContext(r); - } @Released final EntryEventImpl event = EntryEventImpl.create( r, getOperation(), http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutAllMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutAllMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutAllMessage.java index ff09af9..8462816 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutAllMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutAllMessage.java @@ -279,10 +279,6 @@ public final class RemotePutAllMessage extends RemoteOperationMessageWithDirectR EntryVersionsList versionTags = new EntryVersionsList(putAllDataCount); boolean hasTags = false; - // get the "keyRequiresRegionContext" flag from first element assuming - // all key objects to be uniform - final boolean requiresRegionContext = - (this.putAllData[0].key instanceof KeyWithRegionContext); for (int i = 0; i < this.putAllDataCount; i++) { if (!hasTags && putAllData[i].versionTag != null) { hasTags = true; @@ -290,7 +286,7 @@ public final class RemotePutAllMessage extends RemoteOperationMessageWithDirectR VersionTag<?> tag = putAllData[i].versionTag; versionTags.add(tag); putAllData[i].versionTag = null; - this.putAllData[i].toData(out, requiresRegionContext); + this.putAllData[i].toData(out); this.putAllData[i].versionTag = tag; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutMessage.java index 05d1cda..fcf42dc 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemotePutMessage.java @@ -135,8 +135,7 @@ public final class RemotePutMessage extends RemoteOperationMessageWithDirectRepl /** * Indicates if and when the new value should be deserialized on the - * the receiver. Distinguishes between Deltas which need to be eagerly - * deserialized (DESERIALIZATION_POLICY_EAGER), a non-byte[] value that was + * the receiver. Distinguishes between a non-byte[] value that was * serialized (DESERIALIZATION_POLICY_LAZY) and a * byte[] array value that didn't need to be serialized * (DESERIALIZATION_POLICY_NONE). While this seems like an extra data, it @@ -252,11 +251,7 @@ public final class RemotePutMessage extends RemoteOperationMessageWithDirectRepl event.setOriginRemote(useOriginRemote); if (event.hasNewValue()) { - if (CachedDeserializableFactory.preferObject()) { - this.deserializationPolicy = DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER; - } else { - this.deserializationPolicy = DistributedCacheOperation.DESERIALIZATION_POLICY_LAZY; - } + this.deserializationPolicy = DistributedCacheOperation.DESERIALIZATION_POLICY_LAZY; event.exportNewValue(this); } else { @@ -568,13 +563,7 @@ public final class RemotePutMessage extends RemoteOperationMessageWithDirectRepl this.oldValueIsSerialized = (in.readByte() == 1); setOldValBytes(DataSerializer.readByteArray(in)); } - if (this.deserializationPolicy == - DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER) { - setValObj(DataSerializer.readObject(in)); - } - else { - setValBytes(DataSerializer.readByteArray(in)); - } + setValBytes(DataSerializer.readByteArray(in)); if ((flags & HAS_DELTA_BYTES) != 0) { this.applyDeltaBytes = true; this.deltaBytes = DataSerializer.readByteArray(in); @@ -681,9 +670,6 @@ public final class RemotePutMessage extends RemoteOperationMessageWithDirectRepl if (eventSender == null) { eventSender = getSender(); } - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } @Released EntryEventImpl eei = EntryEventImpl.create( r, getOperation(), @@ -732,10 +718,6 @@ public final class RemotePutMessage extends RemoteOperationMessageWithDirectRepl case DistributedCacheOperation.DESERIALIZATION_POLICY_NONE: event.setNewValue(getValBytes()); break; - case DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER: - // new value is a Delta - event.setNewValue(this.valObj); // sets the delta field - break; default: throw new AssertionError("unknown deserialization policy: " + deserializationPolicy); @@ -1212,12 +1194,8 @@ public final class RemotePutMessage extends RemoteOperationMessageWithDirectRepl private void setOldValueIsSerialized(boolean isSerialized) { if (isSerialized) { - if (CachedDeserializableFactory.preferObject()) { - this.oldValueIsSerialized = true; //VALUE_IS_OBJECT; - } else { - // Defer serialization until toData is called. - this.oldValueIsSerialized = true; //VALUE_IS_SERIALIZED_OBJECT; - } + // Defer serialization until toData is called. + this.oldValueIsSerialized = true; //VALUE_IS_SERIALIZED_OBJECT; } else { this.oldValueIsSerialized = false; //VALUE_IS_BYTES; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteRemoveAllMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteRemoveAllMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteRemoveAllMessage.java index 01e8d9e..e4bb2c8 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteRemoveAllMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RemoteRemoveAllMessage.java @@ -267,10 +267,6 @@ public final class RemoteRemoveAllMessage extends RemoteOperationMessageWithDire EntryVersionsList versionTags = new EntryVersionsList(removeAllDataCount); boolean hasTags = false; - // get the "keyRequiresRegionContext" flag from first element assuming - // all key objects to be uniform - final boolean requiresRegionContext = - (this.removeAllData[0].key instanceof KeyWithRegionContext); for (int i = 0; i < this.removeAllDataCount; i++) { if (!hasTags && removeAllData[i].versionTag != null) { hasTags = true; @@ -278,7 +274,7 @@ public final class RemoteRemoveAllMessage extends RemoteOperationMessageWithDire VersionTag<?> tag = removeAllData[i].versionTag; versionTags.add(tag); removeAllData[i].versionTag = null; - this.removeAllData[i].toData(out, requiresRegionContext); + this.removeAllData[i].toData(out); this.removeAllData[i].versionTag = tag; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java index 6642ec6..f575938 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java @@ -1929,9 +1929,6 @@ public class SearchLoadAndWriteProcessor implements MembershipListener { setClearCountReference(region); try { boolean initialized = region.isInitialized(); - if(region.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(region); - } RegionEntry entry = region.basicGetEntry(this.key); if (entry != null) { synchronized (entry) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionLockRequestImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionLockRequestImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionLockRequestImpl.java index 29af5cc..ce6cae6 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionLockRequestImpl.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXRegionLockRequestImpl.java @@ -104,24 +104,17 @@ public class TXRegionLockRequestImpl final GemFireCacheImpl cache = getCache(false); try { final int size = InternalDataSerializer.readArrayLength(in); - boolean read = false; if (cache != null && size > 0) { this.r = (LocalRegion)cache.getRegion(this.regionPath); - if( this.r != null ) { - this.entryKeys = readEntryKeySet(this.r.keyRequiresRegionContext(), size, in); - read = true; - } - } - if ( !read && size > 0 ) { - this.entryKeys = readEntryKeySet(false, size, in); } + this.entryKeys = readEntryKeySet(size, in); } catch (CacheClosedException cce) { // don't throw in deserialization this.entryKeys = null; } } - private final Set<Object> readEntryKeySet(final boolean keyRequiresRegionContext, + private final Set<Object> readEntryKeySet( final int size, final DataInput in) throws IOException, ClassNotFoundException { @@ -133,9 +126,6 @@ public class TXRegionLockRequestImpl Object key; for (int i = 0; i < size; i++) { key = DataSerializer.readObject(in); - if (keyRequiresRegionContext) { - ((KeyWithRegionContext)key).setRegionContext(this.r); - } set.add(key); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateEntryVersionOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateEntryVersionOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateEntryVersionOperation.java index fce4dee..23fb300 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateEntryVersionOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateEntryVersionOperation.java @@ -94,11 +94,6 @@ public class UpdateEntryVersionOperation extends DistributedCacheOperation { @Retained protected InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { - - if (rgn.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(rgn); - } - @Retained EntryEventImpl ev = EntryEventImpl.create(rgn, getOperation(), this.key, null /* newValue */, this.callbackArg /*callbackArg*/, true /* originRemote*/ , getSender(), false /*generateCallbacks*/); ev.setEventId(this.eventId); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateOperation.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateOperation.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateOperation.java index 30a9ef7..e60cda3 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateOperation.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/UpdateOperation.java @@ -100,11 +100,7 @@ public class UpdateOperation extends AbstractUpdateOperation m.event = ev; m.eventId = ev.getEventId(); m.key = ev.getKey(); - if (CachedDeserializableFactory.preferObject()) { - m.deserializationPolicy = DESERIALIZATION_POLICY_EAGER; - } else { - m.deserializationPolicy = DESERIALIZATION_POLICY_LAZY; - } + m.deserializationPolicy = DESERIALIZATION_POLICY_LAZY; ev.exportNewValue(m); } @@ -297,8 +293,7 @@ public class UpdateOperation extends AbstractUpdateOperation */ static void setNewValueInEvent(byte[] newValue, Object newValueObj, EntryEventImpl event, byte deserializationPolicy) { - if (newValue == null - && deserializationPolicy != DESERIALIZATION_POLICY_EAGER) { + if (newValue == null) { // in an UpdateMessage this results from a create(key, null) call, // set local invalid flag in event if this is a normal region. Otherwise // it should be a distributed invalid. @@ -317,9 +312,6 @@ public class UpdateOperation extends AbstractUpdateOperation case DESERIALIZATION_POLICY_NONE: event.setNewValue(newValue); break; - case DESERIALIZATION_POLICY_EAGER: - event.setNewValue(newValueObj); - break; default: throw new InternalGemFireError(LocalizedStrings .UpdateOperation_UNKNOWN_DESERIALIZATION_POLICY_0 @@ -332,10 +324,6 @@ public class UpdateOperation extends AbstractUpdateOperation { Object argNewValue = null; final boolean originRemote = true, generateCallbacks = true; - - if (rgn.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(rgn); - } @Retained EntryEventImpl result = EntryEventImpl.create(rgn, getOperation(), this.key, argNewValue, // oldValue, this.callbackArg, originRemote, getSender(), generateCallbacks); @@ -413,13 +401,7 @@ public class UpdateOperation extends AbstractUpdateOperation this.deltaBytes = DataSerializer.readByteArray(in); } else { - if (this.deserializationPolicy - == DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER) { - this.newValueObj = DataSerializer.readObject(in); - } - else { - this.newValue = DataSerializer.readByteArray(in); - } + this.newValue = DataSerializer.readByteArray(in); if ((extraFlags & HAS_DELTA_WITH_FULL_VALUE) != 0) { this.deltaBytes = DataSerializer.readByteArray(in); } @@ -500,13 +482,7 @@ public class UpdateOperation extends AbstractUpdateOperation byte[] valueBytes = null; Object valueObj = null; if (this.newValueObj != null) { - if (this.deserializationPolicy == - DistributedCacheOperation.DESERIALIZATION_POLICY_EAGER) { - valueObj = this.newValueObj; - } - else { - valueBytes = EntryEventImpl.serialize(this.newValueObj); - } + valueBytes = EntryEventImpl.serialize(this.newValueObj); } else { valueBytes = this.newValue; @@ -576,10 +552,6 @@ public class UpdateOperation extends AbstractUpdateOperation // boolean localLoad = false, netLoad = false, netSearch = false, // distributed = true; final boolean originRemote = true, generateCallbacks = true; - - if (rgn.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(rgn); - } @Retained EntryEventImpl ev = EntryEventImpl.create(rgn, getOperation(), this.key, argNewValue, this.callbackArg, originRemote, getSender(), generateCallbacks); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/RegionFunctionContextImpl.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/RegionFunctionContextImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/RegionFunctionContextImpl.java index 175e863..0a6bfc4 100755 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/RegionFunctionContextImpl.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/RegionFunctionContextImpl.java @@ -26,9 +26,7 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.execute.Execution; import com.gemstone.gemfire.cache.execute.FunctionService; import com.gemstone.gemfire.cache.execute.ResultSender; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.LocalDataSet; -import com.gemstone.gemfire.internal.cache.LocalRegion; /** * Context available to data dependent functions. When function is executed @@ -67,17 +65,6 @@ public class RegionFunctionContextImpl extends FunctionContextImpl implements this.localBucketSet = localBucketSet; this.isPossibleDuplicate = isPossibleDuplicate; setFunctionContexts(); - // set the region context for keys if required - if (routingObjects != null) { - final LocalRegion r = (LocalRegion)this.dataSet; - if (r.keyRequiresRegionContext()) { - for (Object key : routingObjects) { - if (key instanceof KeyWithRegionContext) { - ((KeyWithRegionContext)key).setRegionContext(r); - } - } - } - } } private void setFunctionContexts() { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/ContainsKeyValueMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/ContainsKeyValueMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/ContainsKeyValueMessage.java index 4a9c684..36974ef 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/ContainsKeyValueMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/ContainsKeyValueMessage.java @@ -38,7 +38,6 @@ import com.gemstone.gemfire.distributed.internal.ReplySender; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.internal.Assert; import com.gemstone.gemfire.internal.cache.ForceReattemptException; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.PrimaryBucketException; @@ -125,9 +124,6 @@ public final class ContainsKeyValueMessage extends PartitionMessageWithDirectRep final boolean replyVal; if (ds != null) { try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } if (this.valueCheck) { replyVal = ds.containsValueForKeyLocally(this.bucketId, this.key); } else { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/DestroyMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/DestroyMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/DestroyMessage.java index c706a3c..74ff5e8 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/DestroyMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/DestroyMessage.java @@ -48,7 +48,6 @@ import com.gemstone.gemfire.internal.cache.EnumListenerEvent; import com.gemstone.gemfire.internal.cache.EventID; import com.gemstone.gemfire.internal.cache.FilterRoutingInfo; import com.gemstone.gemfire.internal.cache.ForceReattemptException; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper; @@ -253,9 +252,6 @@ public class DestroyMessage extends PartitionMessageWithDirectReply { } @Released EntryEventImpl event = null; try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } if (this.bridgeContext != null) { event = EntryEventImpl.create(r, getOperation(), this.key, null/*newValue*/, getCallbackArg(), false/*originRemote*/, eventSender, http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchBulkEntriesMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchBulkEntriesMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchBulkEntriesMessage.java index ea47e91..147f116 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchBulkEntriesMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchBulkEntriesMessage.java @@ -52,7 +52,6 @@ import com.gemstone.gemfire.internal.cache.BucketRegion; import com.gemstone.gemfire.internal.cache.EntryEventImpl; import com.gemstone.gemfire.internal.cache.ForceReattemptException; import com.gemstone.gemfire.internal.cache.InitialImageOperation; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.VersionTagHolder; @@ -523,8 +522,6 @@ public final class FetchBulkEntriesMessage extends PartitionMessage try { ByteArrayInputStream byteStream = new ByteArrayInputStream(msg.chunk); DataInputStream in = new DataInputStream(byteStream); - final boolean requiresRegionContext = this.pr - .keyRequiresRegionContext(); Object key; int currentId; @@ -538,9 +535,6 @@ public final class FetchBulkEntriesMessage extends PartitionMessage deserializingKey = true; key = DataSerializer.readObject(in); if (key != null) { - if (requiresRegionContext) { - ((KeyWithRegionContext) key).setRegionContext(this.pr); - } deserializingKey = false; Object value = DataSerializer.readObject(in); VersionTag versionTag = DataSerializer.readObject(in); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java index d27e33e..827efea 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntriesMessage.java @@ -51,7 +51,6 @@ import com.gemstone.gemfire.internal.cache.BucketRegion; import com.gemstone.gemfire.internal.cache.CachedDeserializable; import com.gemstone.gemfire.internal.cache.ForceReattemptException; import com.gemstone.gemfire.internal.cache.InitialImageOperation; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.LocalRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; @@ -542,17 +541,12 @@ public final class FetchEntriesMessage extends PartitionMessage try { ByteArrayInputStream byteStream = new ByteArrayInputStream(msg.chunk); DataInputStream in = new DataInputStream(byteStream); - final boolean requiresRegionContext = this.pr - .keyRequiresRegionContext(); Object key; while (in.available() > 0) { deserializingKey = true; key = DataSerializer.readObject(in); if (key != null) { - if (requiresRegionContext) { - ((KeyWithRegionContext)key).setRegionContext(this.pr); - } deserializingKey = false; Object value = DataSerializer.readObject(in); VersionTag versionTag = DataSerializer.readObject(in); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntryMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntryMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntryMessage.java index ae363ba..86afb19 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntryMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchEntryMessage.java @@ -46,7 +46,6 @@ import com.gemstone.gemfire.internal.cache.DataLocationException; import com.gemstone.gemfire.internal.cache.EntrySnapshot; import com.gemstone.gemfire.internal.cache.ForceReattemptException; import com.gemstone.gemfire.internal.cache.KeyInfo; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.PrimaryBucketException; @@ -146,9 +145,6 @@ public final class FetchEntryMessage extends PartitionMessage EntrySnapshot val; if (ds != null) { try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } KeyInfo keyInfo = r.getKeyInfo(key); val = (EntrySnapshot)r.getDataView().getEntryOnRemote(keyInfo, r, true); r.getPrStats().endPartitionMessagesProcessing(startTime); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchKeysMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchKeysMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchKeysMessage.java index d7c7d71..e696d43 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchKeysMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/FetchKeysMessage.java @@ -44,7 +44,6 @@ import com.gemstone.gemfire.internal.HeapDataOutputStream; import com.gemstone.gemfire.internal.Version; import com.gemstone.gemfire.internal.cache.ForceReattemptException; import com.gemstone.gemfire.internal.cache.InitialImageOperation; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.tier.InterestType; @@ -495,14 +494,9 @@ public final class FetchKeysMessage extends PartitionMessage try { ByteArrayInputStream byteStream = new ByteArrayInputStream(msg.chunk); DataInputStream in = new DataInputStream(byteStream); - final boolean requiresRegionContext = this.pr - .keyRequiresRegionContext(); while (in.available() > 0) { Object key = DataSerializer.readObject(in); if (key != null) { - if (requiresRegionContext) { - ((KeyWithRegionContext)key).setRegionContext(this.pr); - } synchronized(returnValue) { returnValue.add(key); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java index 3fef790..d3de481 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/GetMessage.java @@ -51,7 +51,6 @@ import com.gemstone.gemfire.internal.cache.DataLocationException; import com.gemstone.gemfire.internal.cache.EntryEventImpl; import com.gemstone.gemfire.internal.cache.ForceReattemptException; import com.gemstone.gemfire.internal.cache.KeyInfo; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.PrimaryBucketException; @@ -182,9 +181,6 @@ public final class GetMessage extends PartitionMessageWithDirectReply if (ds != null) { VersionTagHolder event = new VersionTagHolder(); try { - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)this.key).setRegionContext(r); - } KeyInfo keyInfo = r.getKeyInfo(key, cbArg); boolean lockEntry = forceUseOfPRExecutor || isDirectAck(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/a6be9497/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/InvalidateMessage.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/InvalidateMessage.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/InvalidateMessage.java index 60508c1..cfea633 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/InvalidateMessage.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/partitioned/InvalidateMessage.java @@ -45,7 +45,6 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl; import com.gemstone.gemfire.internal.cache.EnumListenerEvent; import com.gemstone.gemfire.internal.cache.FilterRoutingInfo; import com.gemstone.gemfire.internal.cache.ForceReattemptException; -import com.gemstone.gemfire.internal.cache.KeyWithRegionContext; import com.gemstone.gemfire.internal.cache.PartitionedRegion; import com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore; import com.gemstone.gemfire.internal.cache.PartitionedRegionHelper; @@ -177,9 +176,6 @@ public final class InvalidateMessage extends DestroyMessage { eventSender = getSender(); } final Object key = getKey(); - if (r.keyRequiresRegionContext()) { - ((KeyWithRegionContext)key).setRegionContext(r); - } @Released final EntryEventImpl event = EntryEventImpl.create( r, getOperation(),
