phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From karanmeht...@apache.org
Subject phoenix git commit: PHOENIX-4834 PhoenixMetricsLog interface methods should not depend on specific logger
Date Tue, 07 Aug 2018 23:13:45 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.3 7a2531d5a -> 58570bbd4


PHOENIX-4834 PhoenixMetricsLog interface methods should not depend on specific logger


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

Branch: refs/heads/4.x-HBase-1.3
Commit: 58570bbd4ea65d02c9c556e5ff9ae409c93f3fda
Parents: 7a2531d
Author: Karan Mehta <karanmehta93@gmail.com>
Authored: Tue Aug 7 15:47:33 2018 -0700
Committer: Karan Mehta <karanmehta93@gmail.com>
Committed: Tue Aug 7 15:59:46 2018 -0700

----------------------------------------------------------------------
 .../apache/phoenix/monitoring/PhoenixMetricsIT.java    |  9 ++++-----
 .../apache/phoenix/jdbc/LoggingPhoenixConnection.java  | 11 ++++++-----
 .../apache/phoenix/jdbc/LoggingPhoenixResultSet.java   |  7 ++-----
 .../org/apache/phoenix/jdbc/PhoenixMetricsLog.java     | 13 ++++++-------
 4 files changed, 18 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/58570bbd/phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java
index f13391f..4c5c592 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/monitoring/PhoenixMetricsIT.java
@@ -76,7 +76,6 @@ import org.apache.phoenix.util.ReadOnlyProps;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.mockito.internal.util.reflection.Whitebox;
-import org.slf4j.Logger;
 
 import com.google.common.base.Joiner;
 import com.google.common.collect.Lists;
