phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject [37/50] [abbrv] phoenix git commit: PHOENIX-2688 Remove unused mergeRegions for statistics collection
Date Wed, 24 Feb 2016 21:13:55 GMT
PHOENIX-2688 Remove unused mergeRegions for statistics collection


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

Branch: refs/heads/calcite
Commit: 5127a6565ea286222ea0ebf9f61fd5737d5b8009
Parents: c316d91
Author: James Taylor <jtaylor@salesforce.com>
Authored: Wed Feb 17 12:27:11 2016 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Wed Feb 17 12:27:11 2016 -0800

----------------------------------------------------------------------
 .../coprocessor/UngroupedAggregateRegionObserver.java     |  9 +--------
 .../apache/phoenix/schema/stats/StatisticsCollector.java  | 10 ++++------
 .../apache/phoenix/schema/stats/StatisticsScanner.java    |  5 +----
 3 files changed, 6 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/5127a656/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
index e000e25..d850eab 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
@@ -44,9 +44,7 @@ import org.apache.hadoop.hbase.CoprocessorEnvironment;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.MetaTableAccessor;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.Connection;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Mutation;
@@ -609,16 +607,11 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver
         InternalScanner internalScanner = scanner;
         if (scanType.equals(ScanType.COMPACT_DROP_DELETES)) {
             try {
-                Connection conn = c.getEnvironment().getRegionServerServices().getConnection();
                 Pair<HRegionInfo, HRegionInfo> mergeRegions = null;
-                if (store.hasReferences()) {
-                    mergeRegions = MetaTableAccessor.getRegionsFromMergeQualifier(conn,
-                            c.getEnvironment().getRegion().getRegionInfo().getRegionName());
-                }
                 long clientTimeStamp = TimeKeeper.SYSTEM.getCurrentTime();
                 StatisticsCollector stats = new StatisticsCollector(c.getEnvironment(), table.getNameAsString(),
                         clientTimeStamp, store.getFamily().getName());
-                internalScanner = stats.createCompactionScanner(c.getEnvironment(), store,
scanner, mergeRegions);
+                internalScanner = stats.createCompactionScanner(c.getEnvironment(), store,
scanner);
             } catch (IOException e) {
                 // If we can't reach the stats table, don't interrupt the normal
                 // compaction operation, just log a warning.

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5127a656/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsCollector.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsCollector.java
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsCollector.java
index 1d0204f..185ceb8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsCollector.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsCollector.java
@@ -24,7 +24,6 @@ import java.util.Map;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
-import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.client.Mutation;
@@ -197,19 +196,18 @@ public class StatisticsCollector {
         }
     }
 
-    public InternalScanner createCompactionScanner(RegionCoprocessorEnvironment env, Store
store, InternalScanner s,
-            Pair<HRegionInfo, HRegionInfo> mergeRegions) throws IOException {
+    public InternalScanner createCompactionScanner(RegionCoprocessorEnvironment env, Store
store, InternalScanner s) throws IOException {
         // See if this is for Major compaction
         if (logger.isDebugEnabled()) {
             logger.debug("Compaction scanner created for stats");
         }
         ImmutableBytesPtr cfKey = new ImmutableBytesPtr(store.getFamily().getName());
-        return getInternalScanner(env, store, s, cfKey, mergeRegions);
+        return getInternalScanner(env, store, s, cfKey);
     }
 
     protected InternalScanner getInternalScanner(RegionCoprocessorEnvironment env, Store
store,
-            InternalScanner internalScan, ImmutableBytesPtr family, Pair<HRegionInfo,
HRegionInfo> mergeRegions) {
-        return new StatisticsScanner(this, statsTable, env, internalScan, family, mergeRegions);
+            InternalScanner internalScan, ImmutableBytesPtr family) {
+        return new StatisticsScanner(this, statsTable, env, internalScan, family);
     }
 
     public void clear() {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/5127a656/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsScanner.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsScanner.java
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsScanner.java
index 13e9491..d798aa2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsScanner.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsScanner.java
@@ -36,7 +36,6 @@ import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 import org.apache.hadoop.hbase.regionserver.InternalScanner;
 import org.apache.hadoop.hbase.regionserver.Region;
 import org.apache.hadoop.hbase.regionserver.ScannerContext;
-import org.apache.hadoop.hbase.util.Pair;
 import org.apache.phoenix.hbase.index.util.ImmutableBytesPtr;
 
 /**
@@ -49,17 +48,15 @@ public class StatisticsScanner implements InternalScanner {
     private Region region;
     private StatisticsCollector tracker;
     private ImmutableBytesPtr family;
-    private Pair<HRegionInfo, HRegionInfo> mergeRegions;
     private final Configuration config;
 
     public StatisticsScanner(StatisticsCollector tracker, StatisticsWriter stats, RegionCoprocessorEnvironment
env,
-            InternalScanner delegate, ImmutableBytesPtr family, Pair<HRegionInfo, HRegionInfo>
mergeRegions) {
+            InternalScanner delegate, ImmutableBytesPtr family) {
         this.tracker = tracker;
         this.stats = stats;
         this.delegate = delegate;
         this.region = env.getRegion();
         this.family = family;
-        this.mergeRegions = mergeRegions;
         this.config = env.getConfiguration();
         StatisticsCollectionRunTracker.getInstance(config).addCompactingRegion(region.getRegionInfo());
     }


Mime
View raw message