Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.1 17d9b1340 -> fc2a5164b


PHOENIX-4701 Write client-side metrics asynchronously to SYSTEM.LOG(addendum)


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

Branch: refs/heads/4.x-HBase-1.1
Commit: fc2a5164b2e056a9b83842720946194dd631d6bc
Parents: 17d9b13
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Wed May 16 17:26:16 2018 -0700
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Wed May 16 17:26:16 2018 -0700

----------------------------------------------------------------------
 .../phoenix/monitoring/PhoenixMetricsIT.java      |  7 +++----
 .../apache/phoenix/compile/StatementContext.java  |  4 ++--
 .../org/apache/phoenix/execute/MutationState.java |  4 ++--
 .../phoenix/monitoring/CombinableMetric.java      |  9 +++++++++
 .../phoenix/monitoring/CombinableMetricImpl.java  | 14 +++++++++++---
 .../org/apache/phoenix/monitoring/MetricUtil.java |  4 ++--
 .../phoenix/monitoring/MutationMetricQueue.java   | 18 ++++++------------
 .../phoenix/monitoring/OverAllQueryMetrics.java   | 14 +++++++-------
 .../phoenix/monitoring/ReadMetricQueue.java       | 14 ++++++++++----
 .../phoenix/monitoring/ScanMetricsHolder.java     |  4 ++--
 .../phoenix/monitoring/SpoolingMetricsHolder.java |  2 +-
 .../monitoring/TaskExecutionMetricsHolder.java    |  2 +-
 .../iterate/SpoolingResultIteratorTest.java       |  2 +-
 13 files changed, 57 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/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 73cdf0a..f13391f 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
@@ -101,7 +101,6 @@ public class PhoenixMetricsIT extends 
BaseUniqueNamesOwnClusterIT {
         props.put(QueryServices.COLLECT_REQUEST_LEVEL_METRICS, 
String.valueOf(true));
         // disable renewing leases as this will force spooling to happen.
         props.put(QueryServices.RENEW_LEASE_ENABLED, String.valueOf(false));
-        props.put(QueryServices.LOG_LEVEL, LogLevel.DEBUG.toString());
         setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator()));
         // need the non-test driver for some tests that check number of 
hconnections, etc.
         DriverManager.registerDriver(PhoenixDriver.INSTANCE);
