Return-Path: X-Original-To: apmail-geode-commits-archive@minotaur.apache.org Delivered-To: apmail-geode-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B97C196B1 for ; Fri, 15 Apr 2016 18:45:19 +0000 (UTC) Received: (qmail 12070 invoked by uid 500); 15 Apr 2016 18:45:19 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 12041 invoked by uid 500); 15 Apr 2016 18:45:19 -0000 Mailing-List: contact commits-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list commits@geode.incubator.apache.org Received: (qmail 12032 invoked by uid 99); 15 Apr 2016 18:45:18 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 18:45:18 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6E97A1A0163 for ; Fri, 15 Apr 2016 18:45:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.221 X-Spam-Level: X-Spam-Status: No, score=-3.221 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 7QW9MRKwRrX9 for ; Fri, 15 Apr 2016 18:45:06 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id DC5575F39B for ; Fri, 15 Apr 2016 18:45:03 +0000 (UTC) Received: (qmail 11244 invoked by uid 99); 15 Apr 2016 18:45:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 18:45:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9513AE0249; Fri, 15 Apr 2016 18:45:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dschneider@apache.org To: commits@geode.incubator.apache.org Date: Fri, 15 Apr 2016 18:45:04 -0000 Message-Id: <70574141822e4312b787dbe972ec17ce@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/3] incubator-geode git commit: reviewed all EntryEventImpl creators created two new subclasses to mark ones that are never off-heap added annotations and comments on all creators added missing release calls still need to figure out iterator next on pu reviewed all EntryEventImpl creators created two new subclasses to mark ones that are never off-heap added annotations and comments on all creators added missing release calls still need to figure out iterator next on putAll and removeAll code Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/aec12fb5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/aec12fb5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/aec12fb5 Branch: refs/heads/feature/GEODE-1238 Commit: aec12fb54d5cd8bc341a5ff674b52e2b1c4295cd Parents: 80533ba Author: Darrel Schneider Authored: Fri Apr 15 11:42:19 2016 -0700 Committer: Darrel Schneider Committed: Fri Apr 15 11:42:19 2016 -0700 ---------------------------------------------------------------------- .../client/internal/ServerRegionProxy.java | 3 +- .../internal/admin/ClientStatsManager.java | 3 +- .../cache/AbstractBucketRegionQueue.java | 3 +- .../internal/cache/AbstractLRURegionMap.java | 4 + .../internal/cache/AbstractRegionEntry.java | 2 +- .../internal/cache/AbstractRegionMap.java | 15 ++- .../gemfire/internal/cache/BucketRegion.java | 14 +- .../internal/cache/BucketRegionQueue.java | 7 +- .../internal/cache/DestroyOperation.java | 6 +- .../internal/cache/DistPeerTXStateStub.java | 2 + .../gemfire/internal/cache/DistTXState.java | 9 +- .../cache/DistTXStateOnCoordinator.java | 2 + .../DistTXStateProxyImplOnCoordinator.java | 2 + .../cache/DistributedCacheOperation.java | 4 +- .../cache/DistributedPutAllOperation.java | 21 ++- .../internal/cache/DistributedRegion.java | 9 +- .../cache/DistributedRemoveAllOperation.java | 20 ++- .../gemfire/internal/cache/EntryEventImpl.java | 41 +----- .../gemfire/internal/cache/EntryExpiryTask.java | 9 +- .../gemfire/internal/cache/EventIDHolder.java | 35 +++++ .../gemfire/internal/cache/FilterProfile.java | 13 +- .../gemfire/internal/cache/HARegion.java | 5 +- .../internal/cache/InitialImageOperation.java | 2 +- .../internal/cache/InvalidateOperation.java | 5 +- .../gemfire/internal/cache/LocalRegion.java | 129 +++++++++---------- .../internal/cache/PartitionedRegion.java | 13 +- .../gemfire/internal/cache/ProxyRegionMap.java | 7 +- .../gemfire/internal/cache/QueuedOperation.java | 3 +- .../internal/cache/RemoteDestroyMessage.java | 3 +- .../internal/cache/RemoteInvalidateMessage.java | 4 +- .../internal/cache/RemotePutAllMessage.java | 5 +- .../internal/cache/RemotePutMessage.java | 4 +- .../internal/cache/RemoteRemoveAllMessage.java | 5 +- .../cache/SearchLoadAndWriteProcessor.java | 6 +- .../gemfire/internal/cache/TXCommitMessage.java | 4 +- .../gemfire/internal/cache/TXEntryState.java | 6 +- .../gemfire/internal/cache/TXRegionState.java | 1 + .../gemfire/internal/cache/TXRmtEvent.java | 9 +- .../gemfire/internal/cache/TXState.java | 9 +- .../cache/TimestampedEntryEventImpl.java | 2 + .../cache/UpdateEntryVersionOperation.java | 4 +- .../gemfire/internal/cache/UpdateOperation.java | 8 +- .../internal/cache/VersionTagHolder.java | 34 +++++ .../cache/partitioned/DestroyMessage.java | 11 +- .../partitioned/FetchBulkEntriesMessage.java | 4 +- .../internal/cache/partitioned/GetMessage.java | 5 +- .../cache/partitioned/InvalidateMessage.java | 3 +- .../PRUpdateEntryVersionMessage.java | 1 + .../cache/partitioned/PutAllPRMessage.java | 12 +- .../internal/cache/partitioned/PutMessage.java | 11 +- .../cache/partitioned/RemoveAllPRMessage.java | 13 +- .../cache/tier/sockets/BaseCommand.java | 12 +- .../cache/tier/sockets/CacheClientUpdater.java | 3 +- .../cache/tier/sockets/command/Destroy.java | 3 +- .../cache/tier/sockets/command/Destroy65.java | 3 +- .../sockets/command/GatewayReceiverCommand.java | 11 +- .../cache/tier/sockets/command/Get70.java | 15 +-- .../cache/tier/sockets/command/Invalidate.java | 3 +- .../cache/tier/sockets/command/Put.java | 5 +- .../cache/tier/sockets/command/Put61.java | 5 +- .../cache/tier/sockets/command/Put65.java | 3 +- .../internal/cache/tx/DistTxEntryEvent.java | 13 +- .../cache/tx/PartitionedTXRegionStub.java | 17 ++- .../cache/wan/AbstractGatewaySender.java | 5 +- .../AbstractGatewaySenderEventProcessor.java | 2 + .../cache/wan/serial/BatchDestroyOperation.java | 5 +- ...urrentSerialGatewaySenderEventProcessor.java | 3 +- .../wan/serial/SerialGatewaySenderQueue.java | 2 +- .../DistributedAckRegionCCEDUnitTest.java | 6 +- .../internal/cache/UpdateVersionJUnitTest.java | 4 +- .../cache/ha/EventIdOptimizationDUnitTest.java | 5 +- .../DestroyEntryPropagationDUnitTest.java | 5 +- .../internal/cache/UpdateVersionDUnitTest.java | 4 +- 73 files changed, 425 insertions(+), 261 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java index 40f240f..23e04fd 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java @@ -42,6 +42,7 @@ import com.gemstone.gemfire.internal.cache.ClientServerObserver; import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; import com.gemstone.gemfire.internal.cache.EntryEventImpl; import com.gemstone.gemfire.internal.cache.EventID; +import com.gemstone.gemfire.internal.cache.EventIDHolder; import com.gemstone.gemfire.internal.cache.LocalRegion; import com.gemstone.gemfire.internal.cache.TXCommitMessage; import com.gemstone.gemfire.internal.cache.TXManagerImpl; @@ -192,7 +193,7 @@ public class ServerRegionProxy extends ServerProxy implements ServerRegionDataAc EventID eventId, Object callbackArg) { - EntryEventImpl event = new EntryEventImpl(eventId); + EventIDHolder event = new EventIDHolder(eventId); PutOp.execute(con, this.pool, this.regionName, key, value, event, callbackArg, this.pool.getPRSingleHopEnabled()); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/ClientStatsManager.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/ClientStatsManager.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/ClientStatsManager.java index 20f6dbf..2db7eb1 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/ClientStatsManager.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/admin/ClientStatsManager.java @@ -36,6 +36,7 @@ import com.gemstone.gemfire.internal.cache.EntryEventImpl; import com.gemstone.gemfire.internal.cache.EventID; import com.gemstone.gemfire.internal.cache.GemFireCacheImpl; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; +import com.gemstone.gemfire.internal.offheap.annotations.Released; import com.gemstone.gemfire.management.internal.cli.CliUtil; /** @@ -84,7 +85,7 @@ public class ClientStatsManager { ServerRegionProxy regionProxy = new ServerRegionProxy(ClientHealthMonitoringRegion.ADMIN_REGION_NAME, pool); EventID eventId = new EventID(ds); - EntryEventImpl event = new EntryEventImpl((Object)null); + @Released EntryEventImpl event = new EntryEventImpl((Object)null); try { event.setEventId(eventId); regionProxy.putForMetaRegion(ds.getMemberId(), stats, null, event, null, true); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractBucketRegionQueue.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractBucketRegionQueue.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractBucketRegionQueue.java index 2c8f493..1f8da88 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractBucketRegionQueue.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractBucketRegionQueue.java @@ -48,6 +48,7 @@ import com.gemstone.gemfire.internal.concurrent.ConcurrentHashSet; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.offheap.OffHeapRegionEntryHelper; +import com.gemstone.gemfire.internal.offheap.annotations.Released; public abstract class AbstractBucketRegionQueue extends BucketRegion { protected static final Logger logger = LogService.getLogger(); @@ -232,7 +233,7 @@ public abstract class AbstractBucketRegionQueue extends BucketRegion { if (logger.isDebugEnabled()) { logger.debug(" destroying primary key {}", key); } - EntryEventImpl event = getPartitionedRegion().newDestroyEntryEvent(key, + @Released EntryEventImpl event = getPartitionedRegion().newDestroyEntryEvent(key, null); event.setEventId(new EventID(cache.getSystem())); try { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java index a19ee66..2cc7a55 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractLRURegionMap.java @@ -177,6 +177,10 @@ public abstract class AbstractLRURegionMap extends AbstractRegionMap { // make sure this cached deserializable is still in the entry // @todo what if a clear is done and this entry is no longer in the region? { + if (_getCCHelper().getEvictionAlgorithm().isLRUEntry()) { + // no need to worry about the value changing form with entry LRU. + return false; + } Object curVal = le._getValue(); // OFFHEAP: _getValue ok if (curVal != cd) { if (cd instanceof StoredObject) { http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/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 e78c8eb..debc3da 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 @@ -2070,7 +2070,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, newValue[0] = v; } }; - TimestampedEntryEventImpl timestampedEvent = + @Released TimestampedEntryEventImpl timestampedEvent = (TimestampedEntryEventImpl)event.getTimestampedEvent(tagDsid, stampDsid, tagTime, stampTime); // gateway conflict resolvers will usually want to see the old value http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java index 1cb7a20..3286373 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionMap.java @@ -1626,7 +1626,7 @@ public abstract class AbstractRegionMap implements RegionMap { // a receipt of a TXCommitMessage AND there are callbacks installed // for this region boolean invokeCallbacks = shouldCreateCBEvent(owner, isRegionReady || inRI); - EntryEventImpl cbEvent = createCBEvent(owner, op, + @Released EntryEventImpl cbEvent = createCBEvent(owner, op, key, null, txId, txEvent, eventId, aCallbackArgument, filterRoutingInfo, bridgeContext, txEntryState, versionTag, tailKey); try { @@ -1858,7 +1858,7 @@ public abstract class AbstractRegionMap implements RegionMap { // the destroy is already applied on the Initial image provider, thus // causing region entry to be absent. // Notify clients with client events. - EntryEventImpl cbEvent = createCBEvent(owner, op, + @Released EntryEventImpl cbEvent = createCBEvent(owner, op, key, null, txId, txEvent, eventId, aCallbackArgument, filterRoutingInfo, bridgeContext, txEntryState, versionTag, tailKey); try { @@ -2397,7 +2397,7 @@ public abstract class AbstractRegionMap implements RegionMap { final LocalRegion owner = _getOwner(); owner.checkBeforeEntrySync(txEvent); - EntryEventImpl cbEvent = null; + @Released EntryEventImpl cbEvent = null; boolean forceNewEntry = !owner.isInitialized() && owner.isAllEvents(); final boolean hasRemoteOrigin = !((TXId)txId).getMemberId().equals(owner.getMyId()); @@ -2997,7 +2997,7 @@ public abstract class AbstractRegionMap implements RegionMap { stats.incEvictionsInProgress(); // set the flag on event saying the entry should be evicted // and not indexed - EntryEventImpl destroyEvent = EntryEventImpl.create (owner, Operation.DESTROY, event.getKey(), + @Released EntryEventImpl destroyEvent = EntryEventImpl.create (owner, Operation.DESTROY, event.getKey(), null/* newValue */, null, false, owner.getMyId()); try { @@ -3340,8 +3340,8 @@ public abstract class AbstractRegionMap implements RegionMap { final boolean isTXHost = txEntryState != null; final boolean isClientTXOriginator = owner.cache.isClient() && !hasRemoteOrigin; final boolean isRegionReady = owner.isInitialized(); - EntryEventImpl cbEvent = null; - EntryEventImpl sqlfEvent = null; + @Released EntryEventImpl cbEvent = null; + @Released EntryEventImpl sqlfEvent = null; boolean invokeCallbacks = shouldCreateCBEvent(owner, isRegionReady); boolean cbEventInPending = false; cbEvent = createCBEvent(owner, putOp, key, newValue, txId, @@ -3785,6 +3785,7 @@ public abstract class AbstractRegionMap implements RegionMap { } /** create a callback event for applying a transactional change to the local cache */ + @Retained public static final EntryEventImpl createCBEvent(final LocalRegion re, Operation op, Object key, Object newValue, TransactionId txId, TXRmtEvent txEvent,EventID eventId, Object aCallbackArgument,FilterRoutingInfo filterRoutingInfo,ClientProxyMembershipID bridgeContext, TXEntryState txEntryState, VersionTag versionTag, long tailKey) @@ -3799,7 +3800,7 @@ public abstract class AbstractRegionMap implements RegionMap { eventRegion = re.getPartitionedRegion(); } - EntryEventImpl retVal = EntryEventImpl.create( + @Retained EntryEventImpl retVal = EntryEventImpl.create( re, op, key, newValue, aCallbackArgument, txEntryState == null, originator); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java index 3946fda..e0f043b 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegion.java @@ -97,6 +97,8 @@ import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage; import com.gemstone.gemfire.internal.logging.log4j.LogMarker; import com.gemstone.gemfire.internal.offheap.StoredObject; +import com.gemstone.gemfire.internal.offheap.annotations.Released; +import com.gemstone.gemfire.internal.offheap.annotations.Retained; import com.gemstone.gemfire.internal.offheap.annotations.Unretained; import com.gemstone.gemfire.internal.concurrent.AtomicLong5; @@ -1118,6 +1120,7 @@ implements Bucket * @return an event for EVICT_DESTROY */ @Override + @Retained protected EntryEventImpl generateEvictDestroyEvent(Object key) { EntryEventImpl event = super.generateEvictDestroyEvent(key); event.setInvokePRCallbacks(true); //see bug 40797 @@ -1620,6 +1623,7 @@ implements Bucket //we already distributed this info. } + @Retained EntryEventImpl createEventForPR(EntryEventImpl sourceEvent) { EntryEventImpl e2 = new EntryEventImpl(sourceEvent); boolean returned = false; @@ -1663,7 +1667,7 @@ implements Bucket } super.invokeTXCallbacks(eventType, event, callThem); } - final EntryEventImpl prevent = createEventForPR(event); + @Released final EntryEventImpl prevent = createEventForPR(event); try { this.partitionedRegion.invokeTXCallbacks(eventType, prevent, this.partitionedRegion.isInitialized() ? callDispatchListenerEvent : false); } finally { @@ -1691,7 +1695,7 @@ implements Bucket } super.invokeDestroyCallbacks(eventType, event, callThem, notifyGateways); } - final EntryEventImpl prevent = createEventForPR(event); + @Released final EntryEventImpl prevent = createEventForPR(event); try { this.partitionedRegion.invokeDestroyCallbacks(eventType, prevent, this.partitionedRegion.isInitialized() ? callDispatchListenerEvent : false, false); } finally { @@ -1718,7 +1722,7 @@ implements Bucket } super.invokeInvalidateCallbacks(eventType, event, callThem); } - final EntryEventImpl prevent = createEventForPR(event); + @Released final EntryEventImpl prevent = createEventForPR(event); try { this.partitionedRegion.invokeInvalidateCallbacks(eventType, prevent, this.partitionedRegion.isInitialized() ? callDispatchListenerEvent : false); } finally { @@ -1749,7 +1753,7 @@ implements Bucket super.invokePutCallbacks(eventType, event, callThem, notifyGateways); } - final EntryEventImpl prevent = createEventForPR(event); + @Released final EntryEventImpl prevent = createEventForPR(event); try { this.partitionedRegion.invokePutCallbacks(eventType, prevent, this.partitionedRegion.isInitialized() ? callDispatchListenerEvent : false, false); @@ -2577,7 +2581,7 @@ implements Bucket public boolean customEvictDestroy(Object key) { checkReadiness(); - final EntryEventImpl event = + @Released final EntryEventImpl event = generateCustomEvictDestroyEvent(key); event.setCustomEviction(true); boolean locked = false; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegionQueue.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegionQueue.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegionQueue.java index 6b76c31..8b4f240 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegionQueue.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/BucketRegionQueue.java @@ -53,6 +53,7 @@ import com.gemstone.gemfire.internal.concurrent.Atomics; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.offheap.OffHeapRegionEntryHelper; +import com.gemstone.gemfire.internal.offheap.annotations.Released; /** * @@ -504,10 +505,10 @@ public class BucketRegionQueue extends AbstractBucketRegionQueue { if (logger.isDebugEnabled()) { logger.debug(" destroying primary key {}", key); } - EntryEventImpl event = getPartitionedRegion().newDestroyEntryEvent(key, + @Released EntryEventImpl event = getPartitionedRegion().newDestroyEntryEvent(key, null); - event.setEventId(new EventID(cache.getSystem())); try { + event.setEventId(new EventID(cache.getSystem())); event.setRegion(this); basicDestroy(event, true, null); checkReadiness(); @@ -531,8 +532,6 @@ public class BucketRegionQueue extends AbstractBucketRegionQueue { + key, rde); } } finally { - //merge42180: are we considering offheap in cedar. Comment freeOffHeapReference intentionally - //event.freeOffHeapReferences(); event.release(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/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 b0ac963..e267190 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 @@ -34,6 +34,7 @@ import com.gemstone.gemfire.distributed.internal.DistributionManager; import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID; import com.gemstone.gemfire.internal.cache.versions.ConcurrentCacheModificationException; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; +import com.gemstone.gemfire.internal.offheap.annotations.Retained; /** * Handles distribution messaging for destroying an entry in a region. @@ -125,6 +126,7 @@ public class DestroyOperation extends DistributedCacheOperation } @Override + @Retained protected final InternalCacheEvent createEvent(DistributedRegion rgn) throws EntryNotFoundException { if (rgn.keyRequiresRegionContext()) { @@ -151,9 +153,10 @@ public class DestroyOperation extends DistributedCacheOperation } } + @Retained EntryEventImpl createEntryEvent(DistributedRegion rgn) { - EntryEventImpl event = EntryEventImpl.create(rgn, + @Retained EntryEventImpl event = EntryEventImpl.create(rgn, getOperation(), this.key, null, this.callbackArg, true, getSender()); // event.setNewEventId(); Don't set the event here... setOldValueInEvent(event); @@ -258,6 +261,7 @@ public class DestroyOperation extends DistributedCacheOperation } @Override + @Retained EntryEventImpl createEntryEvent(DistributedRegion rgn) { EntryEventImpl event = EntryEventImpl.create(rgn, getOperation(), http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistPeerTXStateStub.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistPeerTXStateStub.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistPeerTXStateStub.java index cd17770..5c53df1 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistPeerTXStateStub.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistPeerTXStateStub.java @@ -259,6 +259,7 @@ public final class DistPeerTXStateStub extends PeerTXStateStub implements public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts, LocalRegion region) { super.postPutAll(putallOp, successfulPuts, region); + // TODO DISTTX: event is never released EntryEventImpl event = EntryEventImpl.createPutAllEvent(putallOp, region, Operation.PUTALL_CREATE, putallOp.getBaseEvent().getKey(), putallOp .getBaseEvent().getValue()); @@ -271,6 +272,7 @@ public final class DistPeerTXStateStub extends PeerTXStateStub implements public void postRemoveAll(DistributedRemoveAllOperation removeAllOp, VersionedObjectList successfulOps, LocalRegion region) { super.postRemoveAll(removeAllOp, successfulOps, region); + // TODO DISTTX: event is never released EntryEventImpl event = EntryEventImpl.createRemoveAllEvent(removeAllOp, region, removeAllOp.getBaseEvent().getKey()); event.setEventId(removeAllOp.getBaseEvent().getEventId()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXState.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXState.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXState.java index 19cc175..f8475ae 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXState.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXState.java @@ -44,6 +44,7 @@ import com.gemstone.gemfire.internal.cache.tx.DistTxKeyInfo; import com.gemstone.gemfire.internal.cache.tx.DistTxEntryEvent; import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; +import com.gemstone.gemfire.internal.offheap.annotations.Released; /** * TxState on a datanode VM @@ -568,7 +569,7 @@ public class DistTXState extends TXState { InternalDistributedMember myId = theRegion.getDistributionManager() .getDistributionManagerId(); for (int i = 0; i < putallOp.putAllDataSize; ++i) { - EntryEventImpl ev = PutAllPRMessage.getEventFromEntry(theRegion, + @Released EntryEventImpl ev = PutAllPRMessage.getEventFromEntry(theRegion, myId, myId, i, putallOp.putAllData, false, putallOp .getBaseEvent().getContext(), false, !putallOp.getBaseEvent() .isGenerateCallbacks(), false); @@ -628,10 +629,11 @@ public class DistTXState extends TXState { InternalDistributedMember myId = theRegion.getDistributionManager() .getDistributionManagerId(); for (int i = 0; i < op.removeAllDataSize; ++i) { - EntryEventImpl ev = RemoveAllPRMessage.getEventFromEntry(theRegion, + @Released EntryEventImpl ev = RemoveAllPRMessage.getEventFromEntry(theRegion, myId, myId, i, op.removeAllData, false, op.getBaseEvent() .getContext(), false, !op.getBaseEvent() .isGenerateCallbacks()); + try { ev.setRemoveAllOperation(op); // below if condition returns true on secondary when TXState is // updated in preCommit only on secondary @@ -664,6 +666,9 @@ public class DistTXState extends TXState { } catch (EntryNotFoundException ignore) { } successfulOps.addKeyAndVersion(op.removeAllData[i].key, null); + } finally { + ev.release(); + } } } }, op.getBaseEvent().getEventId()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateOnCoordinator.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateOnCoordinator.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateOnCoordinator.java index 10d892a..33bec1c 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateOnCoordinator.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateOnCoordinator.java @@ -240,6 +240,7 @@ public final class DistTXStateOnCoordinator extends DistTXState implements public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts, LocalRegion region) { super.postPutAll(putallOp, successfulPuts, region); + // TODO DISTTX: event is never released EntryEventImpl event = EntryEventImpl.createPutAllEvent(putallOp, region, Operation.PUTALL_CREATE, putallOp.getBaseEvent().getKey(), putallOp .getBaseEvent().getValue()); @@ -252,6 +253,7 @@ public final class DistTXStateOnCoordinator extends DistTXState implements public void postRemoveAll(DistributedRemoveAllOperation removeAllOp, VersionedObjectList successfulOps, LocalRegion region) { super.postRemoveAll(removeAllOp, successfulOps, region); + // TODO DISTTX: event is never released EntryEventImpl event = EntryEventImpl.createRemoveAllEvent(removeAllOp, region, removeAllOp.getBaseEvent().getKey()); event.setEventId(removeAllOp.getBaseEvent().getEventId()); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java ---------------------------------------------------------------------- diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java index 75a1df7..67d63b1 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DistTXStateProxyImplOnCoordinator.java @@ -896,6 +896,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl { DistributedPutAllOperation putAllForBucket = bucketToPutallMap.get(bucketId);; if (putAllForBucket == null) { + // TODO DISTTX: event is never released EntryEventImpl event = EntryEventImpl.createPutAllEvent(null, region, Operation.PUTALL_CREATE, key, putallOp.putAllData[i].getValue()); @@ -976,6 +977,7 @@ public class DistTXStateProxyImplOnCoordinator extends DistTXStateProxyImpl { DistributedRemoveAllOperation removeAllForBucket = bucketToRemoveAllMap.get(bucketId); if (removeAllForBucket == null) { + // TODO DISTTX: event is never released EntryEventImpl event = EntryEventImpl.createRemoveAllEvent(op, region, key); event.setEventId(op.removeAllData[i].getEventID()); removeAllForBucket = new DistributedRemoveAllOperation( http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/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 79ae4ee..063f823 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 @@ -74,6 +74,7 @@ import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage; import com.gemstone.gemfire.internal.logging.log4j.LogMarker; import com.gemstone.gemfire.internal.offheap.StoredObject; +import com.gemstone.gemfire.internal.offheap.annotations.Released; import com.gemstone.gemfire.internal.offheap.annotations.Unretained; import com.gemstone.gemfire.internal.sequencelog.EntryLogger; @@ -1104,7 +1105,6 @@ public abstract class DistributedCacheOperation { protected void basicProcess(DistributionManager dm, LocalRegion lclRgn) { Throwable thr = null; boolean sendReply = true; - InternalCacheEvent event = null; if (logger.isTraceEnabled()) { logger.trace("DistributedCacheOperation.basicProcess: {}", this); @@ -1140,7 +1140,7 @@ public abstract class DistributedCacheOperation { return; } - event = createEvent(rgn); + @Released InternalCacheEvent event = createEvent(rgn); try { boolean isEntry = event.getOperation().isEntry(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/aec12fb5/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 2e83cb8..d5c9034 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 @@ -61,6 +61,8 @@ import com.gemstone.gemfire.internal.cache.versions.VersionSource; import com.gemstone.gemfire.internal.cache.versions.VersionTag; import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.logging.log4j.LogMarker; +import com.gemstone.gemfire.internal.offheap.annotations.Released; +import com.gemstone.gemfire.internal.offheap.annotations.Retained; /** * Handles distribution of a Region.putall operation. @@ -193,6 +195,7 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation public boolean hasNext() { return DistributedPutAllOperation.this.putAllDataSize > position; }; + // TODO OFFHEAP: callers of this method need to call release public Object next() { EntryEventImpl ev = getEventForPosition(position); position++; @@ -214,7 +217,7 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation } } - + @Retained public EntryEventImpl getEventForPosition(int position) { PutAllEntryData entry = this.putAllData[position]; if (entry == null) { @@ -224,7 +227,7 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation return entry.event; } LocalRegion region = (LocalRegion)this.event.getRegion(); - EntryEventImpl ev = EntryEventImpl.create( + @Retained EntryEventImpl ev = EntryEventImpl.create( region, entry.getOp(), entry.getKey(), null/* value */, this.event.getCallbackArgument(), @@ -813,13 +816,17 @@ public class DistributedPutAllOperation extends AbstractUpdateOperation } FilterRoutingInfo consolidated = new FilterRoutingInfo(); for (int i=0; i position; }; + // TODO OFFHEAP: result needs to be released by callers public Object next() { EntryEventImpl ev = getEventForPosition(position); position++; @@ -196,6 +199,7 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO } } + @Retained public EntryEventImpl getEventForPosition(int position) { RemoveAllEntryData entry = this.removeAllData[position]; if (entry == null) { @@ -205,7 +209,7 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO return entry.event; } LocalRegion region = (LocalRegion)this.event.getRegion(); - EntryEventImpl ev = EntryEventImpl.create( + @Retained EntryEventImpl ev = EntryEventImpl.create( region, entry.getOp(), entry.getKey(), null/* value */, this.event.getCallbackArgument(), @@ -568,13 +572,17 @@ public class DistributedRemoveAllOperation extends AbstractUpdateOperation // TO } FilterRoutingInfo consolidated = new FilterRoutingInfo(); for (int i=0; i