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 1323318ABA for ; Mon, 12 Oct 2015 18:44:05 +0000 (UTC) Received: (qmail 23583 invoked by uid 500); 12 Oct 2015 18:43:55 -0000 Delivered-To: apmail-geode-commits-archive@geode.apache.org Received: (qmail 23550 invoked by uid 500); 12 Oct 2015 18:43:55 -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 23541 invoked by uid 99); 12 Oct 2015 18:43:55 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2015 18:43:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id F321F1A0A92 for ; Mon, 12 Oct 2015 18:43:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.781 X-Spam-Level: * X-Spam-Status: No, score=1.781 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_FILL_THIS_FORM_SHORT=0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id amubZudELjzX for ; Mon, 12 Oct 2015 18:43:41 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id CB6E02AB19 for ; Mon, 12 Oct 2015 18:43:32 +0000 (UTC) Received: (qmail 21871 invoked by uid 99); 12 Oct 2015 18:43:30 -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; Mon, 12 Oct 2015 18:43:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 3BFECE054B; Mon, 12 Oct 2015 18:43:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: klund@apache.org To: commits@geode.incubator.apache.org Date: Mon, 12 Oct 2015 18:43:52 -0000 Message-Id: <26a5e7e11d4445f79874b6f35c21e348@git.apache.org> In-Reply-To: <49906dac1bc543caa46ff50d46ed22a2@git.apache.org> References: <49906dac1bc543caa46ff50d46ed22a2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [24/30] incubator-geode git commit: GEODE-243: remove deprecated Bridge feature http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterDataSerializersOp.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterDataSerializersOp.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterDataSerializersOp.java index c3ab84b..d06107d 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterDataSerializersOp.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterDataSerializersOp.java @@ -12,8 +12,8 @@ import java.io.IOException; import com.gemstone.gemfire.DataSerializer; import com.gemstone.gemfire.SerializationException; import com.gemstone.gemfire.internal.InternalDataSerializer.SerializerAttributesHolder; -import com.gemstone.gemfire.internal.cache.BridgeObserver; -import com.gemstone.gemfire.internal.cache.BridgeObserverHolder; +import com.gemstone.gemfire.internal.cache.ClientServerObserver; +import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; import com.gemstone.gemfire.internal.cache.EventID; import com.gemstone.gemfire.internal.cache.tier.MessageType; import com.gemstone.gemfire.internal.cache.tier.sockets.Message; @@ -61,7 +61,7 @@ public class RegisterDataSerializersOp { getMessage().addBytesPart(eventId.calcBytes()); // // CALLBACK FOR TESTING PURPOSE ONLY //// if (PoolImpl.IS_INSTANTIATOR_CALLBACK) { - BridgeObserver bo = BridgeObserverHolder.getInstance(); + ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.beforeSendingToServer(eventId); } } @@ -85,7 +85,7 @@ public class RegisterDataSerializersOp { getMessage().addBytesPart(eventId.calcBytes()); // // CALLBACK FOR TESTING PURPOSE ONLY //// if (PoolImpl.IS_INSTANTIATOR_CALLBACK) { - BridgeObserver bo = BridgeObserverHolder.getInstance(); + ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.beforeSendingToServer(eventId); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterInstantiatorsOp.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterInstantiatorsOp.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterInstantiatorsOp.java index f3c9f03..8e7515d 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterInstantiatorsOp.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/RegisterInstantiatorsOp.java @@ -12,8 +12,8 @@ import java.io.IOException; import com.gemstone.gemfire.Instantiator; import com.gemstone.gemfire.SerializationException; import com.gemstone.gemfire.internal.InternalInstantiator.InstantiatorAttributesHolder; -import com.gemstone.gemfire.internal.cache.BridgeObserver; -import com.gemstone.gemfire.internal.cache.BridgeObserverHolder; +import com.gemstone.gemfire.internal.cache.ClientServerObserver; +import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; import com.gemstone.gemfire.internal.cache.EventID; import com.gemstone.gemfire.internal.cache.tier.MessageType; import com.gemstone.gemfire.internal.cache.tier.sockets.Message; @@ -87,7 +87,7 @@ public class RegisterInstantiatorsOp { getMessage().addBytesPart(eventId.calcBytes()); // // // CALLBACK FOR TESTING PURPOSE ONLY //// if (PoolImpl.IS_INSTANTIATOR_CALLBACK) { - BridgeObserver bo = BridgeObserverHolder.getInstance(); + ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.beforeSendingToServer(eventId); } } @@ -128,7 +128,7 @@ public class RegisterInstantiatorsOp { getMessage().addBytesPart(eventId.calcBytes()); // // // CALLBACK FOR TESTING PURPOSE ONLY //// if (PoolImpl.IS_INSTANTIATOR_CALLBACK) { - BridgeObserver bo = BridgeObserverHolder.getInstance(); + ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.beforeSendingToServer(eventId); } } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java index 7670ef9..b10a38b 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/internal/ServerRegionProxy.java @@ -27,13 +27,10 @@ import com.gemstone.gemfire.cache.client.PoolManager; import com.gemstone.gemfire.cache.client.internal.ContainsKeyOp.MODE; import com.gemstone.gemfire.cache.execute.Function; import com.gemstone.gemfire.cache.execute.ResultCollector; -import com.gemstone.gemfire.cache.util.BridgeClient; -import com.gemstone.gemfire.cache.util.BridgeLoader; -import com.gemstone.gemfire.cache.util.BridgeWriter; import com.gemstone.gemfire.distributed.internal.ServerLocation; import com.gemstone.gemfire.internal.cache.AbstractRegion; -import com.gemstone.gemfire.internal.cache.BridgeObserver; -import com.gemstone.gemfire.internal.cache.BridgeObserverHolder; +import com.gemstone.gemfire.internal.cache.ClientServerObserver; +import com.gemstone.gemfire.internal.cache.ClientServerObserverHolder; import com.gemstone.gemfire.internal.cache.EntryEventImpl; import com.gemstone.gemfire.internal.cache.EventID; import com.gemstone.gemfire.internal.cache.LocalRegion; @@ -87,37 +84,8 @@ public class ServerRegionProxy extends ServerProxy implements ServerRegionDataAc private static InternalPool calcPool(Region r) { String poolName = r.getAttributes().getPoolName(); if (poolName == null || "".equals(poolName)) { - final CacheLoader cl = r.getAttributes().getCacheLoader(); - final CacheWriter cw = r.getAttributes().getCacheWriter(); - if (AbstractRegion.isBridgeLoader(cl) || AbstractRegion.isBridgeWriter(cw)) { - Object loaderPool = null; - Object writerPool = null; - if (AbstractRegion.isBridgeLoader(cl)) { - if (cl instanceof BridgeLoader) { - loaderPool = ((BridgeLoader)cl).getConnectionProxy(); - } else { - loaderPool = ((BridgeClient)cl).getConnectionProxy(); - } - } - if (AbstractRegion.isBridgeWriter(cw)) { - writerPool = ((BridgeWriter)cw).getConnectionProxy(); - } - if (loaderPool != writerPool && loaderPool != null && writerPool != null) { - throw new IllegalStateException("The region " + r.getFullPath() - + " has a BridgeLoader and a BridgeWriter/BridgeClient " - + " that are configured with different connection pools. " - + " This is not allowed. Instead create a single BridgeClient and install it as both the loader and the writer." - + " loaderPool="+loaderPool + " writerPool=" + writerPool); - } - InternalPool result = (InternalPool)loaderPool; - if (result == null) { - result = (InternalPool)writerPool; - } - return result; - } else { - throw new IllegalStateException("The region " + r.getFullPath() - + " did not have a client pool configured."); - } + throw new IllegalStateException("The region " + r.getFullPath() + + " did not have a client pool configured."); } else { InternalPool pool = (InternalPool)PoolManager.find(poolName); if (pool == null) { @@ -400,7 +368,7 @@ public class ServerRegionProxy extends ServerProxy implements ServerRegionDataAc interestType, policy, isDurable, receiveUpdatesAsInvalidates, regionDataPolicy); //////// TEST PURPOSE ONLY /////////// if (PoolImpl.AFTER_REGISTER_CALLBACK_FLAG) { - BridgeObserver bo = BridgeObserverHolder.getInstance(); + ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.afterInterestRegistration(); } ///////////////////////////////////////// @@ -594,7 +562,7 @@ public class ServerRegionProxy extends ServerProxy implements ServerRegionDataAc finished = true; //////// TEST PURPOSE ONLY /////////// if (PoolImpl.AFTER_REGISTER_CALLBACK_FLAG) { - BridgeObserver bo = BridgeObserverHolder.getInstance(); + ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.afterInterestRegistration(); } ///////////////////////////////////////// http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/execute/internal/FunctionServiceManager.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/execute/internal/FunctionServiceManager.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/execute/internal/FunctionServiceManager.java index afb8b05..af73acc 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/execute/internal/FunctionServiceManager.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/execute/internal/FunctionServiceManager.java @@ -422,8 +422,7 @@ public final class FunctionServiceManager { */ private final boolean isClientRegion(Region region) { LocalRegion localRegion = (LocalRegion) region; - return (localRegion.hasServerProxy() || AbstractRegion.isBridgeLoader(localRegion.getCacheLoader()) || AbstractRegion - .isBridgeWriter(localRegion.getCacheWriter())); + return localRegion.hasServerProxy(); } http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerLoadProbe.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerLoadProbe.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerLoadProbe.java index de67c9b..f6e802f 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerLoadProbe.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerLoadProbe.java @@ -11,8 +11,8 @@ import com.gemstone.gemfire.cache.CacheCallback; /** - * A load probe is installed in a bridge server to measure the load on the - * bridge server for balancing load between multiple bridge servers. + * A load probe is installed in a cache server to measure the load on the + * cache server for balancing load between multiple cache servers. * *

* The getLoad method will be called once per poll interval see @@ -37,7 +37,7 @@ import com.gemstone.gemfire.cache.CacheCallback; * Because cache servers can be stopped, reconfigured, and restarted, the open * and close methods on this callback can be called several times. If the same * callback object is installed on multiple cache servers, open and close will - * be called once for each bridge server. + * be called once for each cache server. *

* * @author dsmith @@ -53,13 +53,13 @@ public interface ServerLoadProbe extends CacheCallback { */ ServerLoad getLoad(ServerMetrics metrics); - /** Signals that a bridge server + /** Signals that a cache server * using this load probe has been started. */ void open(); /** - * Signals that a bridge server + * Signals that a cache server * using this load probe has been closed. */ void close(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerMetrics.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerMetrics.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerMetrics.java index eb977aa..d4559c8 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerMetrics.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/ServerMetrics.java @@ -9,7 +9,7 @@ package com.gemstone.gemfire.cache.server; /** - * Metrics about the resource usage for a bridge server. + * Metrics about the resource usage for a cache server. * These metrics are provided to the {@link ServerLoadProbe} for * use in calculating the load on the server. * @author dsmith @@ -19,23 +19,23 @@ package com.gemstone.gemfire.cache.server; public interface ServerMetrics { /** * Get the number of open connections - * for this bridge server. + * for this cache server. */ int getConnectionCount(); /** Get the number of clients connected to this - * bridge server. + * cache server. */ int getClientCount(); /** * Get the number of client subscription connections hosted on this - * bridge server. + * cache server. */ int getSubscriptionConnectionCount(); /** - * Get the max connections for this bridge server. + * Get the max connections for this cache server. */ int getMaxConnections(); http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/internal/LoadMonitor.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/internal/LoadMonitor.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/internal/LoadMonitor.java index 6210f60..129ba2c 100644 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/internal/LoadMonitor.java +++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/server/internal/LoadMonitor.java @@ -14,12 +14,12 @@ import org.apache.logging.log4j.Logger; import com.gemstone.gemfire.CancelException; import com.gemstone.gemfire.SystemFailure; -import com.gemstone.gemfire.cache.client.internal.BridgeServerLoadMessage; +import com.gemstone.gemfire.cache.client.internal.CacheServerLoadMessage; import com.gemstone.gemfire.cache.server.ServerLoad; import com.gemstone.gemfire.cache.server.ServerLoadProbe; import com.gemstone.gemfire.distributed.internal.ServerLocation; import com.gemstone.gemfire.distributed.internal.membership.MembershipManager; -import com.gemstone.gemfire.internal.cache.BridgeServerAdvisor; +import com.gemstone.gemfire.internal.cache.CacheServerAdvisor; import com.gemstone.gemfire.internal.cache.tier.Acceptor; import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerStats; import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID; @@ -41,14 +41,14 @@ public class LoadMonitor implements ConnectionListener { private final ServerLoadProbe probe; private final ServerMetricsImpl metrics; - protected final BridgeServerAdvisor advisor; + protected final CacheServerAdvisor advisor; protected ServerLocation location; private final PollingThread pollingThread; protected volatile ServerLoad lastLoad; protected CacheServerStats stats; public LoadMonitor(ServerLoadProbe probe, int maxConnections, - long pollInterval, int forceUpdateFrequency, BridgeServerAdvisor advisor) { + long pollInterval, int forceUpdateFrequency, CacheServerAdvisor advisor) { this.probe = probe; this.metrics = new ServerMetricsImpl(maxConnections); this.pollingThread = new PollingThread(pollInterval, forceUpdateFrequency); @@ -195,8 +195,8 @@ public class LoadMonitor implements ConnectionListener { stats.setLoad(load); if (locators != null) { - BridgeServerLoadMessage message = - new BridgeServerLoadMessage(load, location, myClientIds); + CacheServerLoadMessage message = + new CacheServerLoadMessage(load, location, myClientIds); message.setRecipients(locators); MembershipManager mgr = advisor.getDistributionManager().getMembershipManager(); if (mgr == null || !mgr.isBeingSick()) { // test hook http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeClient.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeClient.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeClient.java deleted file mode 100644 index 184e8bc..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeClient.java +++ /dev/null @@ -1,156 +0,0 @@ -/*========================================================================= - * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * one or more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ -package com.gemstone.gemfire.cache.util; - -import java.util.Properties; - -import com.gemstone.gemfire.SystemFailure; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.CacheLoader; -import com.gemstone.gemfire.cache.CacheLoaderException; -import com.gemstone.gemfire.cache.CacheWriter; -import com.gemstone.gemfire.cache.LoaderHelper; -import com.gemstone.gemfire.cache.Region; - -/** - * This class combines the BridgeWriter and BridgeLoader functionality into one - * class, sharing BridgeServer connections, optimizing the number - * of connections required when using a BridgeWriter and BridgeLoader separately. - *

- * When a BridgeClient is declared in cache.xml - * it can be installed as either a cache-loader or as a cache-writer - * and it will automatically be installed as both the loader and writer - * for that region. - * This allows a single instance to be declared in XML and used as both - * the cache-loader and cache-writer thus reducing the number of connections to the server. - * - *

- * For configuration details please see the {@link com.gemstone.gemfire.cache.util.BridgeWriter} and - * the {@link com.gemstone.gemfire.cache.util.BridgeLoader}. - * - * @author Mitch Thomas - * @since 5.0.1 - * @see com.gemstone.gemfire.cache.util.BridgeLoader - * @see com.gemstone.gemfire.cache.util.BridgeWriter - * @see com.gemstone.gemfire.cache.util.BridgeServer - * @deprecated as of 5.7 use {@link com.gemstone.gemfire.cache.client pools} instead. - */ -@Deprecated -public class BridgeClient extends BridgeWriter implements CacheLoader -{ - - private final BridgeLoader loader = new BridgeLoader(); - - public Object load(LoaderHelper helper) throws CacheLoaderException - { - return this.loader.load(helper); - } - - /** - * Ensure that the BridgeLoader class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - BridgeLoader.loadEmergencyClasses(); - } - - @Override - public void close() - { - try { - this.loader.close(); - } finally { - super.close(); - } - } - - /** - * Returns true if this BridgeClient has been closed. - */ - @Override - public boolean isClosed() { - return super.isClosed(); - } - - /** - * Notify the BridgeClient that the given Region will begin delivering events to this BridgeClient. - * This method effects the behavior of {@link #close()} and allows a single instance of BridgeClient - * to be safely shared with multiple Regions. - * - * This is called internally when the BridgeClient is added to a Region - * via {@link AttributesFactory#setCacheWriter(CacheWriter)}} - * - * @param r - * the Region which will begin use this BridgeWriter. - * - * @see #detach(Region) - * @see #close() - */ - @Override - public void attach(Region r) - { - try { - this.loader.attach(r); - } finally { - super.attach(r); - } - } - - /** - * Notify the BridgeClient that the given region is no longer relevant. - * This method is used internally during Region {@link Region#destroyRegion() destruction} and {@link Region#close() closure}. - * This method effects the behavor of {@link #close()} and allows a single instance of BridgeClient - * to be safely shared with multiple Regions. - * - * @see #attach(Region) - * @see #close() - * @param r - * the Region which will no longer use this BridgeWriter - */ - @Override - public void detach(Region r) - { - try { - this.loader.detach(r); - } finally { - super.detach(r); - } - } - - @Override - public void init(BridgeWriter bridgeWriter) - { - super.init(bridgeWriter); - this.loader.init(this); - } - - @Override - public void init(Properties p) - { - super.init(p); - this.loader.init(this); - } - - /** - * Return the internally maintained BridgeLoader - * @return the internal BridgeLoader - */ - public BridgeLoader getBridgeLoader() { - return this.loader; - } - - /** - * Returns a string description of the BridgeClient - */ - @Override - public String toString() - { - return "BridgeClient#" + System.identityHashCode(this) + " connected to " + this.proxy; - } -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeLoader.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeLoader.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeLoader.java deleted file mode 100644 index 58c5862..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeLoader.java +++ /dev/null @@ -1,607 +0,0 @@ -/*========================================================================= - * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * one or more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ -package com.gemstone.gemfire.cache.util; - -import java.util.Properties; -import java.util.concurrent.atomic.AtomicInteger; - -import com.gemstone.gemfire.SystemFailure; -import com.gemstone.gemfire.cache.AttributesFactory; -import com.gemstone.gemfire.cache.AttributesMutator; -import com.gemstone.gemfire.cache.Cache; -import com.gemstone.gemfire.cache.CacheLoader; -import com.gemstone.gemfire.cache.CacheLoaderException; -import com.gemstone.gemfire.cache.Declarable; -import com.gemstone.gemfire.cache.LoaderHelper; -import com.gemstone.gemfire.cache.Region; -import com.gemstone.gemfire.cache.client.internal.BridgePoolImpl; -import com.gemstone.gemfire.cache.client.internal.ServerProxy; -import com.gemstone.gemfire.cache.query.SelectResults; -import com.gemstone.gemfire.internal.cache.tier.ConnectionProxy; -import com.gemstone.gemfire.internal.i18n.LocalizedStrings; - -/** - * A CacheLoader that loads data from one or more remote - * cacheserver processes. This allows for a hierarchical caching - * scheme in which one cache ('client' cache) delegates a request to another - * cache ('server' cache) when it cannot find the data locally. - * - * - * When using the BridgeLoader, at least two GemFire Caches must - * be running in a client/server mode (they should not be part of the same - * distributed system). - * - * The 'server' cache must be running a gemfire cacheserver - * process, while the 'client' cache must have a BridgeLoader - * installed in one or more of its Regions. If a - * BridgeLoader is defined in a client Region, - * there must also be a Region defined in the 'server' cache with - * the same exact name. - * - *

- * - * The BridgeLoader performs get() operations on - * the remote server cache, and does not provide the distribution behavior that - * can be enabled by using a DISTRIBUTED or - * DISTRIBUTED_NO_ACK Region. This mechanism is - * designed as a more targeted alternative to netSearch, in which the 'client' - * cache completely delegates the loading of the data to the 'server' cache if - * it is not yet cached in the client. This directed behavior enables a remote - * network get() operation to be performed much more efficiently - * in a scenario where there is a hierarchical cache topology. Updates and - * invalidation remain local, in fact the Regions that are used - * for this loosely coupled cache may even be LOCAL in scope. - * - * The BridgeLoader may be used to configure caches with - * multi-layer hierarchies. - * - * - *

- * Load Balancing: - *

- * The BridgeLoader supports these load balancing mechanisms - * (specified by the LBPolicy config attribute): - *

- *

    - *
  • Sticky
    - * In this mode, the client loader picks the first server from the list of - * servers and establishes a connection to it. Once this connection has been - * established, every request from that particular 'client' cache is sent on - * that connection. If requests time out or produce exceptions, the - * BridgeLoader picks another server and then sends further - * requests to that server. This achieves a level of load balancing by - * redirecting requests away from servers that produce timeouts.
  • - * - *
  • RandomSticky
    - * The behavior is the same as Sticky, however the initial assignment of the - * connection is randomly selected from the list of servers.
  • - * - *
  • RoundRobin
    - * In this mode, the client establishes connections to all the servers in the - * server list and then randomly picks a server for each given request. For the - * next request, it picks the next server in the list.
  • - * - *
  • Random :
    - * In this mode, the edge establishes connections to all the servers in the - * server list and then randomly picks a server for every request.
  • - * - * - *
- * - *

- * Failover: - *

- * - * If a remote server cache throws an exception or times out, the client will - * retry based on the configured retryCount parameter. If the - * retryCount is exceeded, the server in question will be added - * to a failed server list, and the client will select another server to connect - * to. The servers in the failed server list will be periodically pinged with an - * intelligent ping that ensures cache health. If a server is determined to be - * healthy again, it will be promoted back to the healthy server list. The time - * period between failed server pings is configurable via the - * retryInterval parameter. - * - *

- * Configuration: - *

- * The BridgeLoader is configurable declaratively or - * programmatically. Declarative configuration is achieved through defining the - * configuration parameters in a cache.xml file. Programmatic - * configuration may be achieved by first instantiating a - * BridgeLoader object and subsequently calling - * {@link #init(Properties)}with a Properties object containing - * each desired parameter and value. - *

- * The supported parameters are: - *

- *

    - *
  • endpoints (required)
    - * A comma delimited list of logical names, hostnames, and ports of 'server' - * caches to connect to
    - * The endpoints parameter follows this syntax: - * logicalName=host:port,logicalName2=host2:port2,....
    - * Example: - * - *
    - *
    - * <parameter name="endpoints">
    - *   <string>MyPrimaryServer=hostsrv:40404,MySecondary=hostsrv2:40404</string>
    - * </parameter>
    - * 
    - *
    - * - *
  • - *
  • readTimeout (optional: default 10000)
    - * A millisecond value representing the amount of time to wait for a response - * from a cache server.
    - * Example: - * - *
    - *
    - * <parameter name="readTimeout">
    - *   <string>5000</string>
    - * </parameter>
    - * 
    - *
    - *
  • - * - *
  • retryAttempts (optional: default 5)
    - * The number of times to retry a request after timeout/exception.
    - * Example: - * - *
    - *
    - * <parameter name="retryAttempts">
    - *   <string>5</string>
    - * </parameter>
    - * 
    - *
    - * - *
  • - *
  • retryInterval (optional: default 10000)
    - * A millisecond value representing the amount of time to wait between attempts - * by the ServerMonitor to ping living servers to verify that - * they are still alive and dead servers to verify that they are still dead. - *
    - * Example:
  • - * - *
    - *
    - * <parameter name="retryInterval">
    - *   <string>10000</string>
    - * </parameter>
    - * 
    - *
    - * - *
  • LBPolicy (optional: default "Sticky")
    - * A String value representing the load balancing policy to use. See above for - * more details.
    - * Options are: - *
      - *
    • "Sticky"
    • - *
    • "RandomSticky"
    • - *
    • "RoundRobin"
    • - *
    • "Random"
    • - *
    - * Example: - * - *
    - *
    - * <parameter name="LBPolicy">
    - *   <string>Sticky</string>
    - * </parameter>
    - * 
    - *
    - * - *
  • - *
  • connectionsPerServer (optional: default 1)
    - * The number of initial connections created to each time it is - * determined to be alive. - * The minimum of 0 causes no initial connections to be created (they are only created on demand). - *
    - * Example: - * - *
    - *
    - * <parameter name="connectionsPerServer">
    - *   <string>10</string>
    - * </parameter>
    - * 
    - *
    - * - *
  • - *
  • socketBufferSize (optional: default 32768)
    - * The size of the socket buffers in bytes.
    - * Example: - * - *
    - *
    - * <parameter name="socketBufferSize">
    - *   <string>32768</string>
    - * </parameter>
    - * 
    - *
    - * - *
  • - *
- * - *

- * - * If you are using a cache.xml file to create a - * Region declaratively, you can include the following - * <cache-loader> definition to associate a BridgeLoader - * with a Region (default values shown for optional parameters): - * - *

- * 
- * <cache-loader>
- *   <class-name>com.gemstone.gemfire.cache.util.BridgeLoader</class-name>
- *   <parameter name="endpoints">
- *     <string>MyHost=ninja.gemstone.com:40404</string>
- *   </parameter>
- *   <parameter name="readTimeout">
- *     <string>10000</string>
- *   </parameter>
- *   <parameter name="retryAttempts">
- *     <string>5</string>
- *   </parameter>
- *   <parameter name="retryInterval">
- *     <string>10000</string>
- *   </parameter>
- *   <parameter name="LBPolicy">
- *     <string>Sticky</string>
- *   </parameter>
- *   <parameter name="socketBufferSize">
- *     <string>32768</string>
- *   </parameter>
- *   </parameter>
- * </cache-loader>
- * 
- * - * @since 2.0.2 - * @author Greg Passmore - * @deprecated as of 5.7 use {@link com.gemstone.gemfire.cache.client pools} instead. - */ - -@Deprecated -public class BridgeLoader implements CacheLoader, Declarable -{ - ConnectionProxy proxy = null; // package access for - // tests/com/gemstone/gemfire/cache/util/BridgeHelper - - private Properties properties; - - public BridgeLoader() { } - - /** - * Creates a loader from an existing BridgeWriter. This - * method reuses the existing BridgeWriter's proxy. - * - * @param bw - * The existing BridgeWriter - * - * @since 5.7 - */ - public BridgeLoader(BridgeWriter bw) { - init(bw); - } - - private volatile boolean isClosed = false; - - private final AtomicInteger refCount = new AtomicInteger(); - - /** - * Initializes the loader with supplied config parameters. If instantiating - * the loader programmatically, this method must be called with a - * Properties object that at a minimum contains the 'endpoints' - * parameter before the loader can be used. If a LicenseException is thrown - * during initialization the BridgeLoader will trhow IllegalStateExceptions - * until properly initialized. - * - * @param p - * configuration data such as 'endpoint' definitions - * @throws IllegalStateException if the loader is already initialized - */ - public void init(Properties p) - { - if (this.proxy != null) throw new IllegalStateException(LocalizedStrings.BridgeLoader_ALREADY_INITIALIZED.toLocalizedString()); - this.properties = p; - if (Boolean.getBoolean("skipConnection")) { - // used by hydra when generating XML via RegionAttributesCreation - return; - } - this.proxy = BridgePoolImpl.create(properties, false/*useByBridgeWriter*/); - } - - /** - * Initializes this loader from an existing BridgeLoader. - * This method reuses the existing BridgeLoader's connections - * to the server. - * - * @param bridgeLoader The existing BridgeLoader - * @throws IllegalStateException if the loader is already initialized - * - * @since 4.2 - */ - public void init(BridgeLoader bridgeLoader) - { - if (this.proxy != null) throw new IllegalStateException(LocalizedStrings.BridgeLoader_ALREADY_INITIALIZED.toLocalizedString()); - ConnectionProxy p = bridgeLoader.proxy; - p.reuse(); - this.proxy = p; - } - - /** - * Initializes this loader from an existing BridgeWriter. This - * method reuses the existing BridgeWriter's proxy. - * - * @param bridgeWriter - * The existing BridgeWriter - * @throws IllegalStateException if the loader is already initialized - * - * @since 5.7 - */ - public void init(BridgeWriter bridgeWriter) - { - if (this.proxy != null) throw new IllegalStateException("Already initialized"); - ConnectionProxy p = bridgeWriter.proxy; - p.reuse(); - this.proxy = p; - } - - /** - * Ensure that the ConnectionProxyImpl class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - BridgePoolImpl.loadEmergencyClasses(); - } - - /** - * Called when the region containing this BridgeLoader is - * destroyed, when the {@link Cache}is closed, or when a callback is removed - * from a region using an {@link AttributesMutator} - * - * Closes connections to {@link BridgeServer}s when all {@link Region}s are - * finished using this BridgeLoader, - * - * @see #detach(Region) - * @see #attach(Region) - */ - public void close() { - if (this.refCount.get() <= 0) { - this.isClosed = true; - proxy.close(); - } - } - - /** - * Returns true if this BridgeLoader has been closed. - */ - public boolean isClosed() { - return this.isClosed; - } - - /** - * For speed optimizations, a connection to a server may be assigned to the - * calling thread when load is called. When the application thread is done - * doing its work it should invoke the BridgeLoader close method. This frees - * up the connection assigned to the application thread. - */ - public void release() - { - proxy.release(); - } - - /** - * This method should be invoked when the BridgeLoader mechanism is to be shut - * down explicitly , outside of closing the cache. - */ - public void terminate() - { - this.isClosed = true; - proxy.terminate(); - } - - // removed checkForTransaction - - /** - * This method is invoked implicitly when an object requested on the client - * cache cannot be found. The server cache will attempt to be contacted, and - * if no server cache is available (or healthy) a CacheLoaderException will - * be thrown. - * - */ - public Object load(LoaderHelper helper) throws CacheLoaderException - { - throw new IllegalStateException("this method should not be called"); - } - - private void checkClosed() { - String reason = this.proxy.getCancelCriterion().cancelInProgress(); - if(reason != null) { - throw new BridgeWriterException("The BridgeWriter has been closed: " + reason); - } - - if (this.isClosed) { - throw new CacheLoaderException(LocalizedStrings.BridgeLoader_THE_BRIDGELOADER_HAS_BEEN_CLOSED.toLocalizedString()); - } - if (this.proxy != null && !this.proxy.isOpen()) { - throw new CacheLoaderException(LocalizedStrings.BridgeLoader_THE_BRIDGELOADER_HAS_BEEN_CLOSED.toLocalizedString()); - } - } - - /** - * Invoke a query on the cache server. - * @deprecated use {@link Region#query} instead - */ - @Deprecated - public SelectResults query(String queryStr) throws CacheLoaderException { - ServerProxy sp = new ServerProxy((BridgePoolImpl)this.proxy); - return sp.query(queryStr, null); - } - - /** - * Returns the retry interval in use. Retry interval refers to the interval at - * which dead servers are attempted to be reconnected. Internal use only. - */ - public int getRetryInterval() - { - return proxy.getRetryInterval(); - } - - /** - * Returns the read timeout being used to time out requests to the server - * Internal use only. - */ - public int getReadTimeout() - { - return proxy.getReadTimeout(); - } - - /** - * Returns the number of times the bridge loader tries to get data on - * encountering certain types of exceptions. Internal use only - */ - public int getRetryAttempts() - { - return this.proxy.getRetryAttempts(); - } - - /** - * Returns the load balancing policy being used by the bridge loader Internal - * use only - */ - public String getLBPolicy() - { - return proxy.getLBPolicy(); - } - - /** - * Returns the properties that defined this BridgeWriter. - * - * @return the properties that defined this BridgeWriter - * - * @since 4.2 - */ - public Properties getProperties() - { - return this.properties; - } - - /** - * Returns the ConnectionProxy associated with this - * BridgeLoader. - * - * For internal use only. - * - * @return the ConnectionProxy associated with this - * BridgeLoader - */ - public Object/*ConnectionProxy*/ getConnectionProxy() - { - return proxy; - } - - /** - * Add an Endpoint to the known Endpoints. - * - * @param name The name of the endpoint to add - * @param host The host name or ip address of the endpoint to add - * @param port The port of the endpoint to add - * - * @throws EndpointExistsException if the Endpoint to be - * added already exists. - * - * @since 5.0.2 - */ - public void addEndpoint(String name, String host, int port) - throws EndpointExistsException { - this.proxy.addEndpoint(name, host, port); - } - - /** - * Remove an Endpoint from the dead Endpoints. - * The specified Endpoint must be dead. - * - * @param name The name of the endpoint to remove - * @param host The host name or ip address of the endpoint to remove - * @param port The port of the endpoint to remove - * - * @throws EndpointDoesNotExistException if the Endpoint to be - * removed doesn't exist. - * - * @throws EndpointInUseException if the Endpoint to be removed - * contains Connections - * - * @since 5.0.2 - */ - public void removeEndpoint(String name, String host, int port) - throws EndpointDoesNotExistException, EndpointInUseException { - this.proxy.removeEndpoint(name, host, port); - } - - // removed handleException - - // removed getExceptionMessage - - /** - * Returns a brief description of this BridgeLoader - * - * @since 4.0 - */ - @Override - public String toString() - { - return LocalizedStrings.BridgeLoader_BRIDGELOADER_CONNECTED_TO_0.toLocalizedString(this.proxy); - } - - /** - * Notify the BridgeLoader that the given region is no longer relevant. This - * method is used internally during Region - * {@link Region#destroyRegion() destruction}and - * {@link Region#close() closure}. This method effects the behavor of - * {@link #close()}. - * - * @param r - * the Region which will no longer use this BridgeLoader - * @see #close() - * @see #attach(Region) - * @since 4.3 - */ - public void detach(Region r) - { - this.refCount.decrementAndGet(); - } - - /** - * Notify the BridgeLoader that the given Region will begin calling - * {@link #load(LoaderHelper)}. - * - * This method affects the behavior of {@link #close()}. - * - * This is called internally when the BridgeLoader is added to a Region via - * {@link AttributesFactory#setCacheLoader(CacheLoader)} - * - * @param r - * the Region which will begin use this BridgeWriter. - * @since 4.3 - * - * @see #detach(Region) - * @see #close() - */ - public void attach(Region r) - { - checkClosed(); - this.refCount.incrementAndGet(); - } - - -} http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembership.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembership.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembership.java deleted file mode 100755 index fdb718d..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembership.java +++ /dev/null @@ -1,55 +0,0 @@ -/*========================================================================= - * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ -package com.gemstone.gemfire.cache.util; - -import com.gemstone.gemfire.internal.cache.tier.InternalBridgeMembership; - -/** - * Provides utility methods for registering and unregistering - * BridgeMembershipListeners in this process. - * - * @author Kirk Lund - * @since 4.2.1 - * @deprecated see com.gemstone.gemfire.management.membership.ClientMembership - */ -public final class BridgeMembership { - - private BridgeMembership() {} - - /** - * Registers a {@link BridgeMembershipListener} for notification of - * connection changes for BridgeServers and bridge clients. - * @param listener a BridgeMembershipListener to be registered - */ - public static void registerBridgeMembershipListener(BridgeMembershipListener listener) { - InternalBridgeMembership.registerBridgeMembershipListener(listener); - } - - /** - * Removes registration of a previously registered {@link - * BridgeMembershipListener}. - * @param listener a BridgeMembershipListener to be unregistered - */ - public static void unregisterBridgeMembershipListener(BridgeMembershipListener listener) { - InternalBridgeMembership.unregisterBridgeMembershipListener(listener); - } - - /** - * Returns an array of all the currently registered - * BridgeMembershipListeners. Modifications to the returned - * array will not effect the registration of these listeners. - * @return the registered BridgeMembershipListeners; an empty - * array if no listeners - */ - public static BridgeMembershipListener[] getBridgeMembershipListeners() { - return InternalBridgeMembership.getBridgeMembershipListeners(); - } - - -} - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipEvent.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipEvent.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipEvent.java deleted file mode 100755 index b9d205e..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipEvent.java +++ /dev/null @@ -1,23 +0,0 @@ -/*========================================================================= - * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ -package com.gemstone.gemfire.cache.util; - -import com.gemstone.gemfire.management.membership.ClientMembershipEvent; - -/** - * An event delivered to a {@link BridgeMembershipListener} when this - * process detects connection changes to BridgeServers or bridge clients. - * - * @author Kirk Lund - * @since 4.2.1 - * @deprecated see com.gemstone.gemfire.management.membership.ClientMembershipEvent - */ -public interface BridgeMembershipEvent extends ClientMembershipEvent { - -} - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListener.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListener.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListener.java deleted file mode 100755 index d0e6196..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListener.java +++ /dev/null @@ -1,41 +0,0 @@ -/*========================================================================= - * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ - package com.gemstone.gemfire.cache.util; - -/** - * A listener whose callback methods are invoked when this process - * detects connection changes to BridgeServers or bridge clients. - * - * @see BridgeMembership#registerBridgeMembershipListener - * - * @author Kirk Lund - * @since 4.2.1 - * @deprecated see com.gemstone.gemfire.management.membership.ClientMembershipListener - */ -public interface BridgeMembershipListener{ - - /** - * Invoked when a client has connected to this process or when this - * process has connected to a BridgeServer. - */ - public void memberJoined(BridgeMembershipEvent event); - - /** - * Invoked when a client has gracefully disconnected from this process - * or when this process has gracefully disconnected from a BridgeServer. - */ - public void memberLeft(BridgeMembershipEvent event); - - /** - * Invoked when a client has unexpectedly disconnected from this process - * or when this process has unexpectedly disconnected from a BridgeServer. - */ - public void memberCrashed(BridgeMembershipEvent event); - -} - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListenerAdapter.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListenerAdapter.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListenerAdapter.java deleted file mode 100755 index 3ce2721..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeMembershipListenerAdapter.java +++ /dev/null @@ -1,43 +0,0 @@ -/*========================================================================= - * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ - -package com.gemstone.gemfire.cache.util; - -/** - * Utility class that implements all methods in - * BridgeMembershipListener with empty implementations. - * Applications can subclass this class and only override the methods for - * the events of interest. - * - * @author Kirk Lund - * @since 4.2.1 - * @deprecated see com.gemstone.gemfire.management.membership.ClientMembershipListenerAdapter - */ -public abstract class BridgeMembershipListenerAdapter -implements BridgeMembershipListener { - - /** - * Invoked when a client has connected to this process or when this - * process has connected to a BridgeServer. - */ - public void memberJoined(BridgeMembershipEvent event) {} - - /** - * Invoked when a client has gracefully disconnected from this process - * or when this process has gracefully disconnected from a BridgeServer. - */ - public void memberLeft(BridgeMembershipEvent event) {} - - /** - * Invoked when a client has unexpectedly disconnected from this process - * or when this process has unexpectedly disconnected from a BridgeServer. - */ - public void memberCrashed(BridgeMembershipEvent event) {} - -} - http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2eb4e175/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeServer.java ---------------------------------------------------------------------- diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeServer.java b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeServer.java deleted file mode 100644 index ad77071..0000000 --- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/util/BridgeServer.java +++ /dev/null @@ -1,442 +0,0 @@ -/*========================================================================= - * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved. - * This product is protected by U.S. and international copyright - * and intellectual property laws. Pivotal products are covered by - * one or more patents listed at http://www.pivotal.io/patents. - *========================================================================= - */ -package com.gemstone.gemfire.cache.util; - -import java.io.IOException; -import java.util.Set; - -import com.gemstone.gemfire.cache.ClientSession; -import com.gemstone.gemfire.distributed.DistributedMember; -import com.gemstone.gemfire.cache.client.Pool; -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.server.internal.ConnectionCountProbe; - -/** - * A cache bridge server that serves the contents of a - * Cache to VMs in another distributed system via a - * socket. A bridge server is used in conjunction with a - * client {@link Pool} to connect two regions - * that reside in different distributed systems. - * - * @see com.gemstone.gemfire.cache.Cache#addBridgeServer - * @see com.gemstone.gemfire.cache.Cache#getBridgeServers - * - * @since 2.0.2 - * @deprecated as of 5.7 used {@link CacheServer} instead. - */ -@Deprecated -public interface BridgeServer { - - /** The default port on which a BridgeServer is - * configured to serve. */ - public static final int DEFAULT_PORT = 40404; - - /** - * The default number of sockets accepted by a BridgeServer. - * When the maximum is reached the server will stop accepting new connections. - * Current value: 800 - * @since 5.7 - */ - public static final int DEFAULT_MAX_CONNECTIONS = 800; - // Value derived from common file descriptor limits for Unix sytems (1024)... - - /** - * The default limit to the maximum number of server threads that can be - * created to service client requests. Once this number of threads exist then - * connections must share the same thread to service their request. A selector - * is used to detect client connection requests and dispatch them to the thread - * pool. - * The default of 0 causes a thread to be bound to every connection - * and to be dedicated to detecting client requests on that connection. A selector - * is not used in this default mode. - * Current value: 0 - * @since 5.7 - */ - public static final int DEFAULT_MAX_THREADS = 0; - - /** The default notify-by-subscription value which tells the - * BridgeServer whether or not to notify clients - * based on key subscription. */ - public static final boolean DEFAULT_NOTIFY_BY_SUBSCRIPTION = true; - - /** - * The default socket buffer size for socket buffers from the server - * to the client. - */ - public static final int DEFAULT_SOCKET_BUFFER_SIZE = 32768; - - /** - * The default maximum amount of time between client pings. This value - * is used by the ClientHealthMonitor to determine the - * health of this BridgeServer's clients. - */ - public static final int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS = 60000; - - /** - * The default maximum number of messages that can be enqueued in a - * client-queue. - */ - public static final int DEFAULT_MAXIMUM_MESSAGE_COUNT = 230000; - - /** - * The default time (in seconds ) after which a message in the client queue - * will expire. - */ - public static final int DEFAULT_MESSAGE_TIME_TO_LIVE = 180; - - /** - * The default list of server groups a server belongs to. - * The current default is an empty list. - * @since 5.7 - */ - public static final String[] DEFAULT_GROUPS = new String[0]; - - /** - * The default load balancing probe. The default load balancing - * probe reports the connections counts of this server. - * @since 5.7 - * - */ - public static final ServerLoadProbe DEFAULT_LOAD_PROBE = new ConnectionCountProbe(); - - /** - * The default frequency at which to poll the load probe for the load - * on this server. Defaults to 5000 (5 seconds). - * @since 5.7 - */ - public static final long DEFAULT_LOAD_POLL_INTERVAL = 5000; - - /** - * The default ip address or host name that the server's socket will - * listen on for client connections. - * The current default is an empty string. - * @since 5.7 - */ - public static final String DEFAULT_BIND_ADDRESS = ""; - - /** - * The default ip address or host name that will be given to clients - * as the host this server is listening on. - * The current default is an empty string. - * @since 5.7 - */ - public static final String DEFAULT_HOSTNAME_FOR_CLIENTS = ""; - - /** - * Returns the port on which this server listens for clients. - */ - public int getPort(); - - /** - * Sets the port on which this server listens for clients. - * - * @throws IllegalStateException - * If this server is running - */ - public void setPort(int port); - - /** - * Returns a string representing the ip address or host name that this server - * will listen on. - * @return the ip address or host name that this server is to listen on - * @see #DEFAULT_BIND_ADDRESS - * @since 5.7 - */ - public String getBindAddress(); - /** - * Sets the ip address or host name that this server is to listen on for - * client connections. - *

Setting a specific bind address will cause the server to always - * use this address and ignore any address specified by "server-bind-address" - * or "bind-address" in the gemfire.properties file - * (see {@link com.gemstone.gemfire.distributed.DistributedSystem} - * for a description of these properties). - *

The value "" does not override the gemfire.properties. - * It will cause the local machine's default address to be listened on if the - * properties file does not specify and address. - * If you wish to override the properties and want to have your server bind to all local - * addresses then use this bind address "0.0.0.0". - *

A null value will be treated the same as the default "". - * @param address the ip address or host name that this server is to listen on - * @see #DEFAULT_BIND_ADDRESS - * @since 5.7 - */ - public void setBindAddress(String address); - /** - * Returns a string representing the ip address or host name that server locators - * will tell clients that this server is listening on. - * @return the ip address or host name to give to clients so they can connect - * to this server - * @see #DEFAULT_HOSTNAME_FOR_CLIENTS - * @since 5.7 - */ - public String getHostnameForClients(); - /** - * Sets the ip address or host name that this server is to listen on for - * client connections. - *

Setting a specific hostname-for-clients will cause server locators - * to use this value when telling clients how to connect to this server. - * This is useful in the case where the server may refer to itself with one - * hostname, but the clients need to use a different hostname to find the - * server. - *

The value "" causes the bind-address to be given to clients. - *

A null value will be treated the same as the default "". - * @param name the ip address or host name that will be given to clients - * so they can connect to this server - * @see #DEFAULT_HOSTNAME_FOR_CLIENTS - * @since 5.7 - */ - public void setHostnameForClients(String name); - /** - * Sets whether or not this server should notify clients based on - * key subscription. - * - * If false, then an update to any key on the server causes an update to - * be sent to all clients. This update does not push the actual data to the - * clients. Instead, it causes the client to locally invalidate or destroy - * the corresponding entry. The next time the client requests the key, it - * goes to the server for the value. - * - * If true, then an update to any key on the server causes an update to be - * sent to only those clients who have registered interest in that key. Other - * clients are not notified of the change. In addition, the actual value is - * pushed to the client. The client does not need to request the new value - * from the server. - * - * @since 4.2 - * @deprecated as of 6.0.1. This method is no more in use, by default - * notifyBySubscription attribute is set to true. - */ - @Deprecated - public void setNotifyBySubscription(boolean b); - - /** - * Answers whether or not this server should notify clients based on - * key subscription. - * - * @since 4.2 - * @deprecated as of 6.0.1. This method is no more in use, by default - * notifyBySubscription attribute is set to true. - */ - @Deprecated - public boolean getNotifyBySubscription(); - - /** - * Sets the buffer size in bytes of the socket connection for this - * BridgeServer. The default is 32768 bytes. - * - * @param socketBufferSize The size in bytes of the socket buffer - * - * @since 4.2.1 - */ - public void setSocketBufferSize(int socketBufferSize); - - /** - * Returns the configured buffer size of the socket connection for this - * BridgeServer. The default is 32768 bytes. - * @return the configured buffer size of the socket connection for this - * BridgeServer - * - * @since 4.2.1 - */ - public int getSocketBufferSize(); - - /** - * Sets the maximum amount of time between client pings. This value is - * used by the ClientHealthMonitor to determine the health - * of this BridgeServer's clients. The default is 60000 ms. - * - * @param maximumTimeBetweenPings The maximum amount of time between client - * pings - * - * @since 4.2.3 - */ - public void setMaximumTimeBetweenPings(int maximumTimeBetweenPings); - - /** - * Returns the maximum amount of time between client pings. This value is - * used by the ClientHealthMonitor to determine the health - * of this BridgeServer's clients. The default is 60000 ms. - * @return the maximum amount of time between client pings. - * - * @since 4.2.3 - */ - public int getMaximumTimeBetweenPings(); - - /** - * Starts this server. Once the server is running, its - * configuration cannot be changed. - * - * @throws IOException - * If an error occurs while starting the server - */ - public void start() throws IOException; - - /** - * Returns whether or not this server is running - */ - public boolean isRunning(); - - /** - * Stops this server. Note that the - * BridgeServer can be reconfigured and restarted if - * desired. - */ - public void stop(); - - /** - * Returns the maximum allowed client connections - */ - public int getMaxConnections(); - - /** - * Sets the maxium number of client connections allowed. - * When the maximum is reached the server will stop accepting - * connections. - * - * @see #DEFAULT_MAX_CONNECTIONS - */ - public void setMaxConnections(int maxCons); - - /** - * Returns the maxium number of threads allowed in this server to service - * client requests. - * The default of 0 causes the server to dedicate a thread for - * every client connection. - * @since 5.1 - */ - public int getMaxThreads(); - - /** - * Sets the maxium number of threads allowed in this server to service - * client requests. - * The default of 0 causes the server to dedicate a thread for - * every client connection. - * - * @see #DEFAULT_MAX_THREADS - * @since 5.1 - */ - public void setMaxThreads(int maxThreads); - - /** - * Returns the maximum number of messages that can be enqueued in a - * client-queue. - */ - public int getMaximumMessageCount(); - - /** - * Sets maximum number of messages that can be enqueued in a client-queue. - * - * @see #DEFAULT_MAXIMUM_MESSAGE_COUNT - */ - public void setMaximumMessageCount(int maxMessageCount); - - /** - * Returns the time (in seconds ) after which a message in the client queue - * will expire. - */ - public int getMessageTimeToLive(); - - /** - * Sets the time (in seconds ) after which a message in the client queue - * will expire.Expiry settings are applicable for the secondary queues only - * This setting has no impact on the primary queue. - * - * @see #DEFAULT_MESSAGE_TIME_TO_LIVE - */ - public void setMessageTimeToLive(int messageTimeToLive); - - /** - * Returns the ClientSession associated with the - * DistributedMember - * @return the ClientSession associated with the - * DistributedMember - * @since 5.6 - */ - public ClientSession getClientSession(DistributedMember member); - - /** - * Returns the ClientSession associated with the - * durable client id - * @return the ClientSession associated with the - * durable - * @since 5.6 - */ - public ClientSession getClientSession(String durableClientId); - - /** - * Returns a set of all ClientSessions - * @return a set of all ClientSessions - */ - public Set getAllClientSessions(); - - /** - * Sets the list of server groups this cache server will belong to. - * By default cache servers belong to the default global server group - * which all cache servers always belong to. - * @param groups possibly empty array of String where each string - * is a server groups that this cache server will be a member of. - * @see #DEFAULT_GROUPS - * @since 5.7 - */ - public void setGroups(String[] groups); - /** - * Returns the list of server groups that this cache server belongs to. - * @return a possibly empty array of Strings where - * each string is a server group. Modifying this array will not change the - * server groups that this cache server belongs to. - * @since 5.7 - */ - public String[] getGroups(); - - /** - * Get the load probe for this cache server. See - * {@link ServerLoadProbe} for details on the load probe. - * @return the load probe used by this cache - * server. - * @since 5.7 - */ - public ServerLoadProbe getLoadProbe(); - - /** - * Set the load probe for this cache server. See - * {@link ServerLoadProbe} for details on how to implement - * a load probe. - * @param loadProbe the load probe to use for - * this cache server. - * @since 5.7 - */ - public void setLoadProbe(ServerLoadProbe loadProbe); - - /** - * Get the frequency in milliseconds to poll the load probe on this cache - * server. - * - * @return the frequency in milliseconds that we will poll the load probe. - */ - public long getLoadPollInterval(); - - /** - * Set the frequency in milliseconds to poll the load probe on this cache - * server - * @param loadPollInterval the frequency in milliseconds to poll - * the load probe. Must be greater than 0. - */ - public void setLoadPollInterval(long loadPollInterval); - - /** - * Get the ClientSubscriptionConfig for this cache server. See - * {@link ClientSubscriptionConfig} for details on the client subscription configuration. - * - * @return ClientSubscriptionConfig - * @since 5.7 - */ - public ClientSubscriptionConfig getClientSubscriptionConfig(); -}