geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adon...@apache.org
Subject geode git commit: GEODE-254: Addressing review comments from PR #488 Replacing all inststance of entries with entrySet
Date Fri, 12 May 2017 01:32:16 GMT
Repository: geode
Updated Branches:
  refs/heads/develop f88141cfc -> dc198bd3d


GEODE-254: Addressing review comments from PR #488 Replacing all inststance of entries with
entrySet

GEODE-254: Fixing the Test Failures
 - Removed test testIndexMaintenanceWithIndexOnMethodEntries since this is no more applicable.

GEODE-254: Spotless fixing.
This closes #504

Signed-off-by: adongre <adongre@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/dc198bd3
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/dc198bd3
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/dc198bd3

Branch: refs/heads/develop
Commit: dc198bd3d35b0a3f5339683ce7a25add6584a147
Parents: f88141c
Author: adongre <adongre@apache.org>
Authored: Wed May 10 00:34:14 2017 +0530
Committer: adongre <adongre@apache.org>
Committed: Fri May 12 06:50:05 2017 +0530

----------------------------------------------------------------------
 .../cache/client/internal/ProxyRegion.java      | 15 +-------------
 .../geode/cache/query/internal/QRegion.java     |  2 +-
 .../query/internal/index/DummyQRegion.java      |  2 +-
 .../internal/admin/remote/AdminRegion.java      | 11 ++--------
 .../geode/internal/cache/AbstractRegion.java    |  6 ------
 .../geode/internal/cache/LocalDataSet.java      |  9 +++------
 .../geode/internal/cache/LocalRegion.java       | 12 +++++------
 .../geode/internal/cache/PartitionedRegion.java |  4 ++--
 .../geode/internal/cache/ha/HARegionQueue.java  |  2 +-
 .../index/IndexMaintenanceJUnitTest.java        | 21 --------------------
 .../internal/cache/AbstractRegionJUnitTest.java |  2 +-
 .../internal/cache/ha/HAGIIBugDUnitTest.java    |  2 +-
 .../cache/ha/HARQAddOperationJUnitTest.java     |  2 +-
 13 files changed, 20 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
index 659adc9..e35750b 100755
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ProxyRegion.java
@@ -184,15 +184,6 @@ public class ProxyRegion implements Region {
     }
   }
 