@@ -1046,25 +1045,25 @@ public class PhoenixMetricsIT extends BaseUniqueNamesOwnClusterIT
{
         LoggingPhoenixConnection protectedConn =
                 new LoggingPhoenixConnection(conn, new PhoenixMetricsLog() {
                     @Override
-                    public void logOverAllReadRequestMetrics(Logger logger,
+                    public void logOverAllReadRequestMetrics(
                             Map<MetricType, Long> overAllQueryMetrics) {
                         overAllQueryMetricsMap.putAll(overAllQueryMetrics);
                     }
 
                     @Override
-                    public void logRequestReadMetrics(Logger logger,
+                    public void logRequestReadMetrics(
                             Map<String, Map<MetricType, Long>> requestReadMetrics)
{
                         requestReadMetricsMap.putAll(requestReadMetrics);
                     }
 
                     @Override
-                    public void logWriteMetricsfoForMutations(Logger logger,
+                    public void logWriteMetricsfoForMutations(
                             Map<String, Map<MetricType, Long>> mutationWriteMetrics)
{
                         mutationWriteMetricsMap.putAll(mutationWriteMetrics);
                     }
 
                     @Override
-                    public void logReadMetricInfoForMutationsSinceLastReset(Logger logger,
+                    public void logReadMetricInfoForMutationsSinceLastReset(
                             Map<String, Map<MetricType, Long>> mutationReadMetrics)
{
                         mutationReadMetricsMap.putAll(mutationReadMetrics);
                     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/58570bbd/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixConnection.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixConnection.java
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixConnection.java
index e1b5dee..d98da83 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixConnection.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixConnection.java
@@ -23,12 +23,9 @@ import java.sql.SQLException;
 import java.sql.Statement;
 
 import org.apache.phoenix.util.PhoenixRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class LoggingPhoenixConnection extends DelegateConnection {
 
-    private static final Logger logger = LoggerFactory.getLogger(LoggingPhoenixResultSet.class);
     private PhoenixMetricsLog phoenixMetricsLog;
 
     public LoggingPhoenixConnection(Connection conn,
@@ -37,6 +34,10 @@ public class LoggingPhoenixConnection extends DelegateConnection {
         this.phoenixMetricsLog = phoenixMetricsLog;
     }
 
+    public PhoenixMetricsLog getPhoenixMetricsLog() {
+        return phoenixMetricsLog;
+    }
+
     @Override
     public Statement createStatement() throws SQLException {
         return new LoggingPhoenixStatement(super.createStatement(), phoenixMetricsLog);
@@ -101,8 +102,8 @@ public class LoggingPhoenixConnection extends DelegateConnection {
     @Override
     public void commit() throws SQLException {
         super.commit();
-        phoenixMetricsLog.logWriteMetricsfoForMutations(logger, PhoenixRuntime.getWriteMetricInfoForMutationsSinceLastReset(conn));
-        phoenixMetricsLog.logReadMetricInfoForMutationsSinceLastReset(logger, PhoenixRuntime.getReadMetricInfoForMutationsSinceLastReset(conn));
+        phoenixMetricsLog.logWriteMetricsfoForMutations(PhoenixRuntime.getWriteMetricInfoForMutationsSinceLastReset(conn));
+        phoenixMetricsLog.logReadMetricInfoForMutationsSinceLastReset(PhoenixRuntime.getReadMetricInfoForMutationsSinceLastReset(conn));
         PhoenixRuntime.resetMetrics(conn);
     }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/58570bbd/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixResultSet.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixResultSet.java
b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixResultSet.java
index cc3b567..fbde499 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixResultSet.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/LoggingPhoenixResultSet.java
@@ -21,12 +21,9 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 
 import org.apache.phoenix.util.PhoenixRuntime;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class LoggingPhoenixResultSet extends DelegateResultSet {
     
-    private static final Logger logger = LoggerFactory.getLogger(LoggingPhoenixResultSet.class);
     private PhoenixMetricsLog phoenixMetricsLog;
     
     public LoggingPhoenixResultSet(ResultSet rs, PhoenixMetricsLog phoenixMetricsLog) {
@@ -36,8 +33,8 @@ public class LoggingPhoenixResultSet extends DelegateResultSet {
     
     @Override
     public void close() throws SQLException {
-        phoenixMetricsLog.logOverAllReadRequestMetrics(logger, PhoenixRuntime.getOverAllReadRequestMetricInfo(rs));
-        phoenixMetricsLog.logRequestReadMetrics(logger, PhoenixRuntime.getRequestReadMetricInfo(rs));
+        phoenixMetricsLog.logOverAllReadRequestMetrics(PhoenixRuntime.getOverAllReadRequestMetricInfo(rs));
+        phoenixMetricsLog.logRequestReadMetrics(PhoenixRuntime.getRequestReadMetricInfo(rs));
         PhoenixRuntime.resetMetrics(rs);
         super.close();
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/58570bbd/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixMetricsLog.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixMetricsLog.java b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixMetricsLog.java
index eac9bb8..be08e52 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixMetricsLog.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/jdbc/PhoenixMetricsLog.java
@@ -20,16 +20,15 @@ package org.apache.phoenix.jdbc;
 import java.util.Map;
 
 import org.apache.phoenix.monitoring.MetricType;
-import org.slf4j.Logger;
 
 public interface PhoenixMetricsLog {
 
-    void logOverAllReadRequestMetrics(Logger logger, Map<MetricType, Long> overAllQueryMetrics);
+    void logOverAllReadRequestMetrics(Map<MetricType, Long> overAllQueryMetrics);
 
-    void logRequestReadMetrics(Logger logger, Map<String, Map<MetricType, Long>>
requestReadMetrics);
-    
-    void logWriteMetricsfoForMutations(Logger logger,  Map<String, Map<MetricType,
Long>> mutationWriteMetrics);
-    
-    void logReadMetricInfoForMutationsSinceLastReset(Logger logger, Map<String, Map<MetricType,
Long>> mutationReadMetrics);
+    void logRequestReadMetrics(Map<String, Map<MetricType, Long>> requestReadMetrics);
+
+    void logWriteMetricsfoForMutations(Map<String, Map<MetricType, Long>> mutationWriteMetrics);
+
+    void logReadMetricInfoForMutationsSinceLastReset(Map<String, Map<MetricType, Long>>
mutationReadMetrics);
 
 }


Mime
View raw message