git commit: PHOENIX-1176 Allow tracing to be turned on globally through config

2014-08-17 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/4.0 f18922c61 - 495491a72


PHOENIX-1176 Allow tracing to be turned on globally through config


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

Branch: refs/heads/4.0
Commit: 495491a729150896d04307ab8315fc60904a5cb9
Parents: f18922c
Author: James Taylor jtay...@salesforce.com
Authored: Sun Aug 17 11:21:36 2014 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Sun Aug 17 11:21:36 2014 -0700

--
 .../org/apache/phoenix/query/QueryServicesOptions.java   |  3 +++
 .../apache/phoenix/trace/util/ConfigurationAdapter.java  | 11 +--
 .../main/java/org/apache/phoenix/trace/util/Tracing.java |  8 +---
 3 files changed, 13 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/495491a7/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index 20c3359..ae1dbc7 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -60,6 +60,7 @@ import java.util.Map.Entry;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.regionserver.wal.WALCellCodec;
+import org.apache.phoenix.trace.util.Tracing;
 import org.apache.phoenix.util.DateUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 
@@ -140,6 +141,8 @@ public class QueryServicesOptions {
  * Configuration key to overwrite the tablename that should be used as the 
target table
  */
 public static final String DEFAULT_TRACING_STATS_TABLE_NAME = 
SYSTEM.TRACING_STATS;
+public static final String DEFAULT_TRACING_FREQ = 
Tracing.Frequency.NEVER.getKey();
+public static final double DEFAULT_TRACING_PROBABILITY_THRESHOLD = 0.05;
 
 private final Configuration config;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/495491a7/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
index a96be7d..cde7f9e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
@@ -18,7 +18,6 @@
 package org.apache.phoenix.trace.util;
 
 import org.apache.hadoop.conf.Configuration;
-
 import org.apache.phoenix.jdbc.PhoenixConnection;
 
 /**
@@ -26,7 +25,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
  */
 abstract class ConfigurationAdapter {
 
-  public abstract String get(String key);
+  public abstract String get(String key, String defaultValue);
 
   public static class ConnectionConfigurationAdapter extends 
ConfigurationAdapter {
 private PhoenixConnection conn;
@@ -36,8 +35,8 @@ abstract class ConfigurationAdapter {
 }
 
 @Override
-public String get(String key) {
-  return conn.getClientInfo(key);
+public String get(String key, String defaultValue) {
+  return conn.getQueryServices().getProps().get(key, defaultValue);
 }
   }
 
@@ -49,8 +48,8 @@ abstract class ConfigurationAdapter {
 }
 
 @Override
-public String get(String key) {
-  return conf.get(key);
+public String get(String key, String defaultValue) {
+  return conf.get(key, defaultValue);
 }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/495491a7/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java 
b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
index 5e4ac9e..e90d2c8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
@@ -30,6 +30,7 @@ import org.apache.phoenix.call.CallRunner;
 import org.apache.phoenix.call.CallWrapper;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.query.QueryServicesOptions;
 import 

git commit: PHOENIX-1176 Allow tracing to be turned on globally through config

2014-08-17 Thread jamestaylor
Repository: phoenix
Updated Branches:
  refs/heads/master 828326488 - 8adcc87a6


PHOENIX-1176 Allow tracing to be turned on globally through config


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

Branch: refs/heads/master
Commit: 8adcc87a625a0d56bea4b6cf8c3e967b4a226972
Parents: 8283264
Author: James Taylor jtay...@salesforce.com
Authored: Sun Aug 17 11:21:36 2014 -0700
Committer: James Taylor jtay...@salesforce.com
Committed: Sun Aug 17 13:26:49 2014 -0700

--
 .../org/apache/phoenix/query/QueryServicesOptions.java   |  3 +++
 .../apache/phoenix/trace/util/ConfigurationAdapter.java  | 11 +--
 .../main/java/org/apache/phoenix/trace/util/Tracing.java |  8 +---
 3 files changed, 13 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/phoenix/blob/8adcc87a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
index 20c3359..ae1dbc7 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/query/QueryServicesOptions.java
@@ -60,6 +60,7 @@ import java.util.Map.Entry;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.regionserver.wal.WALCellCodec;
+import org.apache.phoenix.trace.util.Tracing;
 import org.apache.phoenix.util.DateUtil;
 import org.apache.phoenix.util.ReadOnlyProps;
 
@@ -140,6 +141,8 @@ public class QueryServicesOptions {
  * Configuration key to overwrite the tablename that should be used as the 
target table
  */
 public static final String DEFAULT_TRACING_STATS_TABLE_NAME = 
SYSTEM.TRACING_STATS;
+public static final String DEFAULT_TRACING_FREQ = 
Tracing.Frequency.NEVER.getKey();
+public static final double DEFAULT_TRACING_PROBABILITY_THRESHOLD = 0.05;
 
 private final Configuration config;
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8adcc87a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
index a96be7d..cde7f9e 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/ConfigurationAdapter.java
@@ -18,7 +18,6 @@
 package org.apache.phoenix.trace.util;
 
 import org.apache.hadoop.conf.Configuration;
-
 import org.apache.phoenix.jdbc.PhoenixConnection;
 
 /**
@@ -26,7 +25,7 @@ import org.apache.phoenix.jdbc.PhoenixConnection;
  */
 abstract class ConfigurationAdapter {
 
-  public abstract String get(String key);
+  public abstract String get(String key, String defaultValue);
 
   public static class ConnectionConfigurationAdapter extends 
ConfigurationAdapter {
 private PhoenixConnection conn;
@@ -36,8 +35,8 @@ abstract class ConfigurationAdapter {
 }
 
 @Override
-public String get(String key) {
-  return conn.getClientInfo(key);
+public String get(String key, String defaultValue) {
+  return conn.getQueryServices().getProps().get(key, defaultValue);
 }
   }
 
@@ -49,8 +48,8 @@ abstract class ConfigurationAdapter {
 }
 
 @Override
-public String get(String key) {
-  return conf.get(key);
+public String get(String key, String defaultValue) {
+  return conf.get(key, defaultValue);
 }
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/phoenix/blob/8adcc87a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
--
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java 
b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
index 5e4ac9e..e90d2c8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java
@@ -30,6 +30,7 @@ import org.apache.phoenix.call.CallRunner;
 import org.apache.phoenix.call.CallWrapper;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.QueryServices;
+import org.apache.phoenix.query.QueryServicesOptions;
 import