-  public Set entries(boolean recursive) {
-    try {
-      preOp();
-      return this.realRegion.entrySet(recursive);
-    } finally {
-      postOp();
-    }
-  }
-
   public Set entrySet(boolean recursive) {
     try {
       preOp();
@@ -372,10 +363,6 @@ public class ProxyRegion implements Region {
     return this.realRegion.isEmpty();
   }
 
-  public Set keySet() {
-    return this.realRegion.keySet();
-  }
-
   public Set keySetOnServer() {
     try {
       preOp();
@@ -385,7 +372,7 @@ public class ProxyRegion implements Region {
     }
   }
 
-  public Set keys() {
+  public Set keySet() {
     try {
       preOp();
       return this.realRegion.keySet();

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/cache/query/internal/QRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QRegion.java b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QRegion.java
index cccb1f8..5f0d6e5 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/QRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/QRegion.java
@@ -320,7 +320,7 @@ public class QRegion implements SelectResults {
     this.region.destroyRegion(aCallbackArgument);
   }
 
-  public Set entries(boolean recursive) {
+  public Set entrySet(boolean recursive) {
     return this.region.entrySet(recursive);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/DummyQRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/DummyQRegion.java
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/DummyQRegion.java
index 2b16686..c87cfdc 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/DummyQRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/index/DummyQRegion.java
@@ -217,7 +217,7 @@ public class DummyQRegion extends QRegion {
   }
 
   @Override
-  public Set entries(boolean recursive) {
+  public Set entrySet(boolean recursive) {
     return (ResultsSet) getEntries();
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
index 6999bb1..51f1fdb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/AdminRegion.java
@@ -252,7 +252,8 @@ public class AdminRegion implements Region {
     throw new UnsupportedOperationException();
   }
 
-  public Set keys() {
+  @Override
+  public Set keySet() {
     try {
       ObjectNamesResponse resp = (ObjectNamesResponse) sendAndWait(ObjectNamesRequest.create());
       return resp.getNameSet();
@@ -265,10 +266,6 @@ public class AdminRegion implements Region {
     throw new UnsupportedOperationException();
   }
 
-  public Set entries(boolean recursive) {
-    throw new UnsupportedOperationException();
-  }
-
   public Cache getCache() {
     throw new UnsupportedOperationException();
   }
@@ -522,10 +519,6 @@ public class AdminRegion implements Region {
     throw new UnsupportedOperationException();
   }
 
-  public Set keySet() {
-    throw new UnsupportedOperationException();
-  }
-
   public Object remove(Object arg0) {
     throw new UnsupportedOperationException();
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
index e0a8f6c..4a6ddb1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
@@ -1698,12 +1698,6 @@ public abstract class AbstractRegion implements Region, RegionAttributes,
Attrib
     return result.iterator().next();
   }
 
-  public Set entrySet(boolean recursive) {
-    return entries(recursive);
-  }
-
-  public abstract Set entries(boolean recursive);
-
   public EvictionAttributes getEvictionAttributes() {
     return this.evictionAttributes;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/internal/cache/LocalDataSet.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalDataSet.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalDataSet.java
index 248d655..a1e6a01 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalDataSet.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalDataSet.java
@@ -83,16 +83,13 @@ public class LocalDataSet implements Region, QueryExecutor {
     this.buckets = buckets;
   }
 
+  @Override
   public Set<Region.Entry> entrySet(boolean recursive) {
-    return entries(recursive);
+    return this.proxy.entrySet(getBucketSet());
   }
 
   public Set<Region.Entry> entrySet() {
-    return entries(false);
-  }
-
-  public Set<Region.Entry> entries(boolean recursive) {
-    return this.proxy.entries(getBucketSet());
+    return entrySet(false);
   }
 
   public Collection values() {

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 81d97b4..e8daa18 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -1888,7 +1888,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
     return new SubregionsSet(recursive);
   }
 
-  public Set entries(boolean recursive) {
+  public Set entrySet(boolean recursive) {
     checkReadiness();
     checkForNoAccess();
     return basicEntries(recursive);
@@ -3724,7 +3724,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
     DataOutputStream out = new DataOutputStream(outputStream);
     try {
       out.writeByte(SNAPSHOT_VERSION);
-      for (Iterator itr = entries(false).iterator(); itr.hasNext();) {
+      for (Iterator itr = entrySet(false).iterator(); itr.hasNext();) {
         Region.Entry entry = (Region.Entry) itr.next();
         try {
           Object key = entry.getKey();
@@ -4255,7 +4255,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
    * @see #registerInterest(Object)
    */
   private void clearViaList(List keys) {
-    for (Iterator it = this.entries(false).iterator(); it.hasNext();) {
+    for (Iterator it = this.entrySet(false).iterator(); it.hasNext();) {
       Region.Entry entry = (Region.Entry) it.next();
       try {
         Object entryKey = entry.getKey();
@@ -4286,7 +4286,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   private void clearViaRegEx(String key) {
     // @todo: if (key.equals(".*)) then cmnClearRegionNoCallbacks
     Pattern keyPattern = Pattern.compile(key);
-    for (Iterator it = this.entries(false).iterator(); it.hasNext();) {
+    for (Iterator it = this.entrySet(false).iterator(); it.hasNext();) {
       Region.Entry entry = (Region.Entry) it.next();
       try {
         Object entryKey = entry.getKey();
@@ -4323,7 +4323,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
           LocalizedStrings.LocalRegion_CLASS_0_COULD_NOT_BE_INSTANTIATED.toLocalizedString(key),
e);
     }
 
-    for (Iterator it = this.entries(false).iterator(); it.hasNext();) {
+    for (Iterator it = this.entrySet(false).iterator(); it.hasNext();) {
       Region.Entry entry = (Region.Entry) it.next();
       try {
         Object entryKey = entry.getKey();
@@ -9211,7 +9211,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
    */
   public Set entrySet() {
     // entries(false) takes care of open transactions
-    return entries(false);
+    return entrySet(false);
   }
 
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 7d0e7bb..9b6732e 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -6039,12 +6039,12 @@ public class PartitionedRegion extends LocalRegion
    *         OVERRIDES
    */
   @Override
-  public Set entries(boolean recursive) {
+  public Set entrySet(boolean recursive) {
     checkReadiness();
     return Collections.unmodifiableSet(new PREntriesSet());
   }
 
-  public Set<Region.Entry> entries(Set<Integer> bucketIds) {
+  public Set<Region.Entry> entrySet(Set<Integer> bucketIds) {
     return new PREntriesSet(bucketIds);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java
index 538df2c..39fbe75 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java
@@ -432,7 +432,7 @@ public class HARegionQueue implements RegionQueue {
    * @throws InterruptedException
    */
   void putGIIDataInRegion() throws CacheException, InterruptedException {
-    Set entrySet = this.region.entries(false);
+    Set entrySet = this.region.entrySet(false);
     // check if the region is not empty. if there is
     // data, then the relevant data structures have to
     // be populated

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexMaintenanceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexMaintenanceJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexMaintenanceJUnitTest.java
index 3f4b304..dd47559 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexMaintenanceJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/query/internal/index/IndexMaintenanceJUnitTest.java
@@ -482,27 +482,6 @@ public class IndexMaintenanceJUnitTest {
   }
 
   /**
-   * Tests Index maintenance on method entries(boolean ) as iterator ( with focus on behaviour
if
-   * not implemented in DummyQRegion
-   */
-  @Test
-  public void testIndexMaintenanceWithIndexOnMethodEntries() {
-    try {
-      Index i1 = qs.createIndex("indx1", IndexType.FUNCTIONAL, "entries.value.getID",
-          "/portfolio.entries(false) entries");
-      CacheUtils.getCache();
-      region = CacheUtils.getRegion("/portfolio");
-      region.put("4", new Portfolio(4));
-      region.put("5", new Portfolio(5));
-      CompactRangeIndex ri = (CompactRangeIndex) i1;
-      validateIndexForEntries(ri);
-    } catch (Exception e) {
-      CacheUtils.getLogger().error(e);
-      fail(e.toString());
-    }
-  }
-
-  /**
    * Tests Index maintenance on method getEntries( ) as iterator ( with focus on behaviour
if not
    * implemented in DummyQRegion
    */

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
index dd766a4..aed1f00 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/AbstractRegionJUnitTest.java
@@ -215,7 +215,7 @@ public class AbstractRegionJUnitTest {
     }
 
     @Override
-    public Set entries(boolean recursive) {
+    public Set entrySet(boolean recursive) {
       throw new UnsupportedOperationException();
     }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
index 27777e1..3b759cc 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HAGIIBugDUnitTest.java
@@ -233,7 +233,7 @@ public class HAGIIBugDUnitTest extends JUnit4DistributedTestCase {
     HARegion regionForQueue = (HARegion) cache.getRegion(
         Region.SEPARATOR + HARegionQueue.createRegionName(HAExpiryDUnitTest.regionQueueName));
     LogWriterUtils.getLogWriter().info("Region Queue size : " + regionForQueue.keys().size());
-    Iterator itr = regionForQueue.entries(false).iterator();
+    Iterator itr = regionForQueue.entrySet(false).iterator();
     while (itr.hasNext()) {
       Entry entry = (Entry) itr.next();
       if (entry.getKey() instanceof Long) {

http://git-wip-us.apache.org/repos/asf/geode/blob/dc198bd3/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
index 5fb0295..699f8cd 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/ha/HARQAddOperationJUnitTest.java
@@ -290,7 +290,7 @@ public class HARQAddOperationJUnitTest {
       // After the expiry of the data , AvaialbleIds size should be 0,
       // entry
       // removed from Region, LastDispatchedWrapperSet should have size 0.
-      assertEquals(0, regionqueue.getRegion().entries(false).size());
+      assertEquals(0, regionqueue.getRegion().entrySet(false).size());
       assertEquals(0, regionqueue.getAvalaibleIds().size());
       assertNull(regionqueue.getCurrentCounterSet(id1));
 


Mime
View raw message