You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2015/07/01 20:36:50 UTC

incubator-geode git commit: [GEODE-71] javadocs and log message fixed

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-71 [created] 498d7cd4a


[GEODE-71] javadocs and log message fixed

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.


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

Branch: refs/heads/feature/GEODE-71
Commit: 498d7cd4a5e3165f1c8e78b114a5cfd985a53664
Parents: 1219783
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Fri Jun 26 11:34:22 2015 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Jul 1 11:25:23 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/498d7cd4/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/498d7cd4/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/498d7cd4/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/498d7cd4/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 d5a1f20..0761edb 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
@@ -1864,7 +1864,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:");