geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [04/27] incubator-geode git commit: Removed BridgeWriter, BridgeWriterException, and BridgePoolImpl
Date Mon, 31 Aug 2015 23:14:00 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolManagerImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolManagerImpl.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolManagerImpl.java
index 289a3f5..25ba55d 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolManagerImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolManagerImpl.java
@@ -22,7 +22,6 @@ import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.client.internal.BridgePoolImpl;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterDataSerializersOp;
 import com.gemstone.gemfire.cache.client.internal.RegisterInstantiatorsOp;
@@ -102,24 +101,6 @@ public class PoolManagerImpl {
   }
   
   /**
-   * Set the keep alive flag before closing. Only for use with the deprecated
-   * BridgeWriter/Loader code. A BridgeWriter is automatically
-   * closed then the last region is disconnected from it,
-   * so we need to mark the connections as keep alive
-   * before we close the regions that use the bridge writer/loader
-   * 
-   * @param keepAlive
-   */
-  public static void setKeepAlive(boolean keepAlive) {
-    for(Iterator<Pool> itr = PoolManager.getAll().values().iterator(); itr.hasNext();
) {
-      Pool nextPool = itr.next();
-      if(nextPool instanceof BridgePoolImpl) {
-        BridgePoolImpl bridgePool = (BridgePoolImpl) nextPool;
-        bridgePool.setKeepAlive(keepAlive);
-      }
-    }
-  }
-  /**
    * Destroys all created pool in this manager.
    */
   public void close(boolean keepAlive) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/doc-files/properties.html
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/doc-files/properties.html
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/doc-files/properties.html
index 1922a3e..0dd2bae 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/doc-files/properties.html
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/doc-files/properties.html
@@ -3590,6 +3590,8 @@ TBA Is this class even used?
 <p>
 <em>Boolean</em> (default is false)
 <p>
