phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [1/3] phoenix git commit: PHOENIX-1434 Stats are not maintained correctly through splits (Mujtaba)
Date Wed, 12 Nov 2014 18:02:38 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.0 4c2f37160 -> dbd3d6257


PHOENIX-1434 Stats are not maintained correctly through splits (Mujtaba)


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

Branch: refs/heads/4.0
Commit: 127a92d4e2a460d5192dc3e6d65396d605a04278
Parents: 4c2f371
Author: James Taylor <jtaylor@salesforce.com>
Authored: Wed Nov 12 09:06:11 2014 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Wed Nov 12 09:06:11 2014 -0800

----------------------------------------------------------------------
 .../phoenix/schema/stats/StatisticsCollector.java       |  4 ++--
 .../apache/phoenix/schema/stats/StatisticsScanner.java  |  4 ++--
 .../apache/phoenix/schema/stats/StatisticsWriter.java   | 12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/127a92d4/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 5212ff9..90c8324 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
@@ -123,13 +123,13 @@ public class StatisticsCollector {
                     if(logger.isDebugEnabled()) {
                         logger.debug("Deleting the stats for the region "+region.getRegionInfo());
                     }
-                    statsTable.deleteStats(region.getRegionInfo().getRegionNameAsString(),
this, Bytes.toString(fam.copyBytesIfNecessary()),
+                    statsTable.deleteStats(region.getRegionInfo().getRegionName(), this,
Bytes.toString(fam.copyBytesIfNecessary()),
                             mutations);
                 }
                 if(logger.isDebugEnabled()) {
                     logger.debug("Adding new stats for the region "+region.getRegionInfo());
                 }
-                statsTable.addStats((region.getRegionInfo().getRegionNameAsString()), this,
Bytes.toString(fam.copyBytesIfNecessary()),
+                statsTable.addStats((region.getRegionInfo().getRegionName()), this, Bytes.toString(fam.copyBytesIfNecessary()),
                         mutations);
             }
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/phoenix/blob/127a92d4/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 3a84cfc..fa3930d 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
@@ -83,12 +83,12 @@ public class StatisticsScanner implements InternalScanner {
                 LOG.debug("Deleting the stats for the region " + region.getRegionNameAsString()
                         + " as part of major compaction");
             }
-            stats.deleteStats(region.getRegionNameAsString(), this.tracker, Bytes.toString(family),
mutations);
+            stats.deleteStats(region.getRegionName(), this.tracker, Bytes.toString(family),
mutations);
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Adding new stats for the region " + region.getRegionNameAsString()
                         + " as part of major compaction");
             }
-            stats.addStats(region.getRegionNameAsString(), this.tracker, Bytes.toString(family),
mutations);
+            stats.addStats(region.getRegionName(), this.tracker, Bytes.toString(family),
mutations);
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Committing new stats for the region " + region.getRegionNameAsString()
                         + " as part of major compaction");

http://git-wip-us.apache.org/repos/asf/phoenix/blob/127a92d4/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsWriter.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsWriter.java
b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsWriter.java
index 9e2d659..6681042 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsWriter.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/schema/stats/StatisticsWriter.java
@@ -130,13 +130,13 @@ public class StatisticsWriter implements Closeable {
 	                GuidePostsInfo lguidePosts = new GuidePostsInfo(byteSize, guidePosts.getGuidePosts().subList(0,
midEndIndex));
 	                tracker.clear();
 	                tracker.addGuidePost(fam, lguidePosts, byteSize, cell.getTimestamp());
-	                addStats(l.getRegionNameAsString(), tracker, fam, mutations);
+	                addStats(l.getRegionName(), tracker, fam, mutations);
 	            }
 	            if (midStartIndex < guidePosts.getGuidePosts().size()) {
 	                GuidePostsInfo rguidePosts = new GuidePostsInfo(byteSize, guidePosts.getGuidePosts().subList(midStartIndex,
guidePosts.getGuidePosts().size()));
 	                tracker.clear();
 	                tracker.addGuidePost(fam, rguidePosts, byteSize, cell.getTimestamp());
-	                addStats(r.getRegionNameAsString(), tracker, fam, mutations);
+	                addStats(r.getRegionName(), tracker, fam, mutations);
 	            }
         	}
         }
@@ -157,7 +157,7 @@ public class StatisticsWriter implements Closeable {
      *             if we fail to do any of the puts. Any single failure will prevent any
future attempts for the remaining list of stats to
      *             update
      */
-    public void addStats(String regionName, StatisticsCollector tracker, String fam, List<Mutation>
mutations) throws IOException {
+    public void addStats(byte[] regionName, StatisticsCollector tracker, String fam, List<Mutation>
mutations) throws IOException {
         if (tracker == null) { return; }
         boolean useMaxTimeStamp = clientTimeStamp == StatisticsCollector.NO_TIMESTAMP;
         long timeStamp = clientTimeStamp;
@@ -166,7 +166,7 @@ public class StatisticsWriter implements Closeable {
             mutations.add(getLastStatsUpdatedTimePut(timeStamp));
         }
         byte[] prefix = StatisticsUtil.getRowKey(tableName, PDataType.VARCHAR.toBytes(fam),
-                PDataType.VARCHAR.toBytes(regionName));
+                regionName);
         Put put = new Put(prefix);
         GuidePostsInfo gp = tracker.getGuidePosts(fam);
         if (gp != null) {
@@ -238,11 +238,11 @@ public class StatisticsWriter implements Closeable {
         statisticsTable.put(put);
     }
     
-    public void deleteStats(String regionName, StatisticsCollector tracker, String fam, List<Mutation>
mutations)
+    public void deleteStats(byte[] regionName, StatisticsCollector tracker, String fam, List<Mutation>
mutations)
             throws IOException {
         long timeStamp = clientTimeStamp == StatisticsCollector.NO_TIMESTAMP ? tracker.getMaxTimeStamp()
: clientTimeStamp;
         byte[] prefix = StatisticsUtil.getRowKey(tableName, PDataType.VARCHAR.toBytes(fam),
-                PDataType.VARCHAR.toBytes(regionName));
+                regionName);
         mutations.add(new Delete(prefix, timeStamp - 1));
     }
 }
\ No newline at end of file


Mime
View raw message