You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2019/10/03 20:52:48 UTC

[geode] 04/11: GEODE-7126: Refactoring API names to be more consistent.

This is an automated email from the ASF dual-hosted git repository.

jensdeppe pushed a commit to branch release/1.9.2
in repository https://gitbox.apache.org/repos/asf/geode.git

commit cdbb3df32d2a3e58d83a23f20e1a1d18d10b54ca
Author: nabarun <na...@cs.wisc.edu>
AuthorDate: Wed Sep 4 15:03:42 2019 -0700

    GEODE-7126: Refactoring API names to be more consistent.
    
    	* Names changed to be more consistent
    	* Modified the comments explaining the APIs
---
 .../wan/asyncqueue/AsyncEventQueuePausedDUnitTest.java     |  2 +-
 .../asyncqueue/AsyncEventQueueValidationsJUnitTest.java    |  7 +++----
 .../geode/cache/asyncqueue/AsyncEventQueueFactory.java     |  2 +-
 .../asyncqueue/internal/AsyncEventQueueFactoryImpl.java    | 14 +++++++-------
 .../geode/internal/cache/xmlcache/CacheCreation.java       |  2 +-
 .../geode/internal/cache/xmlcache/CacheXmlParser.java      |  2 +-
 .../internal/AsyncEventQueueFactoryImplTest.java           |  4 ++--
 .../org/apache/geode/cache/configuration/CacheConfig.java  |  5 +++--
 8 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueuePausedDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueuePausedDUnitTest.java
