geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [06/51] [partial] incubator-geode git commit: SGA #2
Date Fri, 03 Jul 2015 19:21:07 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1709e627/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/1709e627/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<HDFSStoreImpl> getHDFSStores() ;
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/1709e627/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/1709e627/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/1709e627/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/1709e627/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/1709e627/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<Delta> listOfDeltas;
   transient private int deltaAppliedIndex = 0;
+  public ListOfDeltas(final int size) {
+    this.listOfDeltas = new ArrayList<Delta>(size);
+  }
 
   public ListOfDeltas(Delta deltaObj) {
     this.listOfDeltas = new ArrayList<Delta>();
@@ -87,6 +88,5 @@ public final class ListOfDeltas implements Delta {
   public List<Delta> getListOfDeltas() {
     return Collections.unmodifiableList(this.listOfDeltas);
   }
-
 }
-//SqlFabric changes END
\ No newline at end of file
+//SqlFabric changes END


Mime
View raw message