@@ -700,7 +699,7 @@ public class PhoenixMetricsIT extends 
BaseUniqueNamesOwnClusterIT {
 
     private void changeInternalStateForTesting(PhoenixResultSet rs) {
         // get and set the internal state for testing purposes.
-        ReadMetricQueue testMetricsQueue = new 
TestReadMetricsQueue(LogLevel.DEBUG);
+        ReadMetricQueue testMetricsQueue = new 
TestReadMetricsQueue(LogLevel.OFF,true);
         StatementContext ctx = (StatementContext)Whitebox.getInternalState(rs, 
"context");
         Whitebox.setInternalState(ctx, "readMetricsQueue", testMetricsQueue);
         Whitebox.setInternalState(rs, "readMetricsQueue", testMetricsQueue);
@@ -766,8 +765,8 @@ public class PhoenixMetricsIT extends 
BaseUniqueNamesOwnClusterIT {
 
     private class TestReadMetricsQueue extends ReadMetricQueue {
 
-        public TestReadMetricsQueue(LogLevel connectionLogLevel) {
-            super(connectionLogLevel);
+        public TestReadMetricsQueue(LogLevel connectionLogLevel, boolean 
isRequestMetricsEnabled) {
+            super(isRequestMetricsEnabled, connectionLogLevel);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
index 4358ee3..fe60bb9 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/compile/StatementContext.java
@@ -135,8 +135,8 @@ public class StatementContext {
         this.dataColumns = this.currentTable == null ? Collections.<PColumn, 
Integer> emptyMap() : Maps
                 .<PColumn, Integer> newLinkedHashMap();
         this.subqueryResults = Maps.<SelectStatement, Object> newHashMap();
-        this.readMetricsQueue = new ReadMetricQueue(connection.getLogLevel());
-        this.overAllQueryMetrics = new 
OverAllQueryMetrics(connection.getLogLevel());
+        this.readMetricsQueue = new 
ReadMetricQueue(isRequestMetricsEnabled,connection.getLogLevel());
+        this.overAllQueryMetrics = new 
OverAllQueryMetrics(isRequestMetricsEnabled,connection.getLogLevel());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java 
b/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
index 6298e5b..774544b 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/MutationState.java
@@ -38,6 +38,7 @@ import javax.annotation.Nonnull;
 import javax.annotation.concurrent.Immutable;
 
 import org.apache.hadoop.hbase.HConstants;
+import org.apache.phoenix.util.KeyValueUtil;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Mutation;
 import org.apache.hadoop.hbase.client.HTableInterface;
@@ -97,7 +98,6 @@ import org.apache.phoenix.transaction.TransactionFactory;
 import org.apache.phoenix.transaction.TransactionFactory.Provider;
 import org.apache.phoenix.util.ByteUtil;
 import org.apache.phoenix.util.IndexUtil;
-import org.apache.phoenix.util.KeyValueUtil;
 import org.apache.phoenix.util.LogUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.SQLCloseable;
@@ -1182,7 +1182,7 @@ public class MutationState implements SQLCloseable {
                                                numFailedMutations = 
uncommittedStatementIndexes.length;
                                                
GLOBAL_MUTATION_BATCH_FAILED_COUNT.update(numFailedMutations);
                     } finally {
-                       MutationMetric mutationsMetric = new 
MutationMetric(connection.getLogLevel(),numMutations, mutationSizeBytes, 
mutationCommitTime, numFailedMutations);
+                       MutationMetric mutationsMetric = new 
MutationMetric(numMutations, mutationSizeBytes, mutationCommitTime, 
numFailedMutations);
                         
mutationMetricQueue.addMetricsForTable(Bytes.toString(htableName), 
mutationsMetric);
                         try {
                             if (cache!=null) 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetric.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetric.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetric.java
index db51c56..103fd14 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetric.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetric.java
@@ -28,6 +28,8 @@ public interface CombinableMetric extends Metric {
     String getPublishString();
 
     CombinableMetric combine(CombinableMetric metric);
+    
+    CombinableMetric clone();
 
     public class NoOpRequestMetric implements CombinableMetric {
 
@@ -70,7 +72,14 @@ public interface CombinableMetric extends Metric {
 
         @Override
         public void decrement() {}
+        
+        @Override
+        public CombinableMetric clone(){
+            return INSTANCE;
+        }
 
     }
 
+    
+
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetricImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetricImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetricImpl.java
index 88049c7..bd22418 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetricImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/CombinableMetricImpl.java
@@ -17,8 +17,6 @@
  */
 package org.apache.phoenix.monitoring;
 
-import static com.google.common.base.Preconditions.checkArgument;
-
 public class CombinableMetricImpl implements CombinableMetric {
 
     private final Metric metric;
@@ -26,6 +24,10 @@ public class CombinableMetricImpl implements 
CombinableMetric {
     public CombinableMetricImpl(MetricType type) {
         metric = new NonAtomicMetric(type);
     }
+    
+    private CombinableMetricImpl(Metric metric) {
+        this.metric = metric;
+    }
 
     @Override
        public MetricType getMetricType() {
@@ -64,7 +66,6 @@ public class CombinableMetricImpl implements CombinableMetric 
{
 
     @Override
     public CombinableMetric combine(CombinableMetric metric) {
-        checkArgument(this.getClass().equals(metric.getClass()));
         this.metric.change(metric.getValue());
         return this;
     }
@@ -73,5 +74,12 @@ public class CombinableMetricImpl implements 
CombinableMetric {
     public void decrement() {
         metric.decrement();
     }
+    
+    @Override
+    public CombinableMetric clone(){
+        NonAtomicMetric metric = new 
NonAtomicMetric(this.metric.getMetricType());
+        metric.change(this.metric.getValue());
+        return new CombinableMetricImpl(metric);
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MetricUtil.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MetricUtil.java 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MetricUtil.java
index 1e5ac08..e792c08 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MetricUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MetricUtil.java
@@ -22,8 +22,8 @@ import 
org.apache.phoenix.monitoring.CombinableMetric.NoOpRequestMetric;
 
 public class MetricUtil {
 
-    public static CombinableMetric getCombinableMetric(LogLevel 
connectionLogLevel, MetricType type) {
-        if (!type.isLoggingEnabled(connectionLogLevel)) { return 
NoOpRequestMetric.INSTANCE; }
+    public static CombinableMetric getCombinableMetric(boolean 
isRequestMetricsEnabled, LogLevel connectionLogLevel, MetricType type) {
+        if (!type.isLoggingEnabled(connectionLogLevel) && 
!isRequestMetricsEnabled) { return NoOpRequestMetric.INSTANCE; }
         return new CombinableMetricImpl(type);
     }
 

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MutationMetricQueue.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MutationMetricQueue.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MutationMetricQueue.java
index 1256f5c..08cf239 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MutationMetricQueue.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/MutationMetricQueue.java
@@ -27,7 +27,6 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.phoenix.log.LogLevel;
 
 /**
  * Queue that tracks various writes/mutations related phoenix request metrics.
@@ -83,17 +82,12 @@ public class MutationMetricQueue {
      * Class that holds together the various metrics associated with mutations.
      */
     public static class MutationMetric {
-        private final CombinableMetric numMutations;;
-        private final CombinableMetric mutationsSizeBytes;
-        private final CombinableMetric totalCommitTimeForMutations;
-        private final CombinableMetric numFailedMutations;
-
-        public MutationMetric(LogLevel connectionLogLevel, long numMutations, 
long mutationsSizeBytes, long commitTimeForMutations, long numFailedMutations) {
-            this.numMutations = 
MetricUtil.getCombinableMetric(connectionLogLevel,MUTATION_BATCH_SIZE);
-            this.mutationsSizeBytes 
=MetricUtil.getCombinableMetric(connectionLogLevel,MUTATION_BYTES);
-            this.totalCommitTimeForMutations 
=MetricUtil.getCombinableMetric(connectionLogLevel,MUTATION_COMMIT_TIME);
-            this.numFailedMutations = 
MetricUtil.getCombinableMetric(connectionLogLevel,MUTATION_BATCH_FAILED_SIZE);
-            this.numMutations.change(numMutations);
+        private final CombinableMetric numMutations = new 
CombinableMetricImpl(MUTATION_BATCH_SIZE);
+        private final CombinableMetric mutationsSizeBytes = new 
CombinableMetricImpl(MUTATION_BYTES);
+        private final CombinableMetric totalCommitTimeForMutations = new 
CombinableMetricImpl(MUTATION_COMMIT_TIME);
+        private final CombinableMetric numFailedMutations = new 
CombinableMetricImpl(MUTATION_BATCH_FAILED_SIZE);
+
+        public MutationMetric(long numMutations, long mutationsSizeBytes, long 
commitTimeForMutations, long numFailedMutations) {            
this.numMutations.change(numMutations);
             this.mutationsSizeBytes.change(mutationsSizeBytes);
             this.totalCommitTimeForMutations.change(commitTimeForMutations);
             this.numFailedMutations.change(numFailedMutations);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/OverAllQueryMetrics.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/OverAllQueryMetrics.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/OverAllQueryMetrics.java
index 3121ecd..9a2f426 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/OverAllQueryMetrics.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/OverAllQueryMetrics.java
@@ -42,15 +42,15 @@ public class OverAllQueryMetrics {
     private final CombinableMetric queryFailed;
     private final CombinableMetric cacheRefreshedDueToSplits;
 
-    public OverAllQueryMetrics(LogLevel connectionLogLevel) {
+    public OverAllQueryMetrics(boolean isRequestMetricsEnabled, LogLevel 
connectionLogLevel) {
         queryWatch = new 
MetricsStopWatch(WALL_CLOCK_TIME_MS.isLoggingEnabled(connectionLogLevel));
         resultSetWatch = new 
MetricsStopWatch(RESULT_SET_TIME_MS.isLoggingEnabled(connectionLogLevel));
-        numParallelScans = MetricUtil.getCombinableMetric(connectionLogLevel, 
NUM_PARALLEL_SCANS);
-        wallClockTimeMS = MetricUtil.getCombinableMetric(connectionLogLevel, 
WALL_CLOCK_TIME_MS);
-        resultSetTimeMS = MetricUtil.getCombinableMetric(connectionLogLevel, 
RESULT_SET_TIME_MS);
-        queryTimedOut = MetricUtil.getCombinableMetric(connectionLogLevel, 
QUERY_TIMEOUT_COUNTER);
-        queryFailed = MetricUtil.getCombinableMetric(connectionLogLevel, 
QUERY_FAILED_COUNTER);
-        cacheRefreshedDueToSplits = 
MetricUtil.getCombinableMetric(connectionLogLevel, 
CACHE_REFRESH_SPLITS_COUNTER);
+        numParallelScans = 
MetricUtil.getCombinableMetric(isRequestMetricsEnabled,connectionLogLevel, 
NUM_PARALLEL_SCANS);
+        wallClockTimeMS = 
MetricUtil.getCombinableMetric(isRequestMetricsEnabled,connectionLogLevel, 
WALL_CLOCK_TIME_MS);
+        resultSetTimeMS = 
MetricUtil.getCombinableMetric(isRequestMetricsEnabled,connectionLogLevel, 
RESULT_SET_TIME_MS);
+        queryTimedOut = 
MetricUtil.getCombinableMetric(isRequestMetricsEnabled,connectionLogLevel, 
QUERY_TIMEOUT_COUNTER);
+        queryFailed = 
MetricUtil.getCombinableMetric(isRequestMetricsEnabled,connectionLogLevel, 
QUERY_FAILED_COUNTER);
+        cacheRefreshedDueToSplits = 
MetricUtil.getCombinableMetric(isRequestMetricsEnabled,connectionLogLevel, 
CACHE_REFRESH_SPLITS_COUNTER);
     }
 
     public void updateNumParallelScans(long numParallelScans) {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ReadMetricQueue.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ReadMetricQueue.java 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ReadMetricQueue.java
index fa81e9c..6186f6b 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ReadMetricQueue.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ReadMetricQueue.java
@@ -44,12 +44,15 @@ public class ReadMetricQueue {
 
     private LogLevel connectionLogLevel;
 
-    public ReadMetricQueue(LogLevel connectionLogLevel) {
+    private boolean isRequestMetricsEnabled;
+
+    public ReadMetricQueue(boolean isRequestMetricsEnabled, LogLevel 
connectionLogLevel) {
+        this.isRequestMetricsEnabled = isRequestMetricsEnabled;
         this.connectionLogLevel = connectionLogLevel;
     }
 
     public CombinableMetric allotMetric(MetricType type, String tableName) {
-        if (type.isLoggingEnabled(connectionLogLevel)) {
+        if (type.isLoggingEnabled(connectionLogLevel) || 
isRequestMetricsEnabled) {
             MetricKey key = new MetricKey(type, tableName);
             Queue<CombinableMetric> q = getMetricQueue(key);
             CombinableMetric metric = getMetric(type);
@@ -95,7 +98,8 @@ public class ReadMetricQueue {
         int size = metrics.size();
         if (size == 0) { throw new IllegalArgumentException("Metrics 
collection needs to have at least one element"); }
         Iterator<CombinableMetric> itr = metrics.iterator();
-        CombinableMetric combinedMetric = itr.next();
+        //Clone first metric for combining so that aggregate always give 
consistent result
+        CombinableMetric combinedMetric = itr.next().clone();
         while (itr.hasNext()) {
             combinedMetric = combinedMetric.combine(itr.next());
         }
@@ -186,6 +190,8 @@ public class ReadMetricQueue {
         return scanMetricsHolderList;
     }
     
-    
+    public boolean isRequestMetricsEnabled() {
+        return isRequestMetricsEnabled;
+    }    
 
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ScanMetricsHolder.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ScanMetricsHolder.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ScanMetricsHolder.java
index e72b815..da2e372 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ScanMetricsHolder.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/ScanMetricsHolder.java
@@ -49,11 +49,11 @@ public class ScanMetricsHolder {
     private Object scan;
 
     private static final ScanMetricsHolder NO_OP_INSTANCE =
-            new ScanMetricsHolder(new ReadMetricQueue(LogLevel.OFF),"", null);
+            new ScanMetricsHolder(new ReadMetricQueue(false,LogLevel.OFF),"", 
null);
 
     public static ScanMetricsHolder getInstance(ReadMetricQueue readMetrics, 
String tableName,
             Scan scan, LogLevel connectionLogLevel) {
-        if (connectionLogLevel == LogLevel.OFF) { return NO_OP_INSTANCE; }
+        if (connectionLogLevel == LogLevel.OFF && 
!readMetrics.isRequestMetricsEnabled()) { return NO_OP_INSTANCE; }
         scan.setScanMetricsEnabled(true);
         return new ScanMetricsHolder(readMetrics, tableName, scan);
     }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/SpoolingMetricsHolder.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/SpoolingMetricsHolder.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/SpoolingMetricsHolder.java
index 699982f..8662f1a 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/SpoolingMetricsHolder.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/SpoolingMetricsHolder.java
@@ -27,7 +27,7 @@ public class SpoolingMetricsHolder {
 
     private final CombinableMetric spoolFileSizeMetric;
     private final CombinableMetric numSpoolFileMetric;
-    public static final SpoolingMetricsHolder NO_OP_INSTANCE = new 
SpoolingMetricsHolder(new ReadMetricQueue(LogLevel.OFF), "");
+    public static final SpoolingMetricsHolder NO_OP_INSTANCE = new 
SpoolingMetricsHolder(new ReadMetricQueue(false,LogLevel.OFF), "");
 
     public SpoolingMetricsHolder(ReadMetricQueue readMetrics, String 
tableName) {
         this.spoolFileSizeMetric = 
readMetrics.allotMetric(MetricType.SPOOL_FILE_SIZE, tableName);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/main/java/org/apache/phoenix/monitoring/TaskExecutionMetricsHolder.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/TaskExecutionMetricsHolder.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/TaskExecutionMetricsHolder.java
index 6117b40..531a6b3 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/monitoring/TaskExecutionMetricsHolder.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/monitoring/TaskExecutionMetricsHolder.java
@@ -37,7 +37,7 @@ public class TaskExecutionMetricsHolder {
     private final CombinableMetric taskExecutionTime;
     private final CombinableMetric numTasks;
     private final CombinableMetric numRejectedTasks;
-    public static final TaskExecutionMetricsHolder NO_OP_INSTANCE = new 
TaskExecutionMetricsHolder(new ReadMetricQueue(LogLevel.OFF), "");
+    public static final TaskExecutionMetricsHolder NO_OP_INSTANCE = new 
TaskExecutionMetricsHolder(new ReadMetricQueue(false,LogLevel.OFF), "");
     
     public TaskExecutionMetricsHolder(ReadMetricQueue readMetrics, String 
tableName) {
         taskQueueWaitTime = readMetrics.allotMetric(TASK_QUEUE_WAIT_TIME, 
tableName);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/fc2a5164/phoenix-core/src/test/java/org/apache/phoenix/iterate/SpoolingResultIteratorTest.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/test/java/org/apache/phoenix/iterate/SpoolingResultIteratorTest.java
 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/SpoolingResultIteratorTest.java
index d858e72..0e5684c 100644
--- 
a/phoenix-core/src/test/java/org/apache/phoenix/iterate/SpoolingResultIteratorTest.java
+++ 
b/phoenix-core/src/test/java/org/apache/phoenix/iterate/SpoolingResultIteratorTest.java
@@ -58,7 +58,7 @@ public class SpoolingResultIteratorTest {
         MemoryManager memoryManager = new DelegatingMemoryManager(new 
GlobalMemoryManager(threshold));
         ResultIterator scanner = new SpoolingResultIterator(
                 SpoolingMetricsHolder.NO_OP_INSTANCE,
-                new MemoryMetricsHolder(new ReadMetricQueue(LogLevel.OFF), 
""), iterator, memoryManager, threshold,
+                new MemoryMetricsHolder(new 
ReadMetricQueue(false,LogLevel.OFF), ""), iterator, memoryManager, threshold,
                 maxSizeSpool, "/tmp");
         AssertResults.assertResults(scanner, expectedResults);
     }

Reply via email to