geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject incubator-geode git commit: GEODE-71: fix javadocs and log message
Date Thu, 09 Jul 2015 18:54:22 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/develop b205339a0 -> 7cf940f60


GEODE-71: fix javadocs and log message

The javadocs are now correct.
Changed the log message about the host being unknown
to be warn instead of fatal since the whole point of fixing 45348
was to ignore the unknown host exception
until you try to use the pool for an operation.
I also updated the log message to say:
  "Creating pool with unknown host in case
   the host becomes known later."
instead of just saying the host was unknown.
Reviewed by: Kirk Lund and Dan Smith


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

Branch: refs/heads/develop
Commit: 7cf940f608aba1a8210d908beac756359c3d6a4e
Parents: b205339
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Fri Jun 26 11:34:22 2015 -0700
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Thu Jul 9 10:44:37 2015 -0700

----------------------------------------------------------------------
 .../gemfire/cache/client/ClientCacheFactory.java  | 18 ++++++++++++------
 .../gemfire/cache/client/PoolFactory.java         | 18 ++++++++++++------
 .../gemfire/internal/cache/PoolFactoryImpl.java   |  3 +--
 .../gemfire/internal/i18n/LocalizedStrings.java   |  2 +-
 4 files changed, 26 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7cf940f6/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/ClientCacheFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/ClientCacheFactory.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/ClientCacheFactory.java