+Removed in Geode 1.0 with removal of deprecated Bridge classes.
+<p>
 TBA 
 </dd>
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalFunctionService.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalFunctionService.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalFunctionService.java
index 9fe6f8e..1ef881c 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalFunctionService.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/InternalFunctionService.java
@@ -90,9 +90,7 @@ public class InternalFunctionService {
    */
   private static boolean isClientRegion(Region region) {
     LocalRegion localRegion = (LocalRegion)region;
-    return (localRegion.hasServerProxy()
-        || AbstractRegion
-        .isBridgeWriter(localRegion.getCacheWriter()));
+    return localRegion.hasServerProxy();
   }
 
   private static final FunctionServiceManager funcServiceManager = new FunctionServiceManager();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
index b9fcfe7..a394a90 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheCreation.java
@@ -52,7 +52,6 @@ import com.gemstone.gemfire.cache.asyncqueue.internal.AsyncEventQueueFactoryImpl
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.client.internal.BridgePoolImpl;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.execute.FunctionService;
 import com.gemstone.gemfire.cache.lucene.LuceneService;
@@ -680,10 +679,7 @@ public class CacheCreation implements InternalCache, Extensible<Cache>
{
         if (drc2 == null) {
           return false;
         }
-        if (!RegionAttributesCreation.equal(drc1.getDiskDir(), drc2.getDiskDir())) {
-          return false;
-        }
-        if (!RegionAttributesCreation.equal(drc1.getBridgeWriter(), drc2.getBridgeWriter()))
{
+        if (!drc1.equals(drc2)) {
           return false;
         }
       } else {
@@ -731,22 +727,22 @@ public class CacheCreation implements InternalCache, Extensible<Cache>
{
           : PoolManager.getAll();
         int m1Size = m1.size();
         {
-          // ignore any BridgePool instances
+          // ignore any gateway instances
           Iterator it1 = m1.values().iterator();
           while (it1.hasNext()) {
             Pool cp = (Pool)it1.next();
-            if (cp instanceof BridgePoolImpl || ((PoolImpl)cp).isUsedByGateway()) {
+            if (((PoolImpl)cp).isUsedByGateway()) {
               m1Size--;
             }
           }
         }
         int m2Size = m2.size();
         {
-          // ignore any BridgePool instances
+          // ignore any gateway instances
           Iterator it2 = m2.values().iterator();
           while (it2.hasNext()) {
             Pool cp = (Pool)it2.next();
-            if (cp instanceof BridgePoolImpl || ((PoolImpl)cp).isUsedByGateway()) {
+            if (((PoolImpl)cp).isUsedByGateway()) {
               m2Size--;
             }
           }
@@ -770,8 +766,8 @@ public class CacheCreation implements InternalCache, Extensible<Cache>
{
           Iterator it1 = m1.values().iterator();
           while (it1.hasNext()) {
             PoolImpl cp = (PoolImpl)it1.next();
-            // ignore any BridgePool instances
-            if (!(cp instanceof BridgePoolImpl) && !(cp).isUsedByGateway()) {
+            // ignore any gateway instances
+            if (!(cp).isUsedByGateway()) {
               cp.sameAs(m2.get(cp.getName()));
             }
           }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlGenerator.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlGenerator.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlGenerator.java
index f605887..ee4e0ae 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlGenerator.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlGenerator.java
@@ -85,7 +85,6 @@ import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
 import com.gemstone.gemfire.cache.client.Pool;
 import com.gemstone.gemfire.cache.client.PoolFactory;
 import com.gemstone.gemfire.cache.client.PoolManager;
-import com.gemstone.gemfire.cache.client.internal.BridgePoolImpl;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.execute.Function;
 import com.gemstone.gemfire.cache.execute.FunctionService;
@@ -95,7 +94,6 @@ import com.gemstone.gemfire.cache.query.internal.index.HashIndex;
 import com.gemstone.gemfire.cache.query.internal.index.PrimaryKeyIndex;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.server.ServerLoadProbe;
-import com.gemstone.gemfire.cache.util.BridgeWriter;
 import com.gemstone.gemfire.cache.util.ObjectSizer;
 import com.gemstone.gemfire.cache.wan.GatewayEventFilter;
 import com.gemstone.gemfire.cache.wan.GatewayReceiver;
@@ -1221,8 +1219,8 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader
{
     if (this.version.compareTo(CacheXmlVersion.VERSION_5_7) < 0) {
       return;
     }
-    if (cp instanceof BridgePoolImpl || ((PoolImpl)cp).isUsedByGateway()) {
-      // no need to generate xml for bridge pools
+    if (((PoolImpl)cp).isUsedByGateway()) {
+      // no need to generate xml for gateway pools
       return;
     }
     AttributesImpl atts = new AttributesImpl();
@@ -1387,12 +1385,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader
{
         handler.endElement("", DISK_DIR, DISK_DIR);
       }
     }
-    {
-      BridgeWriter bw = cfg.getBridgeWriter();
-      if (bw != null) {
-        generate(CACHE_WRITER, bw);
-      }
-    }
     handler.endElement("", DYNAMIC_REGION_FACTORY, DYNAMIC_REGION_FACTORY);
   }
 
@@ -2243,8 +2235,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader
{
     Properties props = null;
     if (callback instanceof Declarable2) {
       props = ((Declarable2) callback).getConfig();
-    } else if (callback instanceof BridgeWriter) {
-      props = ((BridgeWriter) callback).getProperties();
     } else if (callback instanceof ReflectionBasedAutoSerializer) {
       props = ((ReflectionBasedAutoSerializer) callback).getConfig();
     } else if (callback instanceof Declarable  && cache instanceof GemFireCacheImpl)
{

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlParser.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlParser.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlParser.java
index 9b2f5ed..f0b3612 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlParser.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/xmlcache/CacheXmlParser.java
@@ -85,7 +85,6 @@ import com.gemstone.gemfire.cache.query.internal.index.IndexCreationData;
 import com.gemstone.gemfire.cache.server.CacheServer;
 import com.gemstone.gemfire.cache.server.ClientSubscriptionConfig;
 import com.gemstone.gemfire.cache.server.ServerLoadProbe;
-import com.gemstone.gemfire.cache.util.BridgeWriter;
 import com.gemstone.gemfire.cache.util.ObjectSizer;
 import com.gemstone.gemfire.cache.wan.GatewayEventFilter;
 import com.gemstone.gemfire.cache.wan.GatewayEventSubstitutionFilter;
@@ -874,25 +873,10 @@ public class CacheXmlParser extends CacheXml implements ContentHandler
{
     String poolName = (String)stack.pop();
     String disableRegisterInterest = (String)stack.pop();
     String disablePersistBackup = (String)stack.pop();
-    CacheWriter cw = attrs.getCacheWriter();
-    if(poolName !=null && cw != null) {
-      throw new CacheXmlException("You cannot specify both a poolName and a cacheWriter for
a dynamic-region-factory.");
-    }
-    if (cw != null && !(cw instanceof BridgeWriter)) {
-      throw new CacheXmlException(LocalizedStrings.CacheXmlParser_THE_DYNAMICREGIONFACTORY_CACHEWRITER_MUST_BE_AN_INSTANCE_OF_BRIDGEWRITER.toLocalizedString());
-    }
     DynamicRegionFactory.Config cfg;
-    if(poolName != null) {
-      cfg =
-        new DynamicRegionFactory.Config(dir, poolName,
+    cfg = new DynamicRegionFactory.Config(dir, poolName,
             !Boolean.valueOf(disablePersistBackup).booleanValue(),
             !Boolean.valueOf(disableRegisterInterest).booleanValue());
-    } else {
-      cfg =
-        new DynamicRegionFactory.Config(dir, (BridgeWriter)cw,
-          !Boolean.valueOf(disablePersistBackup).booleanValue(),
-          !Boolean.valueOf(disableRegisterInterest).booleanValue());
-    }
     CacheCreation cache = (CacheCreation)stack.peek();
     cache.setDynamicRegionFactoryConfig(cfg);
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/ParentLocalizedStrings.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/ParentLocalizedStrings.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/ParentLocalizedStrings.java
index 0e551f1..274359e 100755
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/ParentLocalizedStrings.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/ParentLocalizedStrings.java
@@ -1625,7 +1625,7 @@ class ParentLocalizedStrings {
   public static final StringId DummyQRegion_NOT_YET_IMPLEMENTED = new StringIdImpl(2610,
"Not yet implemented");
   public static final StringId DumpB2NRegion_WAITED_TOO_LONG_FOR_REGION_TO_INITIALIZE_0 =
new StringIdImpl(2611, "Waited too long for region to initialize {0}");
   public static final StringId DynamicRegionFactory_DYNAMIC_REGION_0_HAS_NOT_BEEN_CREATED
= new StringIdImpl(2612, "Dynamic region \"{0}\" has not been created.");
-  public static final StringId DynamicRegionFactory_THE_CLIENT_POOL_OF_A_DYNAMICREGIONFACTORY_MUST_BE_CONFIGURED_WITH_ESTABLISHCALLBACKCONNECTION_SET_TO_TRUE
= new StringIdImpl(2613, "The client pool of a DynamicRegionFactory must be configured with
establishCallbackConnection set to true.");
+  // ok to reuse 2613
   public static final StringId ElderState_CANNOT_FORCE_GRANTOR_RECOVERY_FOR_GRANTOR_THAT_IS_TRANSFERRING
= new StringIdImpl(2614, "Cannot force grantor recovery for grantor that is transferring");
   public static final StringId EndpointImpl_0_ALL_EXISTING_CONNECTIONS_TO_THIS_SERVER_ARE_IN_USE
= new StringIdImpl(2615, "{0} : all existing connections to this server are in use");
   public static final StringId EndpointImpl_0_THE_CACHESERVER_HAS_DIED_UNEXPECTEDLY = new
StringIdImpl(2616, "{0} : The CacheServer has died unexpectedly");

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/cache/ClientHelper.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/ClientHelper.java b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/ClientHelper.java
index 29c3d41..c961159 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache/ClientHelper.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache/ClientHelper.java
@@ -14,7 +14,6 @@ import java.util.Set;
 import com.gemstone.gemfire.cache.DynamicRegionFactory.Config;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.ServerProxy;
-import com.gemstone.gemfire.cache.util.BridgeWriter;
 import com.gemstone.gemfire.internal.cache.LocalRegion;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
index f7aabf4..96cbb4a 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml41DUnitTest.java
@@ -548,7 +548,6 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
     assertEquals(true, DynamicRegionFactory.get().getConfig().getPersistBackup());
     assertEquals(true, DynamicRegionFactory.get().isOpen());
     assertEquals(null, DynamicRegionFactory.get().getConfig().getDiskDir());
-    assertEquals(null, DynamicRegionFactory.get().getConfig().getBridgeWriter());
     Region dr = getCache().getRegion("__DynamicRegions");    
     if(dr != null) {
         dr.localDestroyRegion();      
@@ -557,7 +556,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
   }
   public void testDynamicRegionFactoryNonDefault() throws CacheException {
     CacheCreation cache = new CacheCreation();
-    cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config((File)null, (com.gemstone.gemfire.cache.util.BridgeWriter)null,
false, false));
+    cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config((File)null, null,
false, false));
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
     cache.createRegion("root", attrs);
     // note that testXml can't check if they are same because enabling
@@ -567,7 +566,6 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
     assertEquals(false, DynamicRegionFactory.get().getConfig().getPersistBackup());
     assertEquals(true, DynamicRegionFactory.get().isOpen());
     assertEquals(null, DynamicRegionFactory.get().getConfig().getDiskDir());
-    assertEquals(null, DynamicRegionFactory.get().getConfig().getBridgeWriter());    
     Region dr = getCache().getRegion("__DynamicRegions");    
     if(dr != null) {
         dr.localDestroyRegion();      
@@ -582,7 +580,7 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
     CacheCreation cache = new CacheCreation();
     File f = new File("diskDir");
     f.mkdirs();
-    cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config(f, null));
+    cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config(f, null, true, true));
     RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
     cache.createRegion("root", attrs);
     // note that testXml can't check if they are same because enabling
@@ -590,28 +588,11 @@ public class CacheXml41DUnitTest extends CacheXml40DUnitTest
     testXml(cache, false);
     assertEquals(true, DynamicRegionFactory.get().isOpen());
     assertEquals(f.getAbsoluteFile(), DynamicRegionFactory.get().getConfig().getDiskDir());
-    assertEquals(null, DynamicRegionFactory.get().getConfig().getBridgeWriter());
     Region dr =getCache().getRegion("__DynamicRegions");    
     if(dr != null) {
         dr.localDestroyRegion();      
     }
   }
-  /**
-   * disabled test because it can only be done from a bridge client cache.
-   */
-  public void _testDynamicRegionFactoryCacheWriter() throws CacheException {
-    CacheCreation cache = new CacheCreation();
-    CacheWriter writer = new MyTestCacheWriter();
-    cache.setDynamicRegionFactoryConfig(new DynamicRegionFactory.Config(null, (com.gemstone.gemfire.cache.util.BridgeWriter)writer));
-    RegionAttributesCreation attrs = new RegionAttributesCreation(cache);
-    cache.createRegion("root", attrs);
-    // note that testXml can't check if they are same because enabling
-    // dynamic regions causes a meta region to be produced.
-    testXml(cache, false);
-    assertEquals(true, DynamicRegionFactory.get().isOpen());
-    assertEquals(null, DynamicRegionFactory.get().getConfig().getDiskDir());
-    assertEquals(writer, DynamicRegionFactory.get().getConfig().getBridgeWriter());
-  }
 
   /**
    * Remove this override when bug #52052 is fixed.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
index 37cf277..85fcf2f 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/cache30/CacheXml57DUnitTest.java
@@ -376,7 +376,6 @@ public class CacheXml57DUnitTest extends CacheXml55DUnitTest
     assertEquals(false, DynamicRegionFactory.get().getConfig().getPersistBackup());
     assertEquals(true, DynamicRegionFactory.get().isOpen());
     assertEquals(null, DynamicRegionFactory.get().getConfig().getDiskDir());
-    assertEquals(null, DynamicRegionFactory.get().getConfig().getBridgeWriter());
     assertEquals("connectionPool", DynamicRegionFactory.get().getConfig().getPoolName());
     Region dr = getCache().getRegion("__DynamicRegions");    
     if(dr != null) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BridgeWriterMiscDUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BridgeWriterMiscDUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BridgeWriterMiscDUnitTest.java
index cbf732f..18636eb 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BridgeWriterMiscDUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/BridgeWriterMiscDUnitTest.java
@@ -23,7 +23,6 @@ import com.gemstone.gemfire.cache.client.internal.Connection;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker;
 import com.gemstone.gemfire.cache.util.BridgeServer;
-import com.gemstone.gemfire.cache.util.BridgeWriterException;
 import com.gemstone.gemfire.cache30.CacheSerializableRunnable;
 import com.gemstone.gemfire.cache30.CacheTestCase;
 import com.gemstone.gemfire.cache30.LRUEvictionControllerDUnitTest;
@@ -749,8 +748,6 @@ public class BridgeWriterMiscDUnitTest extends CacheTestCase
     }
     catch(IllegalStateException expected) {
     }
-    catch (BridgeWriterException expected) {
-    }
     catch (DistributedSystemDisconnectedException expected) {
     } 
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java
index db5a5f2..c8fe2e6 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java
@@ -31,8 +31,10 @@ import com.gemstone.gemfire.cache.EntryEvent;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.RegionAttributes;
 import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.client.internal.BridgePoolImpl;
+import com.gemstone.gemfire.cache.client.PoolFactory;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.Connection;
+import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.PutOp;
 import com.gemstone.gemfire.cache.client.internal.QueueStateImpl.SequenceIdAndExpirationObject;
 import com.gemstone.gemfire.cache.util.BridgeServer;
@@ -64,7 +66,7 @@ public class ConnectionProxyJUnitTest
 
   Cache cache;
 
-  BridgePoolImpl proxy = null;
+  PoolImpl proxy = null;
   
   SequenceIdAndExpirationObject seo = null;
   
@@ -100,7 +102,7 @@ public class ConnectionProxyJUnitTest
     
     this.system.disconnect();
     if (proxy != null)
-      proxy.close();
+      proxy.destroy();
   }
 
   /**
@@ -131,16 +133,18 @@ public class ConnectionProxyJUnitTest
       fail("Failed to create server");
     }
     try {
-      Properties props = new Properties();
-      props.setProperty("retryAttempts", "1");
-      props.setProperty("endpoints", "ep1=localhost:"+port3);
-      props.setProperty("establishCallbackConnection", "false");
-      props.setProperty("LBPolicy", "Sticky");
-      props.setProperty("readTimeout", "2000");
-      props.setProperty("socketBufferSize", "32768");
-      props.setProperty("retryInterval", "10000");
-      props.setProperty("connectionsPerServer", "2");
-      props.setProperty("redundancyLevel", "-1");
+      PoolFactory pf = PoolManager.createFactory();
+      pf.addServer("localhost", port3);
+      pf.setSubscriptionEnabled(false);
+      pf.setSubscriptionRedundancy(-1);
+      pf.setReadTimeout(2000);
+      pf.setThreadLocalConnections(true);
+      pf.setSocketBufferSize(32768);
+      pf.setRetryAttempts(1);
+      pf.setPingInterval(10000);
+      
+      proxy = (PoolImpl) pf.create("clientPool");
+
       AttributesFactory factory = new AttributesFactory();
       factory.setScope(Scope.DISTRIBUTED_ACK);
       factory.setCacheListener(new CacheListenerAdapter() {
@@ -156,8 +160,6 @@ public class ConnectionProxyJUnitTest
           }
         }
       });
-      proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
-
       RegionAttributes attrs = factory.create();
       testRegion = cache.createRegion("testregion", attrs);
 
@@ -200,17 +202,17 @@ public class ConnectionProxyJUnitTest
     
 //    final int maxWaitTime = 10000;    
     try {
-      Properties props = new Properties();
-      props.setProperty("retryAttempts", "1");
-      props.setProperty("endpoints", "ep1=localhost:"+port3);
-      props.setProperty("establishCallbackConnection", "false");
-      props.setProperty("LBPolicy", "Sticky");
-      props.setProperty("readTimeout", "2000");
-      props.setProperty("socketBufferSize", "32768");
-      props.setProperty("retryInterval", "500");
-      props.setProperty("connectionsPerServer", "1");
+      PoolFactory pf = PoolManager.createFactory();
+      pf.addServer("localhost", port3);
+      pf.setSubscriptionEnabled(false);
+      pf.setReadTimeout(2000);
+      pf.setThreadLocalConnections(true);
+      pf.setMinConnections(1);
+      pf.setSocketBufferSize(32768);
+      pf.setRetryAttempts(1);
+      pf.setPingInterval(500);
       
-      proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+      proxy = (PoolImpl) pf.create("clientPool");
     }catch (Exception ex) {
       ex.printStackTrace();
       fail("Failed to initialize client");
@@ -272,16 +274,16 @@ public class ConnectionProxyJUnitTest
     
 //    final int maxWaitTime = 10000;    
     try {
-      Properties props = new Properties();
-      props.setProperty("retryAttempts", "1");
-      props.setProperty("endpoints", "ep1=localhost:"+port3);
-      props.setProperty("establishCallbackConnection", "false");
-      props.setProperty("LBPolicy", "Sticky");
-      props.setProperty("readTimeout", "2000");
-      props.setProperty("socketBufferSize", "32768");
-      props.setProperty("retryInterval", "500");
-      props.setProperty("connectionsPerServer", "1");
-      proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);      
+      PoolFactory pf = PoolManager.createFactory();
+      pf.addServer("localhost", port3);
+      pf.setSubscriptionEnabled(false);
+      pf.setReadTimeout(2000);
+      pf.setThreadLocalConnections(true);
+      pf.setMinConnections(1);
+      pf.setSocketBufferSize(32768);
+      pf.setRetryAttempts(1);
+      pf.setPingInterval(500);
+      proxy = (PoolImpl) pf.create("clientPool");
     }catch (Exception ex) {
       ex.printStackTrace();
       fail("Failed to initialize client");
@@ -337,11 +339,11 @@ public class ConnectionProxyJUnitTest
       fail("Failed to create server");
     }
     try {
-      Properties props = new Properties();
-      props.setProperty("endpoints", "ep1=localhost:" + port3);
-      props.setProperty("establishCallbackConnection", "true");
-      props.setProperty("redundancyLevel", "-1");
-      proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+      PoolFactory pf = PoolManager.createFactory();
+      pf.addServer("localhost", port3);
+      pf.setSubscriptionEnabled(true);
+      pf.setSubscriptionRedundancy(-1);
+      proxy = (PoolImpl) pf.create("clientPool");
       if (proxy.getThreadIdToSequenceIdMap() == null) {
         fail(" ThreadIdToSequenceIdMap is null. ");
       }
@@ -381,14 +383,13 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port3);
-     props.setProperty("redundancyLevel", "-1");
-     props.setProperty("clientAckInterval", "2000");
-     props.setProperty("messageTrackingTimeout", "4000");
-     props.setProperty("establishCallbackConnection", "true");
-     
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port3);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(-1);
+     pf.setSubscriptionMessageTrackingTimeout(4000);
+     pf.setSubscriptionAckInterval(2000);
+     proxy = (PoolImpl) pf.create("clientPool");
 
      EventID eid = new EventID(new byte[0],1,1);
      if(proxy.verifyIfDuplicate(eid)){
@@ -432,12 +433,13 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port3);
-     props.setProperty("establishCallbackConnection", "true");
-     props.setProperty("redundancyLevel", "-1");
-     props.setProperty("messageTrackingTimeout", "10000");
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port3);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(-1);
+     pf.setSubscriptionMessageTrackingTimeout(10000);
+     
+     proxy = (PoolImpl) pf.create("clientPool");
 
      final EventID eid = new EventID(new byte[0],1,1);
      if(proxy.verifyIfDuplicate(eid)){
@@ -483,14 +485,14 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port3);
-     props.setProperty("redundancyLevel", "-1");
-     props.setProperty("clientAckInterval", "2000");
-     props.setProperty("messageTrackingTimeout", "5000");
-     props.setProperty("establishCallbackConnection", "true");
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port3);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(-1);
+     pf.setSubscriptionMessageTrackingTimeout(5000);
+     pf.setSubscriptionAckInterval(2000);
+     proxy = (PoolImpl) pf.create("clientPool");
      
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
      final int EVENT_ID_COUNT = 10000; // why 10,000?
      EventID[] eid = new EventID[EVENT_ID_COUNT];
      for (int i = 0; i < EVENT_ID_COUNT; i++) {
@@ -538,12 +540,13 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port3);
-     props.setProperty("establishCallbackConnection", "true");
-     props.setProperty("redundancyLevel", "-1");
-     props.setProperty("messageTrackingTimeout", "100000");
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port3);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(-1);
+     pf.setSubscriptionMessageTrackingTimeout(100000);
+     proxy = (PoolImpl) pf.create("clientPool");
+     
      EventID eid1 = new EventID(new byte[0],1,5);
      if(proxy.verifyIfDuplicate(eid1)){
        fail(" eid1 can never be duplicate, it is being created for the first time! ");
@@ -562,7 +565,7 @@ public class ConnectionProxyJUnitTest
      }
 
      assertTrue(!proxy.getThreadIdToSequenceIdMap().isEmpty());
-     proxy.close();
+     proxy.destroy();
    }
    catch (Exception ex) {
      ex.printStackTrace();
@@ -596,12 +599,13 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port3);
-     props.setProperty("establishCallbackConnection", "true");
-     props.setProperty("redundancyLevel", "-1");
-     props.setProperty("messageTrackingTimeout", "100000");
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port3);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(-1);
+     pf.setSubscriptionMessageTrackingTimeout(100000);
+     proxy = (PoolImpl) pf.create("clientPool");
+     
      EventID eid1 = new EventID(new byte[0],1,2);
      if(proxy.verifyIfDuplicate(eid1)){
          fail(" eid can never be duplicate, it is being created for the first time! ");
@@ -653,22 +657,28 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port3);
-     props.setProperty("establishCallbackConnection", "true");
-     props.setProperty("redundancyLevel", "-1");
-     props.setProperty("messageTrackingTimeout", "100000");
-     BridgePoolImpl proxy1 = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
-     BridgePoolImpl proxy2 = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port3);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(-1);
+     pf.setSubscriptionMessageTrackingTimeout(100000);
+     
+     PoolImpl proxy1 = (PoolImpl) pf.create("clientPool1");
+     try {
+     PoolImpl proxy2 = (PoolImpl) pf.create("clientPool2");
+     try {
 
      Map map1 = proxy1.getThreadIdToSequenceIdMap();
      Map map2 = proxy2.getThreadIdToSequenceIdMap();
 
      assertTrue(!(map1==map2));
 
-      // Close the proxies to remove them from the set of all proxies
-     proxy1.close();
-     proxy2.close();
+     } finally {
+       proxy2.destroy();
+     }
+     } finally {
+       proxy1.destroy();
+     }
     }
    catch (Exception ex) {
      ex.printStackTrace();
@@ -698,15 +708,15 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port);
-     props.setProperty("establishCallbackConnection", "true");
-     props.setProperty("redundancyLevel", "1");
-     props.setProperty("readTimeout", "20000");
-     props.setProperty("messageTrackingTimeout", "15000");
-     props.setProperty("clientAckInterval", "5000");
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(1);
+     pf.setReadTimeout(20000);
+     pf.setSubscriptionMessageTrackingTimeout(15000);
+     pf.setSubscriptionAckInterval(5000);
      
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);   
+     proxy = (PoolImpl) pf.create("clientPool");
      
      EventID eid = new EventID(new byte[0],1,1);
      
@@ -769,14 +779,15 @@ public class ConnectionProxyJUnitTest
      fail("Failed to create server");
    }
    try {
-     Properties props = new Properties();
-     props.setProperty("endpoints", "ep1=localhost:"+port);     
-     props.setProperty("readTimeout", "20000");
-     props.setProperty("messageTrackingTimeout", "8000");
-     props.setProperty("clientAckInterval", "2000");
-     props.setProperty("establishCallbackConnection", "true");
+     PoolFactory pf = PoolManager.createFactory();
+     pf.addServer("localhost", port);
+     pf.setSubscriptionEnabled(true);
+     pf.setSubscriptionRedundancy(1);
+     pf.setReadTimeout(20000);
+     pf.setSubscriptionMessageTrackingTimeout(8000);
+     pf.setSubscriptionAckInterval(2000);
      
-     proxy = BridgePoolImpl.create(props, true/*useByBridgeWriter*/);     
+     proxy = (PoolImpl) pf.create("clientPool");
      
      EventID eid = new EventID(new byte[0],1,1);
      

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
index c448511..5efc349 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.java
@@ -21,7 +21,7 @@ import com.gemstone.gemfire.cache.Cache;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.cache.client.Pool;
-import com.gemstone.gemfire.cache.util.BridgeWriter;
+import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.tier.ConnectionProxy;
@@ -114,16 +114,14 @@ public class RedundancyLevelJUnitTest
         assertNotNull("cache was null", cache);
         Region region = cache.getRegion("/root/exampleRegion");
         assertNotNull(region);
-        BridgeWriter writer = (BridgeWriter)region.getAttributes()
-            .getCacheWriter();
-        Pool pool = (Pool)writer.getConnectionProxy();
+        Pool pool = PoolManager.find("clientPool");
         assertEquals(
             "Redundancy level not matching the one specified in cache-xml", 6,
             pool.getSubscriptionRedundancy());
       } finally {
         final String removeExpected =
           "<ExpectedException action=remove>" + expected + "</ExpectedException>";
-        cache.getLogger().info(removeExpected);
+        system.getLogWriter().info(removeExpected);
       }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index 6f2dfae..6722c72 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -25,7 +25,6 @@ import com.gemstone.gemfire.cache.client.PoolManager;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.client.internal.RegisterInterestTracker;
 import com.gemstone.gemfire.cache.util.BridgeServer;
-import com.gemstone.gemfire.cache.util.BridgeWriter;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.ServerLocation;
 import com.gemstone.gemfire.internal.AvailablePort;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d102cd86/gemfire-core/src/test/resources/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.xml
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/resources/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.xml
b/gemfire-core/src/test/resources/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.xml
index 4e884d5..38ad448 100644
--- a/gemfire-core/src/test/resources/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.xml
+++ b/gemfire-core/src/test/resources/com/gemstone/gemfire/internal/cache/tier/sockets/RedundancyLevelJUnitTest.xml
@@ -6,25 +6,16 @@
 -->
 
 <!DOCTYPE cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 5.0//EN"
-  "http://www.gemstone.com/dtd/cache5_0.dtd">
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 8.0//EN"
+  "http://www.gemstone.com/dtd/cache8_0.dtd">
 <cache>
+  <pool name="clientPool" subscription-enabled="true" subscription-redundancy="6">
+    <server host="localhost" port="30303"/>
+  </pool>
   <region name="root">
     <region-attributes/> 
     <region name="exampleRegion">
-      <region-attributes scope="distributed-ack">
-        <cache-writer>
-          <class-name>com.gemstone.gemfire.cache.util.BridgeWriter</class-name>
-          <parameter name="endpoints">
-            <string>server=localhost:30303</string>
-          </parameter>
-          <parameter name="establishCallbackConnection">
-            <string>true</string>
-          </parameter>
-          <parameter name="redundancyLevel">
-            <string>6</string>
-          </parameter>          
-        </cache-writer>
+      <region-attributes scope="distributed-ack" pool-name="clientPool">
       </region-attributes>
     </region>
   </region>



Mime
View raw message