index 385afca..62e9c38 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueuePausedDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueuePausedDUnitTest.java
@@ -167,7 +167,7 @@ public class AsyncEventQueuePausedDUnitTest implements Serializable {
   private static void createRegionAndDispatchingPausedAEQ(AEQandRegionProperties props) {
     Cache cache = ClusterStartupRule.getCache();
     cache.createAsyncEventQueueFactory()
-        .pauseEventDispatchingToListener()
+        .pauseEventDispatching()
         .setParallel(props.isParallel())
         .setPersistent(isPersistent(props))
         .create("aeqID", new MyAsyncEventListener());
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
index 44fb069..1c323d8 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventQueueValidationsJUnitTest.java
@@ -82,10 +82,11 @@ public class AsyncEventQueueValidationsJUnitTest {
     cache = new CacheFactory().set(MCAST_PORT, "0").create();
     AsyncEventQueueFactory fact = cache.createAsyncEventQueueFactory()
         .setParallel(isParallel)
-        .pauseEventDispatchingToListener()
+        .pauseEventDispatching()
         .setDispatcherThreads(5);
     AsyncEventQueue aeq =
         fact.create("aeqID", new org.apache.geode.internal.cache.wan.MyAsyncEventListener());
+    assertTrue(aeq.isDispatchingPaused());
     assertTrue(((AsyncEventQueueImpl) aeq).getSender().isPaused());
   }
 
@@ -95,12 +96,10 @@ public class AsyncEventQueueValidationsJUnitTest {
     cache = new CacheFactory().set(MCAST_PORT, "0").create();
     AsyncEventQueueFactory fact = cache.createAsyncEventQueueFactory()
         .setParallel(isParallel)
-        .pauseEventDispatchingToListener()
+        .pauseEventDispatching()
         .setDispatcherThreads(5);
     AsyncEventQueue aeq =
         fact.create("aeqID", new org.apache.geode.internal.cache.wan.MyAsyncEventListener());
-    assertTrue(aeq.isDispatchingPaused());
-    assertTrue(((AsyncEventQueueImpl) aeq).getSender().isPaused());
 
     aeq.resumeEventDispatching();
 
diff --git a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/AsyncEventQueueFactory.java b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/AsyncEventQueueFactory.java
index 1a5145e..9a5236d 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/AsyncEventQueueFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/AsyncEventQueueFactory.java
@@ -153,7 +153,7 @@ public interface AsyncEventQueueFactory {
    * Pauses the dispatching of the queued events to the listener.
    *
    */
-  AsyncEventQueueFactory pauseEventDispatchingToListener();
+  AsyncEventQueueFactory pauseEventDispatching();
 
   /**
    * Creates the <code>AsyncEventQueue</code>. It accepts Id of AsyncEventQueue and instance of
diff --git a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImpl.java b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImpl.java
index 26f29ee..2c18476 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImpl.java
@@ -47,7 +47,7 @@ public class AsyncEventQueueFactoryImpl implements AsyncEventQueueFactory {
 
   private final InternalCache cache;
 
-  private boolean pauseEventsDispatchingToListener = false;
+  private boolean pauseEventsDispatching = false;
 
   /**
    * Used internally to pass the attributes from this factory to the real GatewaySender it is
@@ -162,7 +162,7 @@ public class AsyncEventQueueFactoryImpl implements AsyncEventQueueFactory {
     if (cache instanceof CacheCreation) {
       asyncEventQueue =
           new AsyncEventQueueCreation(asyncQueueId, gatewaySenderAttributes, listener);
-      if (pauseEventsDispatchingToListener) {
+      if (pauseEventsDispatching) {
         ((AsyncEventQueueCreation) asyncEventQueue).setPauseEventDispatching(true);
       }
       ((CacheCreation) cache).addAsyncEventQueue(asyncEventQueue);
@@ -177,7 +177,7 @@ public class AsyncEventQueueFactoryImpl implements AsyncEventQueueFactory {
       AsyncEventQueueImpl asyncEventQueueImpl = new AsyncEventQueueImpl(sender, listener);
       asyncEventQueue = asyncEventQueueImpl;
       cache.addAsyncEventQueue(asyncEventQueueImpl);
-      if (pauseEventsDispatchingToListener) {
+      if (pauseEventsDispatching) {
         sender.setStartEventProcessorInPausedState();
       }
       if (!gatewaySenderAttributes.isManualStart()) {
@@ -278,13 +278,13 @@ public class AsyncEventQueueFactoryImpl implements AsyncEventQueueFactory {
   }
 
   @Override
-  public AsyncEventQueueFactory pauseEventDispatchingToListener() {
-    pauseEventsDispatchingToListener = true;
+  public AsyncEventQueueFactory pauseEventDispatching() {
+    pauseEventsDispatching = true;
     return this;
   }
 
   @VisibleForTesting
-  protected boolean isPauseEventsDispatchingToListener() {
-    return pauseEventsDispatchingToListener;
+  protected boolean isPauseEventsDispatching() {
+    return pauseEventsDispatching;
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
index 2803a97..8253e0f 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
@@ -554,7 +554,7 @@ public class CacheCreation implements InternalCache {
           (AsyncEventQueueFactoryImpl) cache.createAsyncEventQueueFactory();
       asyncQueueFactory.configureAsyncEventQueue(asyncEventQueueCreation);
       if (asyncEventQueueCreation.isDispatchingPaused()) {
-        asyncQueueFactory.pauseEventDispatchingToListener();
+        asyncQueueFactory.pauseEventDispatching();
       }
 
       AsyncEventQueue asyncEventQueue = cache.getAsyncEventQueue(asyncEventQueueCreation.getId());
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
index 03b1987..958a1de 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
@@ -2369,7 +2369,7 @@ public class CacheXmlParser extends CacheXml implements ContentHandler {
       factory.addGatewayEventFilter(gatewayEventFilter);
     }
     if (asyncEventChannelCreation.isDispatchingPaused()) {
-      factory.pauseEventDispatchingToListener();
+      factory.pauseEventDispatching();
     }
     factory.setGatewayEventSubstitutionListener(
         asyncEventChannelCreation.getGatewayEventSubstitutionFilter());
diff --git a/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImplTest.java b/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImplTest.java
index 9535782..3c80634 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImplTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/AsyncEventQueueFactoryImplTest.java
@@ -47,9 +47,9 @@ public class AsyncEventQueueFactoryImplTest {
   @Test
   public void whenAsyncEventQueueIsStartedInPausedStateThenSenderMustBePaused() {
     asyncEventQueueFactory = new AsyncEventQueueFactoryImpl(cache);
-    asyncEventQueueFactory.pauseEventDispatchingToListener();
+    asyncEventQueueFactory.pauseEventDispatching();
     assertTrue(
-        ((AsyncEventQueueFactoryImpl) asyncEventQueueFactory).isPauseEventsDispatchingToListener());
+        ((AsyncEventQueueFactoryImpl) asyncEventQueueFactory).isPauseEventsDispatching());
   }
 
   /**
diff --git a/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java b/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
index de039f5..cb5fe12 100644
--- a/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
+++ b/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
@@ -1146,7 +1146,7 @@ public class CacheConfig {
     protected Boolean pauseEventProcessing;
 
     /**
-     * Gets the value of whether the processing of the events queued is paused or not
+     * Gets the value of whether the queue was created with paused processing of the events queued
      *
      *
      * @return {@link Boolean} - true if queue will be created with paused processing of the events
@@ -1159,7 +1159,8 @@ public class CacheConfig {
     }
 
     /**
-     * Sets the value of whether the processing of the events queued is paused or not
+     * Sets the value of whether the queue will be created with paused processing of the events
+     * queued
      *
      * @param pauseEventProcessing {@link Boolean} - true if queue will be created with paused
      *        processing of the events queued