index 48bc074..6f26d28 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/ClientCacheFactory.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/ClientCacheFactory.java
@@ -423,12 +423,15 @@ public class ClientCacheFactory {
    * Add a locator, given its host and port, to this factory.
    * The locator must be a server locator and will be used to discover other running
    * cache servers and locators.
+   * Note that if the host is unknown at the time of this call
+   * the locator will still be added. When the pool is used for
+   * an operation if the host is still unknown an exception will
+   * be thrown.
    * @param host the host name or ip address that the locator is listening on.
    * @param port the port that the locator is listening on
    * @return a reference to <code>this</code>
-   * @throws IllegalArgumentException if <code>host</code> is an unknown host
-   * according to {@link java.net.InetAddress#getByName(String)} or if port is outside
-   * the valid range of [1..65535] inclusive.
+   * @throws IllegalArgumentException if port is outside
+   * the valid range of [0..65535] inclusive.
    * @throws IllegalStateException if a server has already been {@link #addPoolServer added}
to this factory.
    */
   public ClientCacheFactory addPoolLocator(String host, int port) {
@@ -441,12 +444,15 @@ public class ClientCacheFactory {
    * Add a server, given its host and port, to this factory.
    * The server must be a cache server and this client will
    * directly connect to without consulting a server locator.
+   * Note that if the host is unknown at the time of this call
+   * the server will still be added. When the pool is used for
+   * an operation if the host is still unknown an exception will
+   * be thrown.
    * @param host the host name or ip address that the server is listening on.
    * @param port the port that the server is listening on
    * @return a reference to <code>this</code>
-   * @throws IllegalArgumentException if <code>host</code> is an unknown host
-   * according to {@link java.net.InetAddress#getByName(String)} or if port is outside
-   * the valid range of [1..65535] inclusive.
+   * @throws IllegalArgumentException if port is outside
+   * the valid range of [0..65535] inclusive.
    * @throws IllegalStateException if a locator has already been {@link #addPoolLocator added}
to this factory.
    */
   public ClientCacheFactory addPoolServer(String host, int port) {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7cf940f6/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/PoolFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/PoolFactory.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/PoolFactory.java
index 3f09262..547971f 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/PoolFactory.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/cache/client/PoolFactory.java
@@ -326,12 +326,15 @@ public interface PoolFactory {
    * Add a locator, given its host and port, to this factory.
    * The locator must be a server locator and will be used to discover other running
    * bridge servers and locators.
+   * Note that if the host is unknown at the time of this call
+   * the locator will still be added. When the pool is used for
+   * an operation if the host is still unknown an exception will
+   * be thrown.
    * @param host the host name or ip address that the locator is listening on.
    * @param port the port that the locator is listening on
    * @return a reference to <code>this</code>
-   * @throws IllegalArgumentException if <code>host</code> is an unknown host
-   * according to {@link java.net.InetAddress#getByName(String)} or if port is outside
-   * the valid range of [1..65535] inclusive.
+   * @throws IllegalArgumentException if port is outside
+   * the valid range of [0..65535] inclusive.
    * @throws IllegalStateException if a server has already been {@link #addServer added}
to this factory.
    */
   public PoolFactory addLocator(String host, int port);
@@ -340,12 +343,15 @@ public interface PoolFactory {
    * Add a server, given its host and port, to this factory.
    * The server must be a bridge server and this client will
    * directly connect to without consulting a server locator.
+   * Note that if the host is unknown at the time of this call
+   * the server will still be added. When the pool is used for
+   * an operation if the host is still unknown an exception will
+   * be thrown.
    * @param host the host name or ip address that the server is listening on.
    * @param port the port that the server is listening on
    * @return a reference to <code>this</code>
-   * @throws IllegalArgumentException if <code>host</code> is an unknown host
-   * according to {@link java.net.InetAddress#getByName(String)} or if port is outside
-   * the valid range of [1..65535] inclusive.
+   * @throws IllegalArgumentException if port is outside
+   * the valid range of [0..65535] inclusive.
    * @throws IllegalStateException if a locator has already been {@link #addLocator added}
to this factory.
    */
   public PoolFactory addServer(String host, int port);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7cf940f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
index 7d2a610..4569184 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
@@ -222,8 +222,7 @@ public class PoolFactoryImpl implements PoolFactory {
 //      ex.initCause(cause);
 //      throw ex;
       // Fix for #45348
-      GemFireCacheImpl cache =GemFireCacheImpl.getInstance();
-      logger.fatal(LocalizedMessage.create(LocalizedStrings.PoolFactoryImpl_HOSTNAME_UNKNOWN,
host));
+      logger.warn(LocalizedMessage.create(LocalizedStrings.PoolFactoryImpl_HOSTNAME_UNKNOWN,
host));
       InetSocketAddress sockAddr = new InetSocketAddress(host, port);
       l.add(sockAddr);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/7cf940f6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java
index d6b4115..f5ae3e5 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/i18n/LocalizedStrings.java
@@ -1888,7 +1888,7 @@ public class LocalizedStrings extends ParentLocalizedStrings {
   public static final StringId ServerLauncher_SERVER_REDIRECT_OUTPUT_HELP = new StringIdImpl(5295,
"An option to cause the Server to redirect standard out and standard error to the GemFire
log file.");
   public static final StringId ServerLauncher_SERVER_HOSTNAME_FOR_CLIENT_HELP = new StringIdImpl(5296,
"An option to specify the hostname or IP address to send to clients so they can connect to
this Server. The default is to use the IP address to which the Server is bound.");
 
-  public static final StringId PoolFactoryImpl_HOSTNAME_UNKNOWN = new StringIdImpl(5300,
"Hostname is unknown: {0}");
+  public static final StringId PoolFactoryImpl_HOSTNAME_UNKNOWN = new StringIdImpl(5300,
"Hostname is unknown: {0}. Creating pool with unknown host in case the host becomes known
later.");
   public static final StringId GatewaySenderEventRemoteDispatcher_GATEWAY_SENDER_0_RECEIVED_ACK_FOR_BATCH_ID_1_OF_2_EVENTS
= new StringIdImpl(5301, "Gateway Sender {0} : Received ack for batch id {1} of {2} events.");
   public static final StringId GatewaySenderEventRemoteDispatcher_GATEWAY_SENDER_0_RECEIVED_ACK_FOR_BATCH_ID_1_WITH_EXCEPTION
= new StringIdImpl(5302, "Gateway Sender {0} : Received ack for batch id {1} with exception:");
 


Mime
View raw message