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 E1D931837C for ; Thu, 9 Jul 2015 17:04:15 +0000 (UTC) Received: (qmail 60954 invoked by uid 500); 9 Jul 2015 17:04:15 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 60924 invoked by uid 500); 9 Jul 2015 17:04:15 -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 60915 invoked by uid 99); 9 Jul 2015 17:04:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jul 2015 17:04:15 +0000 X-ASF-Spam-Status: No, hits=-2000.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 09 Jul 2015 17:00:43 +0000 Received: (qmail 53987 invoked by uid 99); 9 Jul 2015 17:02:20 -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; Thu, 09 Jul 2015 17:02:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6B87FE683D; Thu, 9 Jul 2015 17:02:20 +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: Thu, 09 Jul 2015 17:02:41 -0000 Message-Id: <432bc5944d7e4ae3b424afad44ea2e59@git.apache.org> In-Reply-To: <7f249334f8de4a87a653a7c04a138bba@git.apache.org> References: <7f249334f8de4a87a653a7c04a138bba@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [23/57] [partial] incubator-geode git commit: Initial import of geode-1.0.0.0-SNAPSHOT-2. All the new sub-project directories (like jvsd) were not imported. A diff was done to confirm that this commit is exactly the same as the open directory the snapsho X-Virus-Checked: Checked by ClamAV on apache.org http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java index 9dbee6c..d85d79b 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InitialImageOperation.java @@ -8,6 +8,8 @@ package com.gemstone.gemfire.internal.cache; +import static com.gemstone.gemfire.internal.offheap.annotations.OffHeapIdentifier.ABSTRACT_REGION_ENTRY_FILL_IN_VALUE; + import java.io.DataInput; import java.io.DataOutput; import java.io.Externalizable; @@ -84,6 +86,8 @@ import com.gemstone.gemfire.internal.logging.LogService; import com.gemstone.gemfire.internal.logging.LoggingThreadGroup; import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage; import com.gemstone.gemfire.internal.logging.log4j.LogMarker; +import com.gemstone.gemfire.internal.offheap.annotations.Released; +import com.gemstone.gemfire.internal.offheap.annotations.Retained; import com.gemstone.gemfire.internal.sequencelog.EntryLogger; import com.gemstone.gemfire.internal.sequencelog.RegionLogger; import com.gemstone.gemfire.internal.util.ObjectIntProcedure; @@ -919,8 +923,9 @@ public class InitialImageOperation { .create((byte[])tmpValue); } // dummy EntryEvent to pass for SQLF index maintenance - final EntryEventImpl ev = new EntryEventImpl(this.region, + final EntryEventImpl ev = EntryEventImpl.create(this.region, Operation.CREATE, null, null, null, true, null, false, false); + try { ev.setKeyInfo(this.region.getKeyInfo(entry.key, tmpValue, null)); ev.setNewValue(tmpValue); @@ -931,6 +936,9 @@ public class InitialImageOperation { indexUpdater.postEvent(this.region, ev, re, success); } + } finally { + ev.release(); + } } continue; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalCache.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalCache.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalCache.java index b305a48..7c1fa8e 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalCache.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalCache.java @@ -10,6 +10,8 @@ package com.gemstone.gemfire.internal.cache; import java.util.Collection; import com.gemstone.gemfire.cache.Cache; +import com.gemstone.gemfire.cache.hdfs.internal.HDFSStoreImpl; +import com.gemstone.gemfire.cache.hdfs.internal.hoplog.HDFSStoreDirector; import com.gemstone.gemfire.cache.query.internal.cq.CqService; import com.gemstone.gemfire.distributed.DistributedMember; @@ -33,4 +35,5 @@ public interface InternalCache extends Cache { public CqService getCqService(); + public Collection getHDFSStores() ; } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalDataView.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalDataView.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalDataView.java index 5684c71..2b10eaf 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalDataView.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalDataView.java @@ -19,6 +19,7 @@ import com.gemstone.gemfire.cache.Region.Entry; import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException; import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID; import com.gemstone.gemfire.internal.cache.tier.sockets.VersionedObjectList; +import com.gemstone.gemfire.internal.offheap.annotations.Retained; /** * @author Swapnil Bawaskar @@ -35,10 +36,13 @@ public interface InternalDataView { * @param preferCD * @param clientEvent TODO * @param returnTombstones TODO + * @param retainResult if true then the result may be a retained off-heap reference * @return the object associated with the key */ + @Retained Object getDeserializedValue(KeyInfo keyInfo, LocalRegion localRegion, - boolean updateStats, boolean disableCopyOnRead, boolean preferCD, EntryEventImpl clientEvent, boolean returnTombstones); + boolean updateStats, boolean disableCopyOnRead, boolean preferCD, EntryEventImpl clientEvent, + boolean returnTombstones, boolean allowReadFromHDFS, boolean retainResult); /** * @param event @@ -172,7 +176,7 @@ public interface InternalDataView { */ Object findObject(KeyInfo key, LocalRegion r, boolean isCreate, boolean generateCallbacks, Object value, boolean disableCopyOnRead, boolean preferCD, ClientProxyMembershipID requestingClient, - EntryEventImpl clientEvent, boolean returnTombstones); + EntryEventImpl clientEvent, boolean returnTombstones, boolean allowReadFromHDFS); /** @@ -219,7 +223,7 @@ public interface InternalDataView { * @param returnTombstones TODO * @return the serialized value from the cache */ - Object getSerializedValue(LocalRegion localRegion, KeyInfo key, boolean doNotLockEntry, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones) throws DataLocationException; + Object getSerializedValue(LocalRegion localRegion, KeyInfo key, boolean doNotLockEntry, ClientProxyMembershipID requestingClient, EntryEventImpl clientEvent, boolean returnTombstones, boolean allowReadFromHDFS) throws DataLocationException; abstract void checkSupportsRegionDestroy() throws UnsupportedOperationInTransactionException; abstract void checkSupportsRegionInvalidate() throws UnsupportedOperationInTransactionException; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java index 6616998..7c4d2e7 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InternalRegionArguments.java @@ -29,6 +29,7 @@ public final class InternalRegionArguments private boolean isUsedForPartitionedRegionAdmin; private boolean isUsedForSerialGatewaySenderQueue; private boolean isUsedForParallelGatewaySenderQueue; + private boolean isUsedForHDFSParallelGatewaySenderQueue = false; private int bucketRedundancy; private boolean isUsedForPartitionedRegionBucket; private RegionAdvisor partitionedRegionAdvisor; @@ -264,11 +265,26 @@ public final class InternalRegionArguments this.isUsedForParallelGatewaySenderQueue = queueFlag; return this; } - + public InternalRegionArguments setIsUsedForHDFSParallelGatewaySenderQueue( + boolean queueFlag) { + this.isUsedForHDFSParallelGatewaySenderQueue = queueFlag; + return this; + } + public boolean isUsedForParallelGatewaySenderQueue() { return this.isUsedForParallelGatewaySenderQueue; } + public boolean isUsedForHDFSParallelGatewaySenderQueue() { + return this.isUsedForHDFSParallelGatewaySenderQueue; + } + + public boolean isReadWriteHDFSRegion() { + return isUsedForPartitionedRegionBucket() + && getPartitionedRegion().getHDFSStoreName() != null + && !getPartitionedRegion().getHDFSWriteOnly(); + } + public InternalRegionArguments setParallelGatewaySender( AbstractGatewaySender pgSender) { this.parallelGatewaySender = pgSender; http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java index bf9659f..df5bf57 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/InvalidateOperation.java @@ -105,7 +105,7 @@ public class InvalidateOperation extends DistributedCacheOperation if (rgn.keyRequiresRegionContext()) { ((KeyWithRegionContext)this.key).setRegionContext(rgn); } - EntryEventImpl ev = new EntryEventImpl( + EntryEventImpl ev = EntryEventImpl.create( rgn, getOperation(), this.key, null, this.callbackArg, true, getSender()); ev.setEventId(this.eventId); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyInfo.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyInfo.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyInfo.java index cf02e77..c14f0a7 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyInfo.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/KeyInfo.java @@ -10,12 +10,19 @@ */ package com.gemstone.gemfire.internal.cache; +import static com.gemstone.gemfire.internal.offheap.annotations.OffHeapIdentifier.ENTRY_EVENT_NEW_VALUE; + +import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException; +import com.gemstone.gemfire.internal.i18n.LocalizedStrings; +import com.gemstone.gemfire.internal.offheap.annotations.Retained; +import com.gemstone.gemfire.internal.offheap.annotations.Unretained; + /** * @author sbawaska * @author rdubey * */ -public final class KeyInfo { +public class KeyInfo { // Rahul: This class should actually be renamed as RoutingInfo or BucketIdInfo // since that is exactly what an instance of this class is. @@ -29,6 +36,7 @@ public final class KeyInfo { // Rahul: The value field is add since Sqlf Partition resolver also relies on the value // part to calculate the routing object if the table is not partitioned on // primary key. + @Retained(ENTRY_EVENT_NEW_VALUE) private final Object value; public KeyInfo(Object key, Object value, Object callbackArg) { @@ -59,8 +67,9 @@ public final class KeyInfo { public final Object getCallbackArg() { return this.callbackArg; } - - public final Object getValue() { + + @Unretained(ENTRY_EVENT_NEW_VALUE) + public Object getValue() { return this.value; } @@ -83,4 +92,29 @@ public final class KeyInfo { public String toString() { return "(key="+key+",bucketId="+bucketId+")"; } -} + + /* + * For Distributed Join Purpose + */ + public boolean isCheckPrimary() + throws UnsupportedOperationInTransactionException { + return true; +// throw new UnsupportedOperationInTransactionException( +// LocalizedStrings.Dist_TX_PRECOMMIT_NOT_SUPPORTED_IN_A_TRANSACTION +// .toLocalizedString("isCheckPrimary")); + } + + /* + * For Distributed Join Purpose + */ + public void setCheckPrimary(boolean checkPrimary) + throws UnsupportedOperationInTransactionException { + throw new UnsupportedOperationInTransactionException( + LocalizedStrings.Dist_TX_PRECOMMIT_NOT_SUPPORTED_IN_A_TRANSACTION + .toLocalizedString("setCheckPrimary")); + } + + public boolean isDistKeyInfo() { + return false; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/31d1b20e/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ListOfDeltas.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ListOfDeltas.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ListOfDeltas.java index 93f9a3a..272952e 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ListOfDeltas.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/ListOfDeltas.java @@ -7,15 +7,13 @@ */ package com.gemstone.gemfire.internal.cache; - import java.util.ArrayList; import java.util.Collections; import java.util.List; -import com.gemstone.gemfire.internal.cache.delta.*; import com.gemstone.gemfire.InternalGemFireException; - import com.gemstone.gemfire.cache.EntryEvent; +import com.gemstone.gemfire.internal.cache.delta.Delta; /** @@ -27,6 +25,9 @@ public final class ListOfDeltas implements Delta { private List listOfDeltas; transient private int deltaAppliedIndex = 0; + public ListOfDeltas(final int size) { + this.listOfDeltas = new ArrayList(size); + } public ListOfDeltas(Delta deltaObj) { this.listOfDeltas = new ArrayList(); @@ -87,6 +88,5 @@ public final class ListOfDeltas implements Delta { public List getListOfDeltas() { return Collections.unmodifiableList(this.listOfDeltas); } - } -//SqlFabric changes END \ No newline at end of file +//SqlFabric changes END