PHOENIX-1958 Minimize memory allocation on new connection

Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/93397aff
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/93397aff
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/93397aff

Branch: refs/heads/json
Commit: 93397affd75fb5877146ca7b4bb028db301f671e
Parents: cd81738
Author: James Taylor <jtay...@salesforce.com>
Authored: Sat May 9 18:13:49 2015 -0700
Committer: James Taylor <jtay...@salesforce.com>
Committed: Sat May 9 18:13:49 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/util/ReadOnlyProps.java    | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/93397aff/phoenix-core/src/main/java/org/apache/phoenix/util/ReadOnlyProps.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/util/ReadOnlyProps.java 
b/phoenix-core/src/main/java/org/apache/phoenix/util/ReadOnlyProps.java
index 47137ef..a6fb7a5 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/ReadOnlyProps.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/ReadOnlyProps.java
@@ -27,6 +27,9 @@ import java.util.Properties;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import com.google.common.base.Objects;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Maps;
@@ -40,6 +43,7 @@ import com.google.common.collect.Maps;
  * @since 1.2.2
  */
 public class ReadOnlyProps implements Iterable<Entry<String, String>> {
+    private static final Logger logger = 
LoggerFactory.getLogger(ReadOnlyProps.class);
     public static final ReadOnlyProps EMPTY_PROPS = new ReadOnlyProps();
     private final Map<String, String> props;
     
@@ -296,6 +300,7 @@ public class ReadOnlyProps implements 
Iterable<Entry<String, String>> {
             String value = entry.getValue().toString();
             String oldValue = props.get(key);
             if (!Objects.equal(oldValue, value)) {
+                if (logger.isDebugEnabled()) logger.debug("Creating new 
ReadOnlyProps due to " + key + " with " + oldValue + "!=" + value);
                 return new ReadOnlyProps(this, overrides);
             }
         }

Reply via email to