phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maryann...@apache.org
Subject [15/50] [abbrv] phoenix git commit: PHOENIX-2417 Compress memory used by row key byte[] of guideposts (Ankit Singhal)
Date Tue, 02 Feb 2016 03:59:49 GMT
PHOENIX-2417 Compress memory used by row key byte[] of guideposts (Ankit Singhal)


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

Branch: refs/heads/calcite
Commit: 6a27cecce312002f9b7f76ffdcafcb694f5e3ea8
Parents: 4d323b6
Author: James Taylor <jtaylor@salesforce.com>
Authored: Wed Jan 20 09:57:14 2016 -0800
Committer: James Taylor <jtaylor@salesforce.com>
Committed: Wed Jan 20 10:20:45 2016 -0800

----------------------------------------------------------------------
 .../coprocessor/MetaDataRegionObserver.java     |   71 +-
 .../generated/PGuidePostsProtos.java            |  287 +++-
 .../generated/StatCollectorProtos.java          | 1269 ------------------
 .../org/apache/phoenix/execute/ScanPlan.java    |    2 +-
 .../phoenix/iterate/BaseResultIterators.java    |  138 +-
 .../org/apache/phoenix/schema/PTableImpl.java   |   39 +-
 .../phoenix/schema/stats/GuidePostsInfo.java    |  106 +-
 .../schema/stats/GuidePostsInfoBuilder.java     |  113 ++
 .../phoenix/schema/stats/PTableStatsImpl.java   |   45 +-
 .../schema/stats/StatisticsCollector.java       |   46 +-
 .../phoenix/schema/stats/StatisticsScanner.java |    3 +-
 .../phoenix/schema/stats/StatisticsUtil.java    |   36 +-
 .../phoenix/schema/stats/StatisticsWriter.java  |   46 +-
 .../java/org/apache/phoenix/util/ByteUtil.java  |    2 +
 .../apache/phoenix/util/PrefixByteCodec.java    |  104 ++
 .../apache/phoenix/util/PrefixByteDecoder.java  |   90 ++
 .../apache/phoenix/util/PrefixByteEncoder.java  |   99 ++
 .../org/apache/phoenix/util/UpgradeUtil.java    |   68 +-
 .../phoenix/filter/SkipScanBigFilterTest.java   |    8 +-
 .../util/PrefixByteEncoderDecoderTest.java      |   96 ++
 phoenix-protocol/src/main/PGuidePosts.proto     |    3 +
 21 files changed, 1140 insertions(+), 1531 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/6a27cecc/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
index c40e3cd..7950ac8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataRegionObserver.java
@@ -18,10 +18,6 @@
 package org.apache.phoenix.coprocessor;
 
 import java.io.IOException;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.phoenix.jdbc.PhoenixDriver;
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.util.ArrayList;
@@ -36,28 +32,34 @@ import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CoprocessorEnvironment;
 import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.HTableInterface;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver;
 import org.apache.hadoop.hbase.coprocessor.ObserverContext;
 import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
-import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 import org.apache.hadoop.hbase.filter.CompareFilter;
+import org.apache.hadoop.hbase.filter.SingleColumnValueFilter;
 import org.apache.hadoop.hbase.regionserver.RegionScanner;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
 import org.apache.phoenix.cache.GlobalCache;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.jdbc.PhoenixDatabaseMetaData;
+import org.apache.phoenix.jdbc.PhoenixDriver;
 import org.apache.phoenix.query.QueryServices;
 import org.apache.phoenix.query.QueryServicesOptions;
 import org.apache.phoenix.schema.MetaDataClient;
 import org.apache.phoenix.schema.PIndexState;
-import org.apache.phoenix.schema.types.PLong;
 import org.apache.phoenix.schema.PTable;
 import org.apache.phoenix.schema.TableRef;
+import org.apache.phoenix.schema.types.PLong;
 import org.apache.phoenix.util.MetaDataUtil;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.apache.phoenix.util.SchemaUtil;
+import org.apache.phoenix.util.UpgradeUtil;
 
 
 /**
@@ -96,10 +98,52 @@ public class MetaDataRegionObserver extends BaseRegionObserver {
         rebuildIndexTimeInterval = env.getConfiguration().getLong(QueryServices.INDEX_FAILURE_HANDLING_REBUILD_INTERVAL_ATTRIB,
             QueryServicesOptions.DEFAULT_INDEX_FAILURE_HANDLING_REBUILD_INTERVAL);
     }
-
+    
+    private static String getJdbcUrl(RegionCoprocessorEnvironment env) {
+        String zkQuorum = env.getConfiguration().get(HConstants.ZOOKEEPER_QUORUM);
+        String zkClientPort = env.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT,
+            Integer.toString(HConstants.DEFAULT_ZOOKEPER_CLIENT_PORT));
+        String zkParentNode = env.getConfiguration().get(HConstants.ZOOKEEPER_ZNODE_PARENT,
+            HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
+        return PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum
+            + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkClientPort
+            + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkParentNode;
+    }
 
     @Override
     public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) {
+        final RegionCoprocessorEnvironment env = e.getEnvironment();
+
+        Runnable r = new Runnable() {
+            @Override
+            public void run() {
+                HTableInterface metaTable = null;
+                HTableInterface statsTable = null;
+                try {
+                    Thread.sleep(1000);
+                    metaTable = env.getTable(TableName.valueOf(PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME));
+                    statsTable = env.getTable(TableName.valueOf(PhoenixDatabaseMetaData.SYSTEM_STATS_NAME));
+                    if (UpgradeUtil.truncateStats(metaTable, statsTable)) {
+                        LOG.info("Stats are successfully truncated for upgrade 4.7!!");
+                    }
+                } catch (Exception exception) {
+                    LOG.warn("Exception while truncate stats..,"
+                            + " please check and delete stats manually inorder to get proper result with old client!!");
+                    LOG.warn(exception.getStackTrace());
+                } finally {
+                    try {
+                        if (metaTable != null) {
+                            metaTable.close();
+                        }
+                        if (statsTable != null) {
+                            statsTable.close();
+                        }
+                    } catch (IOException e) {}
+                }
+            }
+        };
+        (new Thread(r)).start();
+
         if (!enableRebuildIndex) {
             LOG.info("Failure Index Rebuild is skipped by configuration.");
             return;
@@ -134,17 +178,6 @@ public class MetaDataRegionObserver extends BaseRegionObserver {
             this.env = env;
         }
 
-        private String getJdbcUrl() {
-            String zkQuorum = this.env.getConfiguration().get(HConstants.ZOOKEEPER_QUORUM);
-            String zkClientPort = this.env.getConfiguration().get(HConstants.ZOOKEEPER_CLIENT_PORT,
-                Integer.toString(HConstants.DEFAULT_ZOOKEPER_CLIENT_PORT));
-            String zkParentNode = this.env.getConfiguration().get(HConstants.ZOOKEEPER_ZNODE_PARENT,
-                HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
-            return PhoenixRuntime.JDBC_PROTOCOL + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkQuorum
-                + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkClientPort
-                + PhoenixRuntime.JDBC_PROTOCOL_SEPARATOR + zkParentNode;
-        }
-
         @Override
         public void run() {
             RegionScanner scanner = null;
@@ -219,7 +252,7 @@ public class MetaDataRegionObserver extends BaseRegionObserver {
                     }
 
                     if (conn == null) {
-                        conn = DriverManager.getConnection(getJdbcUrl()).unwrap(PhoenixConnection.class);
+                        conn = DriverManager.getConnection(getJdbcUrl(env)).unwrap(PhoenixConnection.class);
                     }
 
                     String dataTableFullName = SchemaUtil.getTableName(schemaName, dataTable);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6a27cecc/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/PGuidePostsProtos.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/PGuidePostsProtos.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/PGuidePostsProtos.java
index 9f96530..d9dcb56 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/PGuidePostsProtos.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/PGuidePostsProtos.java
@@ -44,6 +44,36 @@ public final class PGuidePostsProtos {
      * <code>optional int64 rowCount = 3;</code>
      */
     long getRowCount();
+
+    // optional int32 maxLength = 4;
+    /**
+     * <code>optional int32 maxLength = 4;</code>
+     */
+    boolean hasMaxLength();
+    /**
+     * <code>optional int32 maxLength = 4;</code>
+     */
+    int getMaxLength();
+
+    // optional int32 encodedGuidePostsCount = 5;
+    /**
+     * <code>optional int32 encodedGuidePostsCount = 5;</code>
+     */
+    boolean hasEncodedGuidePostsCount();
+    /**
+     * <code>optional int32 encodedGuidePostsCount = 5;</code>
+     */
+    int getEncodedGuidePostsCount();
+
+    // optional bytes encodedGuidePosts = 6;
+    /**
+     * <code>optional bytes encodedGuidePosts = 6;</code>
+     */
+    boolean hasEncodedGuidePosts();
+    /**
+     * <code>optional bytes encodedGuidePosts = 6;</code>
+     */
+    com.google.protobuf.ByteString getEncodedGuidePosts();
   }
   /**
    * Protobuf type {@code PGuidePosts}
@@ -114,6 +144,21 @@ public final class PGuidePostsProtos {
               rowCount_ = input.readInt64();
               break;
             }
+            case 32: {
+              bitField0_ |= 0x00000004;
+              maxLength_ = input.readInt32();
+              break;
+            }
+            case 40: {
+              bitField0_ |= 0x00000008;
+              encodedGuidePostsCount_ = input.readInt32();
+              break;
+            }
+            case 50: {
+              bitField0_ |= 0x00000010;
+              encodedGuidePosts_ = input.readBytes();
+              break;
+            }
           }
         }
       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
@@ -212,10 +257,61 @@ public final class PGuidePostsProtos {
       return rowCount_;
     }
 
+    // optional int32 maxLength = 4;
+    public static final int MAXLENGTH_FIELD_NUMBER = 4;
+    private int maxLength_;
+    /**
+     * <code>optional int32 maxLength = 4;</code>
+     */
+    public boolean hasMaxLength() {
+      return ((bitField0_ & 0x00000004) == 0x00000004);
+    }
+    /**
+     * <code>optional int32 maxLength = 4;</code>
+     */
+    public int getMaxLength() {
+      return maxLength_;
+    }
+
+    // optional int32 encodedGuidePostsCount = 5;
+    public static final int ENCODEDGUIDEPOSTSCOUNT_FIELD_NUMBER = 5;
+    private int encodedGuidePostsCount_;
+    /**
+     * <code>optional int32 encodedGuidePostsCount = 5;</code>
+     */
+    public boolean hasEncodedGuidePostsCount() {
+      return ((bitField0_ & 0x00000008) == 0x00000008);
+    }
+    /**
+     * <code>optional int32 encodedGuidePostsCount = 5;</code>
+     */
+    public int getEncodedGuidePostsCount() {
+      return encodedGuidePostsCount_;
+    }
+
+    // optional bytes encodedGuidePosts = 6;
+    public static final int ENCODEDGUIDEPOSTS_FIELD_NUMBER = 6;
+    private com.google.protobuf.ByteString encodedGuidePosts_;
+    /**
+     * <code>optional bytes encodedGuidePosts = 6;</code>
+     */
+    public boolean hasEncodedGuidePosts() {
+      return ((bitField0_ & 0x00000010) == 0x00000010);
+    }
+    /**
+     * <code>optional bytes encodedGuidePosts = 6;</code>
+     */
+    public com.google.protobuf.ByteString getEncodedGuidePosts() {
+      return encodedGuidePosts_;
+    }
+
     private void initFields() {
       guidePosts_ = java.util.Collections.emptyList();
       byteCount_ = 0L;
       rowCount_ = 0L;
+      maxLength_ = 0;
+      encodedGuidePostsCount_ = 0;
+      encodedGuidePosts_ = com.google.protobuf.ByteString.EMPTY;
     }
     private byte memoizedIsInitialized = -1;
     public final boolean isInitialized() {
@@ -238,6 +334,15 @@ public final class PGuidePostsProtos {
       if (((bitField0_ & 0x00000002) == 0x00000002)) {
         output.writeInt64(3, rowCount_);
       }
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        output.writeInt32(4, maxLength_);
+      }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        output.writeInt32(5, encodedGuidePostsCount_);
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        output.writeBytes(6, encodedGuidePosts_);
+      }
       getUnknownFields().writeTo(output);
     }
 
@@ -264,6 +369,18 @@ public final class PGuidePostsProtos {
         size += com.google.protobuf.CodedOutputStream
           .computeInt64Size(3, rowCount_);
       }
+      if (((bitField0_ & 0x00000004) == 0x00000004)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(4, maxLength_);
+      }
+      if (((bitField0_ & 0x00000008) == 0x00000008)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeInt32Size(5, encodedGuidePostsCount_);
+      }
+      if (((bitField0_ & 0x00000010) == 0x00000010)) {
+        size += com.google.protobuf.CodedOutputStream
+          .computeBytesSize(6, encodedGuidePosts_);
+      }
       size += getUnknownFields().getSerializedSize();
       memoizedSerializedSize = size;
       return size;
@@ -299,6 +416,21 @@ public final class PGuidePostsProtos {
         result = result && (getRowCount()
             == other.getRowCount());
       }
+      result = result && (hasMaxLength() == other.hasMaxLength());
+      if (hasMaxLength()) {
+        result = result && (getMaxLength()
+            == other.getMaxLength());
+      }
+      result = result && (hasEncodedGuidePostsCount() == other.hasEncodedGuidePostsCount());
+      if (hasEncodedGuidePostsCount()) {
+        result = result && (getEncodedGuidePostsCount()
+            == other.getEncodedGuidePostsCount());
+      }
+      result = result && (hasEncodedGuidePosts() == other.hasEncodedGuidePosts());
+      if (hasEncodedGuidePosts()) {
+        result = result && getEncodedGuidePosts()
+            .equals(other.getEncodedGuidePosts());
+      }
       result = result &&
           getUnknownFields().equals(other.getUnknownFields());
       return result;
@@ -324,6 +456,18 @@ public final class PGuidePostsProtos {
         hash = (37 * hash) + ROWCOUNT_FIELD_NUMBER;
         hash = (53 * hash) + hashLong(getRowCount());
       }
+      if (hasMaxLength()) {
+        hash = (37 * hash) + MAXLENGTH_FIELD_NUMBER;
+        hash = (53 * hash) + getMaxLength();
+      }
+      if (hasEncodedGuidePostsCount()) {
+        hash = (37 * hash) + ENCODEDGUIDEPOSTSCOUNT_FIELD_NUMBER;
+        hash = (53 * hash) + getEncodedGuidePostsCount();
+      }
+      if (hasEncodedGuidePosts()) {
+        hash = (37 * hash) + ENCODEDGUIDEPOSTS_FIELD_NUMBER;
+        hash = (53 * hash) + getEncodedGuidePosts().hashCode();
+      }
       hash = (29 * hash) + getUnknownFields().hashCode();
       memoizedHashCode = hash;
       return hash;
@@ -439,6 +583,12 @@ public final class PGuidePostsProtos {
         bitField0_ = (bitField0_ & ~0x00000002);
         rowCount_ = 0L;
         bitField0_ = (bitField0_ & ~0x00000004);
+        maxLength_ = 0;
+        bitField0_ = (bitField0_ & ~0x00000008);
+        encodedGuidePostsCount_ = 0;
+        bitField0_ = (bitField0_ & ~0x00000010);
+        encodedGuidePosts_ = com.google.protobuf.ByteString.EMPTY;
+        bitField0_ = (bitField0_ & ~0x00000020);
         return this;
       }
 
@@ -480,6 +630,18 @@ public final class PGuidePostsProtos {
           to_bitField0_ |= 0x00000002;
         }
         result.rowCount_ = rowCount_;
+        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
+          to_bitField0_ |= 0x00000004;
+        }
+        result.maxLength_ = maxLength_;
+        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
+          to_bitField0_ |= 0x00000008;
+        }
+        result.encodedGuidePostsCount_ = encodedGuidePostsCount_;
+        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
+          to_bitField0_ |= 0x00000010;
+        }
+        result.encodedGuidePosts_ = encodedGuidePosts_;
         result.bitField0_ = to_bitField0_;
         onBuilt();
         return result;
@@ -512,6 +674,15 @@ public final class PGuidePostsProtos {
         if (other.hasRowCount()) {
           setRowCount(other.getRowCount());
         }
+        if (other.hasMaxLength()) {
+          setMaxLength(other.getMaxLength());
+        }
+        if (other.hasEncodedGuidePostsCount()) {
+          setEncodedGuidePostsCount(other.getEncodedGuidePostsCount());
+        }
+        if (other.hasEncodedGuidePosts()) {
+          setEncodedGuidePosts(other.getEncodedGuidePosts());
+        }
         this.mergeUnknownFields(other.getUnknownFields());
         return this;
       }
@@ -677,6 +848,108 @@ public final class PGuidePostsProtos {
         return this;
       }
 
+      // optional int32 maxLength = 4;
+      private int maxLength_ ;
+      /**
+       * <code>optional int32 maxLength = 4;</code>
+       */
+      public boolean hasMaxLength() {
+        return ((bitField0_ & 0x00000008) == 0x00000008);
+      }
+      /**
+       * <code>optional int32 maxLength = 4;</code>
+       */
+      public int getMaxLength() {
+        return maxLength_;
+      }
+      /**
+       * <code>optional int32 maxLength = 4;</code>
+       */
+      public Builder setMaxLength(int value) {
+        bitField0_ |= 0x00000008;
+        maxLength_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional int32 maxLength = 4;</code>
+       */
+      public Builder clearMaxLength() {
+        bitField0_ = (bitField0_ & ~0x00000008);
+        maxLength_ = 0;
+        onChanged();
+        return this;
+      }
+
+      // optional int32 encodedGuidePostsCount = 5;
+      private int encodedGuidePostsCount_ ;
+      /**
+       * <code>optional int32 encodedGuidePostsCount = 5;</code>
+       */
+      public boolean hasEncodedGuidePostsCount() {
+        return ((bitField0_ & 0x00000010) == 0x00000010);
+      }
+      /**
+       * <code>optional int32 encodedGuidePostsCount = 5;</code>
+       */
+      public int getEncodedGuidePostsCount() {
+        return encodedGuidePostsCount_;
+      }
+      /**
+       * <code>optional int32 encodedGuidePostsCount = 5;</code>
+       */
+      public Builder setEncodedGuidePostsCount(int value) {
+        bitField0_ |= 0x00000010;
+        encodedGuidePostsCount_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional int32 encodedGuidePostsCount = 5;</code>
+       */
+      public Builder clearEncodedGuidePostsCount() {
+        bitField0_ = (bitField0_ & ~0x00000010);
+        encodedGuidePostsCount_ = 0;
+        onChanged();
+        return this;
+      }
+
+      // optional bytes encodedGuidePosts = 6;
+      private com.google.protobuf.ByteString encodedGuidePosts_ = com.google.protobuf.ByteString.EMPTY;
+      /**
+       * <code>optional bytes encodedGuidePosts = 6;</code>
+       */
+      public boolean hasEncodedGuidePosts() {
+        return ((bitField0_ & 0x00000020) == 0x00000020);
+      }
+      /**
+       * <code>optional bytes encodedGuidePosts = 6;</code>
+       */
+      public com.google.protobuf.ByteString getEncodedGuidePosts() {
+        return encodedGuidePosts_;
+      }
+      /**
+       * <code>optional bytes encodedGuidePosts = 6;</code>
+       */
+      public Builder setEncodedGuidePosts(com.google.protobuf.ByteString value) {
+        if (value == null) {
+    throw new NullPointerException();
+  }
+  bitField0_ |= 0x00000020;
+        encodedGuidePosts_ = value;
+        onChanged();
+        return this;
+      }
+      /**
+       * <code>optional bytes encodedGuidePosts = 6;</code>
+       */
+      public Builder clearEncodedGuidePosts() {
+        bitField0_ = (bitField0_ & ~0x00000020);
+        encodedGuidePosts_ = getDefaultInstance().getEncodedGuidePosts();
+        onChanged();
+        return this;
+      }
+
       // @@protoc_insertion_point(builder_scope:PGuidePosts)
     }
 
@@ -702,11 +975,13 @@ public final class PGuidePostsProtos {
       descriptor;
   static {
     java.lang.String[] descriptorData = {
-      "\n\021PGuidePosts.proto\"F\n\013PGuidePosts\022\022\n\ngu" +
-      "idePosts\030\001 \003(\014\022\021\n\tbyteCount\030\002 \001(\003\022\020\n\010row" +
-      "Count\030\003 \001(\003BE\n(org.apache.phoenix.coproc" +
-      "essor.generatedB\021PGuidePostsProtosH\001\210\001\001\240" +
-      "\001\001"
+      "\n\021PGuidePosts.proto\"\224\001\n\013PGuidePosts\022\022\n\ng" +
+      "uidePosts\030\001 \003(\014\022\021\n\tbyteCount\030\002 \001(\003\022\020\n\010ro" +
+      "wCount\030\003 \001(\003\022\021\n\tmaxLength\030\004 \001(\005\022\036\n\026encod" +
+      "edGuidePostsCount\030\005 \001(\005\022\031\n\021encodedGuideP" +
+      "osts\030\006 \001(\014BE\n(org.apache.phoenix.coproce" +
+      "ssor.generatedB\021PGuidePostsProtosH\001\210\001\001\240\001" +
+      "\001"
     };
     com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
       new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -718,7 +993,7 @@ public final class PGuidePostsProtos {
           internal_static_PGuidePosts_fieldAccessorTable = new
             com.google.protobuf.GeneratedMessage.FieldAccessorTable(
               internal_static_PGuidePosts_descriptor,
-              new java.lang.String[] { "GuidePosts", "ByteCount", "RowCount", });
+              new java.lang.String[] { "GuidePosts", "ByteCount", "RowCount", "MaxLength", "EncodedGuidePostsCount", "EncodedGuidePosts", });
           return null;
         }
       };

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6a27cecc/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/StatCollectorProtos.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/StatCollectorProtos.java b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/StatCollectorProtos.java
deleted file mode 100644
index 5008f22..0000000
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/generated/StatCollectorProtos.java
+++ /dev/null
@@ -1,1269 +0,0 @@
-// Generated by the protocol buffer compiler.  DO NOT EDIT!
-// source: StatisticsCollect.proto
-
-package org.apache.phoenix.coprocessor.generated;
-
-public final class StatCollectorProtos {
-  private StatCollectorProtos() {}
-  public static void registerAllExtensions(
-      com.google.protobuf.ExtensionRegistry registry) {
-  }
-  public interface StatCollectRequestOrBuilder
-      extends com.google.protobuf.MessageOrBuilder {
-
-    // optional bytes startRow = 1;
-    /**
-     * <code>optional bytes startRow = 1;</code>
-     */
-    boolean hasStartRow();
-    /**
-     * <code>optional bytes startRow = 1;</code>
-     */
-    com.google.protobuf.ByteString getStartRow();
-
-    // optional bytes stopRow = 2;
-    /**
-     * <code>optional bytes stopRow = 2;</code>
-     */
-    boolean hasStopRow();
-    /**
-     * <code>optional bytes stopRow = 2;</code>
-     */
-    com.google.protobuf.ByteString getStopRow();
-  }
-  /**
-   * Protobuf type {@code StatCollectRequest}
-   */
-  public static final class StatCollectRequest extends
-      com.google.protobuf.GeneratedMessage
-      implements StatCollectRequestOrBuilder {
-    // Use StatCollectRequest.newBuilder() to construct.
-    private StatCollectRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private StatCollectRequest(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
-
-    private static final StatCollectRequest defaultInstance;
-    public static StatCollectRequest getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public StatCollectRequest getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.UnknownFieldSet unknownFields;
-    @java.lang.Override
-    public final com.google.protobuf.UnknownFieldSet
-        getUnknownFields() {
-      return this.unknownFields;
-    }
-    private StatCollectRequest(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
-          com.google.protobuf.UnknownFieldSet.newBuilder();
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFields,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 10: {
-              bitField0_ |= 0x00000001;
-              startRow_ = input.readBytes();
-              break;
-            }
-            case 18: {
-              bitField0_ |= 0x00000002;
-              stopRow_ = input.readBytes();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        this.unknownFields = unknownFields.build();
-        makeExtensionsImmutable();
-      }
-    }
-    public static final com.google.protobuf.Descriptors.Descriptor
-        getDescriptor() {
-      return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectRequest_descriptor;
-    }
-
-    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
-        internalGetFieldAccessorTable() {
-      return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectRequest_fieldAccessorTable
-          .ensureFieldAccessorsInitialized(
-              org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.class, org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.Builder.class);
-    }
-
-    public static com.google.protobuf.Parser<StatCollectRequest> PARSER =
-        new com.google.protobuf.AbstractParser<StatCollectRequest>() {
-      public StatCollectRequest parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new StatCollectRequest(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<StatCollectRequest> getParserForType() {
-      return PARSER;
-    }
-
-    private int bitField0_;
-    // optional bytes startRow = 1;
-    public static final int STARTROW_FIELD_NUMBER = 1;
-    private com.google.protobuf.ByteString startRow_;
-    /**
-     * <code>optional bytes startRow = 1;</code>
-     */
-    public boolean hasStartRow() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
-    }
-    /**
-     * <code>optional bytes startRow = 1;</code>
-     */
-    public com.google.protobuf.ByteString getStartRow() {
-      return startRow_;
-    }
-
-    // optional bytes stopRow = 2;
-    public static final int STOPROW_FIELD_NUMBER = 2;
-    private com.google.protobuf.ByteString stopRow_;
-    /**
-     * <code>optional bytes stopRow = 2;</code>
-     */
-    public boolean hasStopRow() {
-      return ((bitField0_ & 0x00000002) == 0x00000002);
-    }
-    /**
-     * <code>optional bytes stopRow = 2;</code>
-     */
-    public com.google.protobuf.ByteString getStopRow() {
-      return stopRow_;
-    }
-
-    private void initFields() {
-      startRow_ = com.google.protobuf.ByteString.EMPTY;
-      stopRow_ = com.google.protobuf.ByteString.EMPTY;
-    }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
-
-      memoizedIsInitialized = 1;
-      return true;
-    }
-
-    public void writeTo(com.google.protobuf.CodedOutputStream output)
-                        throws java.io.IOException {
-      getSerializedSize();
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeBytes(1, startRow_);
-      }
-      if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        output.writeBytes(2, stopRow_);
-      }
-      getUnknownFields().writeTo(output);
-    }
-
-    private int memoizedSerializedSize = -1;
-    public int getSerializedSize() {
-      int size = memoizedSerializedSize;
-      if (size != -1) return size;
-
-      size = 0;
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(1, startRow_);
-      }
-      if (((bitField0_ & 0x00000002) == 0x00000002)) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeBytesSize(2, stopRow_);
-      }
-      size += getUnknownFields().getSerializedSize();
-      memoizedSerializedSize = size;
-      return size;
-    }
-
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
-    @java.lang.Override
-    public boolean equals(final java.lang.Object obj) {
-      if (obj == this) {
-       return true;
-      }
-      if (!(obj instanceof org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest)) {
-        return super.equals(obj);
-      }
-      org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest other = (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest) obj;
-
-      boolean result = true;
-      result = result && (hasStartRow() == other.hasStartRow());
-      if (hasStartRow()) {
-        result = result && getStartRow()
-            .equals(other.getStartRow());
-      }
-      result = result && (hasStopRow() == other.hasStopRow());
-      if (hasStopRow()) {
-        result = result && getStopRow()
-            .equals(other.getStopRow());
-      }
-      result = result &&
-          getUnknownFields().equals(other.getUnknownFields());
-      return result;
-    }
-
-    private int memoizedHashCode = 0;
-    @java.lang.Override
-    public int hashCode() {
-      if (memoizedHashCode != 0) {
-        return memoizedHashCode;
-      }
-      int hash = 41;
-      hash = (19 * hash) + getDescriptorForType().hashCode();
-      if (hasStartRow()) {
-        hash = (37 * hash) + STARTROW_FIELD_NUMBER;
-        hash = (53 * hash) + getStartRow().hashCode();
-      }
-      if (hasStopRow()) {
-        hash = (37 * hash) + STOPROW_FIELD_NUMBER;
-        hash = (53 * hash) + getStopRow().hashCode();
-      }
-      hash = (29 * hash) + getUnknownFields().hashCode();
-      memoizedHashCode = hash;
-      return hash;
-    }
-
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(
-        com.google.protobuf.ByteString data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(
-        com.google.protobuf.ByteString data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(byte[] data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(
-        byte[] data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseDelimitedFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseDelimitedFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(
-        com.google.protobuf.CodedInputStream input)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parseFrom(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
-    }
-
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest prototype) {
-      return newBuilder().mergeFrom(prototype);
-    }
-    public Builder toBuilder() { return newBuilder(this); }
-
-    @java.lang.Override
-    protected Builder newBuilderForType(
-        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
-      Builder builder = new Builder(parent);
-      return builder;
-    }
-    /**
-     * Protobuf type {@code StatCollectRequest}
-     */
-    public static final class Builder extends
-        com.google.protobuf.GeneratedMessage.Builder<Builder>
-       implements org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequestOrBuilder {
-      public static final com.google.protobuf.Descriptors.Descriptor
-          getDescriptor() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectRequest_descriptor;
-      }
-
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
-          internalGetFieldAccessorTable() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectRequest_fieldAccessorTable
-            .ensureFieldAccessorsInitialized(
-                org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.class, org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.Builder.class);
-      }
-
-      // Construct using org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.newBuilder()
-      private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private Builder(
-          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
-        super(parent);
-        maybeForceBuilderInitialization();
-      }
-      private void maybeForceBuilderInitialization() {
-        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
-        }
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        startRow_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        stopRow_ = com.google.protobuf.ByteString.EMPTY;
-        bitField0_ = (bitField0_ & ~0x00000002);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public com.google.protobuf.Descriptors.Descriptor
-          getDescriptorForType() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectRequest_descriptor;
-      }
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest getDefaultInstanceForType() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.getDefaultInstance();
-      }
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest build() {
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest buildPartial() {
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest result = new org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.startRow_ = startRow_;
-        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
-          to_bitField0_ |= 0x00000002;
-        }
-        result.stopRow_ = stopRow_;
-        result.bitField0_ = to_bitField0_;
-        onBuilt();
-        return result;
-      }
-
-      public Builder mergeFrom(com.google.protobuf.Message other) {
-        if (other instanceof org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest) {
-          return mergeFrom((org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest)other);
-        } else {
-          super.mergeFrom(other);
-          return this;
-        }
-      }
-
-      public Builder mergeFrom(org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest other) {
-        if (other == org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.getDefaultInstance()) return this;
-        if (other.hasStartRow()) {
-          setStartRow(other.getStartRow());
-        }
-        if (other.hasStopRow()) {
-          setStopRow(other.getStopRow());
-        }
-        this.mergeUnknownFields(other.getUnknownFields());
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
-
-      // optional bytes startRow = 1;
-      private com.google.protobuf.ByteString startRow_ = com.google.protobuf.ByteString.EMPTY;
-      /**
-       * <code>optional bytes startRow = 1;</code>
-       */
-      public boolean hasStartRow() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
-      }
-      /**
-       * <code>optional bytes startRow = 1;</code>
-       */
-      public com.google.protobuf.ByteString getStartRow() {
-        return startRow_;
-      }
-      /**
-       * <code>optional bytes startRow = 1;</code>
-       */
-      public Builder setStartRow(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000001;
-        startRow_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * <code>optional bytes startRow = 1;</code>
-       */
-      public Builder clearStartRow() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        startRow_ = getDefaultInstance().getStartRow();
-        onChanged();
-        return this;
-      }
-
-      // optional bytes stopRow = 2;
-      private com.google.protobuf.ByteString stopRow_ = com.google.protobuf.ByteString.EMPTY;
-      /**
-       * <code>optional bytes stopRow = 2;</code>
-       */
-      public boolean hasStopRow() {
-        return ((bitField0_ & 0x00000002) == 0x00000002);
-      }
-      /**
-       * <code>optional bytes stopRow = 2;</code>
-       */
-      public com.google.protobuf.ByteString getStopRow() {
-        return stopRow_;
-      }
-      /**
-       * <code>optional bytes stopRow = 2;</code>
-       */
-      public Builder setStopRow(com.google.protobuf.ByteString value) {
-        if (value == null) {
-    throw new NullPointerException();
-  }
-  bitField0_ |= 0x00000002;
-        stopRow_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * <code>optional bytes stopRow = 2;</code>
-       */
-      public Builder clearStopRow() {
-        bitField0_ = (bitField0_ & ~0x00000002);
-        stopRow_ = getDefaultInstance().getStopRow();
-        onChanged();
-        return this;
-      }
-
-      // @@protoc_insertion_point(builder_scope:StatCollectRequest)
-    }
-
-    static {
-      defaultInstance = new StatCollectRequest(true);
-      defaultInstance.initFields();
-    }
-
-    // @@protoc_insertion_point(class_scope:StatCollectRequest)
-  }
-
-  public interface StatCollectResponseOrBuilder
-      extends com.google.protobuf.MessageOrBuilder {
-
-    // required uint64 rowsScanned = 1;
-    /**
-     * <code>required uint64 rowsScanned = 1;</code>
-     */
-    boolean hasRowsScanned();
-    /**
-     * <code>required uint64 rowsScanned = 1;</code>
-     */
-    long getRowsScanned();
-  }
-  /**
-   * Protobuf type {@code StatCollectResponse}
-   */
-  public static final class StatCollectResponse extends
-      com.google.protobuf.GeneratedMessage
-      implements StatCollectResponseOrBuilder {
-    // Use StatCollectResponse.newBuilder() to construct.
-    private StatCollectResponse(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
-      super(builder);
-      this.unknownFields = builder.getUnknownFields();
-    }
-    private StatCollectResponse(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
-
-    private static final StatCollectResponse defaultInstance;
-    public static StatCollectResponse getDefaultInstance() {
-      return defaultInstance;
-    }
-
-    public StatCollectResponse getDefaultInstanceForType() {
-      return defaultInstance;
-    }
-
-    private final com.google.protobuf.UnknownFieldSet unknownFields;
-    @java.lang.Override
-    public final com.google.protobuf.UnknownFieldSet
-        getUnknownFields() {
-      return this.unknownFields;
-    }
-    private StatCollectResponse(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      initFields();
-      int mutable_bitField0_ = 0;
-      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
-          com.google.protobuf.UnknownFieldSet.newBuilder();
-      try {
-        boolean done = false;
-        while (!done) {
-          int tag = input.readTag();
-          switch (tag) {
-            case 0:
-              done = true;
-              break;
-            default: {
-              if (!parseUnknownField(input, unknownFields,
-                                     extensionRegistry, tag)) {
-                done = true;
-              }
-              break;
-            }
-            case 8: {
-              bitField0_ |= 0x00000001;
-              rowsScanned_ = input.readUInt64();
-              break;
-            }
-          }
-        }
-      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-        throw e.setUnfinishedMessage(this);
-      } catch (java.io.IOException e) {
-        throw new com.google.protobuf.InvalidProtocolBufferException(
-            e.getMessage()).setUnfinishedMessage(this);
-      } finally {
-        this.unknownFields = unknownFields.build();
-        makeExtensionsImmutable();
-      }
-    }
-    public static final com.google.protobuf.Descriptors.Descriptor
-        getDescriptor() {
-      return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectResponse_descriptor;
-    }
-
-    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
-        internalGetFieldAccessorTable() {
-      return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectResponse_fieldAccessorTable
-          .ensureFieldAccessorsInitialized(
-              org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.class, org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.Builder.class);
-    }
-
-    public static com.google.protobuf.Parser<StatCollectResponse> PARSER =
-        new com.google.protobuf.AbstractParser<StatCollectResponse>() {
-      public StatCollectResponse parsePartialFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws com.google.protobuf.InvalidProtocolBufferException {
-        return new StatCollectResponse(input, extensionRegistry);
-      }
-    };
-
-    @java.lang.Override
-    public com.google.protobuf.Parser<StatCollectResponse> getParserForType() {
-      return PARSER;
-    }
-
-    private int bitField0_;
-    // required uint64 rowsScanned = 1;
-    public static final int ROWSSCANNED_FIELD_NUMBER = 1;
-    private long rowsScanned_;
-    /**
-     * <code>required uint64 rowsScanned = 1;</code>
-     */
-    public boolean hasRowsScanned() {
-      return ((bitField0_ & 0x00000001) == 0x00000001);
-    }
-    /**
-     * <code>required uint64 rowsScanned = 1;</code>
-     */
-    public long getRowsScanned() {
-      return rowsScanned_;
-    }
-
-    private void initFields() {
-      rowsScanned_ = 0L;
-    }
-    private byte memoizedIsInitialized = -1;
-    public final boolean isInitialized() {
-      byte isInitialized = memoizedIsInitialized;
-      if (isInitialized != -1) return isInitialized == 1;
-
-      if (!hasRowsScanned()) {
-        memoizedIsInitialized = 0;
-        return false;
-      }
-      memoizedIsInitialized = 1;
-      return true;
-    }
-
-    public void writeTo(com.google.protobuf.CodedOutputStream output)
-                        throws java.io.IOException {
-      getSerializedSize();
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        output.writeUInt64(1, rowsScanned_);
-      }
-      getUnknownFields().writeTo(output);
-    }
-
-    private int memoizedSerializedSize = -1;
-    public int getSerializedSize() {
-      int size = memoizedSerializedSize;
-      if (size != -1) return size;
-
-      size = 0;
-      if (((bitField0_ & 0x00000001) == 0x00000001)) {
-        size += com.google.protobuf.CodedOutputStream
-          .computeUInt64Size(1, rowsScanned_);
-      }
-      size += getUnknownFields().getSerializedSize();
-      memoizedSerializedSize = size;
-      return size;
-    }
-
-    private static final long serialVersionUID = 0L;
-    @java.lang.Override
-    protected java.lang.Object writeReplace()
-        throws java.io.ObjectStreamException {
-      return super.writeReplace();
-    }
-
-    @java.lang.Override
-    public boolean equals(final java.lang.Object obj) {
-      if (obj == this) {
-       return true;
-      }
-      if (!(obj instanceof org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse)) {
-        return super.equals(obj);
-      }
-      org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse other = (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse) obj;
-
-      boolean result = true;
-      result = result && (hasRowsScanned() == other.hasRowsScanned());
-      if (hasRowsScanned()) {
-        result = result && (getRowsScanned()
-            == other.getRowsScanned());
-      }
-      result = result &&
-          getUnknownFields().equals(other.getUnknownFields());
-      return result;
-    }
-
-    private int memoizedHashCode = 0;
-    @java.lang.Override
-    public int hashCode() {
-      if (memoizedHashCode != 0) {
-        return memoizedHashCode;
-      }
-      int hash = 41;
-      hash = (19 * hash) + getDescriptorForType().hashCode();
-      if (hasRowsScanned()) {
-        hash = (37 * hash) + ROWSSCANNED_FIELD_NUMBER;
-        hash = (53 * hash) + hashLong(getRowsScanned());
-      }
-      hash = (29 * hash) + getUnknownFields().hashCode();
-      memoizedHashCode = hash;
-      return hash;
-    }
-
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(
-        com.google.protobuf.ByteString data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(
-        com.google.protobuf.ByteString data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(byte[] data)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(
-        byte[] data,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws com.google.protobuf.InvalidProtocolBufferException {
-      return PARSER.parseFrom(data, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseDelimitedFrom(java.io.InputStream input)
-        throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseDelimitedFrom(
-        java.io.InputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return PARSER.parseDelimitedFrom(input, extensionRegistry);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(
-        com.google.protobuf.CodedInputStream input)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input);
-    }
-    public static org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parseFrom(
-        com.google.protobuf.CodedInputStream input,
-        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-        throws java.io.IOException {
-      return PARSER.parseFrom(input, extensionRegistry);
-    }
-
-    public static Builder newBuilder() { return Builder.create(); }
-    public Builder newBuilderForType() { return newBuilder(); }
-    public static Builder newBuilder(org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse prototype) {
-      return newBuilder().mergeFrom(prototype);
-    }
-    public Builder toBuilder() { return newBuilder(this); }
-
-    @java.lang.Override
-    protected Builder newBuilderForType(
-        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
-      Builder builder = new Builder(parent);
-      return builder;
-    }
-    /**
-     * Protobuf type {@code StatCollectResponse}
-     */
-    public static final class Builder extends
-        com.google.protobuf.GeneratedMessage.Builder<Builder>
-       implements org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponseOrBuilder {
-      public static final com.google.protobuf.Descriptors.Descriptor
-          getDescriptor() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectResponse_descriptor;
-      }
-
-      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
-          internalGetFieldAccessorTable() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectResponse_fieldAccessorTable
-            .ensureFieldAccessorsInitialized(
-                org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.class, org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.Builder.class);
-      }
-
-      // Construct using org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.newBuilder()
-      private Builder() {
-        maybeForceBuilderInitialization();
-      }
-
-      private Builder(
-          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
-        super(parent);
-        maybeForceBuilderInitialization();
-      }
-      private void maybeForceBuilderInitialization() {
-        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
-        }
-      }
-      private static Builder create() {
-        return new Builder();
-      }
-
-      public Builder clear() {
-        super.clear();
-        rowsScanned_ = 0L;
-        bitField0_ = (bitField0_ & ~0x00000001);
-        return this;
-      }
-
-      public Builder clone() {
-        return create().mergeFrom(buildPartial());
-      }
-
-      public com.google.protobuf.Descriptors.Descriptor
-          getDescriptorForType() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.internal_static_StatCollectResponse_descriptor;
-      }
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse getDefaultInstanceForType() {
-        return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance();
-      }
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse build() {
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse result = buildPartial();
-        if (!result.isInitialized()) {
-          throw newUninitializedMessageException(result);
-        }
-        return result;
-      }
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse buildPartial() {
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse result = new org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse(this);
-        int from_bitField0_ = bitField0_;
-        int to_bitField0_ = 0;
-        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
-          to_bitField0_ |= 0x00000001;
-        }
-        result.rowsScanned_ = rowsScanned_;
-        result.bitField0_ = to_bitField0_;
-        onBuilt();
-        return result;
-      }
-
-      public Builder mergeFrom(com.google.protobuf.Message other) {
-        if (other instanceof org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse) {
-          return mergeFrom((org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse)other);
-        } else {
-          super.mergeFrom(other);
-          return this;
-        }
-      }
-
-      public Builder mergeFrom(org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse other) {
-        if (other == org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance()) return this;
-        if (other.hasRowsScanned()) {
-          setRowsScanned(other.getRowsScanned());
-        }
-        this.mergeUnknownFields(other.getUnknownFields());
-        return this;
-      }
-
-      public final boolean isInitialized() {
-        if (!hasRowsScanned()) {
-          
-          return false;
-        }
-        return true;
-      }
-
-      public Builder mergeFrom(
-          com.google.protobuf.CodedInputStream input,
-          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
-          throws java.io.IOException {
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse parsedMessage = null;
-        try {
-          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
-        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
-          parsedMessage = (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse) e.getUnfinishedMessage();
-          throw e;
-        } finally {
-          if (parsedMessage != null) {
-            mergeFrom(parsedMessage);
-          }
-        }
-        return this;
-      }
-      private int bitField0_;
-
-      // required uint64 rowsScanned = 1;
-      private long rowsScanned_ ;
-      /**
-       * <code>required uint64 rowsScanned = 1;</code>
-       */
-      public boolean hasRowsScanned() {
-        return ((bitField0_ & 0x00000001) == 0x00000001);
-      }
-      /**
-       * <code>required uint64 rowsScanned = 1;</code>
-       */
-      public long getRowsScanned() {
-        return rowsScanned_;
-      }
-      /**
-       * <code>required uint64 rowsScanned = 1;</code>
-       */
-      public Builder setRowsScanned(long value) {
-        bitField0_ |= 0x00000001;
-        rowsScanned_ = value;
-        onChanged();
-        return this;
-      }
-      /**
-       * <code>required uint64 rowsScanned = 1;</code>
-       */
-      public Builder clearRowsScanned() {
-        bitField0_ = (bitField0_ & ~0x00000001);
-        rowsScanned_ = 0L;
-        onChanged();
-        return this;
-      }
-
-      // @@protoc_insertion_point(builder_scope:StatCollectResponse)
-    }
-
-    static {
-      defaultInstance = new StatCollectResponse(true);
-      defaultInstance.initFields();
-    }
-
-    // @@protoc_insertion_point(class_scope:StatCollectResponse)
-  }
-
-  /**
-   * Protobuf service {@code StatCollectService}
-   */
-  public static abstract class StatCollectService
-      implements com.google.protobuf.Service {
-    protected StatCollectService() {}
-
-    public interface Interface {
-      /**
-       * <code>rpc collectStat(.StatCollectRequest) returns (.StatCollectResponse);</code>
-       */
-      public abstract void collectStat(
-          com.google.protobuf.RpcController controller,
-          org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest request,
-          com.google.protobuf.RpcCallback<org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse> done);
-
-    }
-
-    public static com.google.protobuf.Service newReflectiveService(
-        final Interface impl) {
-      return new StatCollectService() {
-        @java.lang.Override
-        public  void collectStat(
-            com.google.protobuf.RpcController controller,
-            org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest request,
-            com.google.protobuf.RpcCallback<org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse> done) {
-          impl.collectStat(controller, request, done);
-        }
-
-      };
-    }
-
-    public static com.google.protobuf.BlockingService
-        newReflectiveBlockingService(final BlockingInterface impl) {
-      return new com.google.protobuf.BlockingService() {
-        public final com.google.protobuf.Descriptors.ServiceDescriptor
-            getDescriptorForType() {
-          return getDescriptor();
-        }
-
-        public final com.google.protobuf.Message callBlockingMethod(
-            com.google.protobuf.Descriptors.MethodDescriptor method,
-            com.google.protobuf.RpcController controller,
-            com.google.protobuf.Message request)
-            throws com.google.protobuf.ServiceException {
-          if (method.getService() != getDescriptor()) {
-            throw new java.lang.IllegalArgumentException(
-              "Service.callBlockingMethod() given method descriptor for " +
-              "wrong service type.");
-          }
-          switch(method.getIndex()) {
-            case 0:
-              return impl.collectStat(controller, (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest)request);
-            default:
-              throw new java.lang.AssertionError("Can't get here.");
-          }
-        }
-
-        public final com.google.protobuf.Message
-            getRequestPrototype(
-            com.google.protobuf.Descriptors.MethodDescriptor method) {
-          if (method.getService() != getDescriptor()) {
-            throw new java.lang.IllegalArgumentException(
-              "Service.getRequestPrototype() given method " +
-              "descriptor for wrong service type.");
-          }
-          switch(method.getIndex()) {
-            case 0:
-              return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.getDefaultInstance();
-            default:
-              throw new java.lang.AssertionError("Can't get here.");
-          }
-        }
-
-        public final com.google.protobuf.Message
-            getResponsePrototype(
-            com.google.protobuf.Descriptors.MethodDescriptor method) {
-          if (method.getService() != getDescriptor()) {
-            throw new java.lang.IllegalArgumentException(
-              "Service.getResponsePrototype() given method " +
-              "descriptor for wrong service type.");
-          }
-          switch(method.getIndex()) {
-            case 0:
-              return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance();
-            default:
-              throw new java.lang.AssertionError("Can't get here.");
-          }
-        }
-
-      };
-    }
-
-    /**
-     * <code>rpc collectStat(.StatCollectRequest) returns (.StatCollectResponse);</code>
-     */
-    public abstract void collectStat(
-        com.google.protobuf.RpcController controller,
-        org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest request,
-        com.google.protobuf.RpcCallback<org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse> done);
-
-    public static final
-        com.google.protobuf.Descriptors.ServiceDescriptor
-        getDescriptor() {
-      return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.getDescriptor().getServices().get(0);
-    }
-    public final com.google.protobuf.Descriptors.ServiceDescriptor
-        getDescriptorForType() {
-      return getDescriptor();
-    }
-
-    public final void callMethod(
-        com.google.protobuf.Descriptors.MethodDescriptor method,
-        com.google.protobuf.RpcController controller,
-        com.google.protobuf.Message request,
-        com.google.protobuf.RpcCallback<
-          com.google.protobuf.Message> done) {
-      if (method.getService() != getDescriptor()) {
-        throw new java.lang.IllegalArgumentException(
-          "Service.callMethod() given method descriptor for wrong " +
-          "service type.");
-      }
-      switch(method.getIndex()) {
-        case 0:
-          this.collectStat(controller, (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest)request,
-            com.google.protobuf.RpcUtil.<org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse>specializeCallback(
-              done));
-          return;
-        default:
-          throw new java.lang.AssertionError("Can't get here.");
-      }
-    }
-
-    public final com.google.protobuf.Message
-        getRequestPrototype(
-        com.google.protobuf.Descriptors.MethodDescriptor method) {
-      if (method.getService() != getDescriptor()) {
-        throw new java.lang.IllegalArgumentException(
-          "Service.getRequestPrototype() given method " +
-          "descriptor for wrong service type.");
-      }
-      switch(method.getIndex()) {
-        case 0:
-          return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest.getDefaultInstance();
-        default:
-          throw new java.lang.AssertionError("Can't get here.");
-      }
-    }
-
-    public final com.google.protobuf.Message
-        getResponsePrototype(
-        com.google.protobuf.Descriptors.MethodDescriptor method) {
-      if (method.getService() != getDescriptor()) {
-        throw new java.lang.IllegalArgumentException(
-          "Service.getResponsePrototype() given method " +
-          "descriptor for wrong service type.");
-      }
-      switch(method.getIndex()) {
-        case 0:
-          return org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance();
-        default:
-          throw new java.lang.AssertionError("Can't get here.");
-      }
-    }
-
-    public static Stub newStub(
-        com.google.protobuf.RpcChannel channel) {
-      return new Stub(channel);
-    }
-
-    public static final class Stub extends org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectService implements Interface {
-      private Stub(com.google.protobuf.RpcChannel channel) {
-        this.channel = channel;
-      }
-
-      private final com.google.protobuf.RpcChannel channel;
-
-      public com.google.protobuf.RpcChannel getChannel() {
-        return channel;
-      }
-
-      public  void collectStat(
-          com.google.protobuf.RpcController controller,
-          org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest request,
-          com.google.protobuf.RpcCallback<org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse> done) {
-        channel.callMethod(
-          getDescriptor().getMethods().get(0),
-          controller,
-          request,
-          org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance(),
-          com.google.protobuf.RpcUtil.generalizeCallback(
-            done,
-            org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.class,
-            org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance()));
-      }
-    }
-
-    public static BlockingInterface newBlockingStub(
-        com.google.protobuf.BlockingRpcChannel channel) {
-      return new BlockingStub(channel);
-    }
-
-    public interface BlockingInterface {
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse collectStat(
-          com.google.protobuf.RpcController controller,
-          org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest request)
-          throws com.google.protobuf.ServiceException;
-    }
-
-    private static final class BlockingStub implements BlockingInterface {
-      private BlockingStub(com.google.protobuf.BlockingRpcChannel channel) {
-        this.channel = channel;
-      }
-
-      private final com.google.protobuf.BlockingRpcChannel channel;
-
-      public org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse collectStat(
-          com.google.protobuf.RpcController controller,
-          org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectRequest request)
-          throws com.google.protobuf.ServiceException {
-        return (org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse) channel.callBlockingMethod(
-          getDescriptor().getMethods().get(0),
-          controller,
-          request,
-          org.apache.phoenix.coprocessor.generated.StatCollectorProtos.StatCollectResponse.getDefaultInstance());
-      }
-
-    }
-
-    // @@protoc_insertion_point(class_scope:StatCollectService)
-  }
-
-  private static com.google.protobuf.Descriptors.Descriptor
-    internal_static_StatCollectRequest_descriptor;
-  private static
-    com.google.protobuf.GeneratedMessage.FieldAccessorTable
-      internal_static_StatCollectRequest_fieldAccessorTable;
-  private static com.google.protobuf.Descriptors.Descriptor
-    internal_static_StatCollectResponse_descriptor;
-  private static
-    com.google.protobuf.GeneratedMessage.FieldAccessorTable
-      internal_static_StatCollectResponse_fieldAccessorTable;
-
-  public static com.google.protobuf.Descriptors.FileDescriptor
-      getDescriptor() {
-    return descriptor;
-  }
-  private static com.google.protobuf.Descriptors.FileDescriptor
-      descriptor;
-  static {
-    java.lang.String[] descriptorData = {
-      "\n\027StatisticsCollect.proto\"7\n\022StatCollect" +
-      "Request\022\020\n\010startRow\030\001 \001(\014\022\017\n\007stopRow\030\002 \001" +
-      "(\014\"*\n\023StatCollectResponse\022\023\n\013rowsScanned" +
-      "\030\001 \002(\0042N\n\022StatCollectService\0228\n\013collectS" +
-      "tat\022\023.StatCollectRequest\032\024.StatCollectRe" +
-      "sponseBG\n(org.apache.phoenix.coprocessor" +
-      ".generatedB\023StatCollectorProtosH\001\210\001\001\240\001\001"
-    };
-    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
-      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
-        public com.google.protobuf.ExtensionRegistry assignDescriptors(
-            com.google.protobuf.Descriptors.FileDescriptor root) {
-          descriptor = root;
-          internal_static_StatCollectRequest_descriptor =
-            getDescriptor().getMessageTypes().get(0);
-          internal_static_StatCollectRequest_fieldAccessorTable = new
-            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
-              internal_static_StatCollectRequest_descriptor,
-              new java.lang.String[] { "StartRow", "StopRow", });
-          internal_static_StatCollectResponse_descriptor =
-            getDescriptor().getMessageTypes().get(1);
-          internal_static_StatCollectResponse_fieldAccessorTable = new
-            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
-              internal_static_StatCollectResponse_descriptor,
-              new java.lang.String[] { "RowsScanned", });
-          return null;
-        }
-      };
-    com.google.protobuf.Descriptors.FileDescriptor
-      .internalBuildGeneratedFileFrom(descriptorData,
-        new com.google.protobuf.Descriptors.FileDescriptor[] {
-        }, assigner);
-  }
-
-  // @@protoc_insertion_point(outer_class_scope)
-}

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6a27cecc/phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java b/phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java
index 816cd1b..efb00a8 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java
@@ -122,7 +122,7 @@ public class ScanPlan extends BaseQueryPlan {
         } else {
             // Region size estimated based on total number of bytes divided by number of regions
             long totByteSize = gpsInfo.getByteCount();
-            estRegionSize = totByteSize / (gpsInfo.getGuidePosts().size()+1);
+            estRegionSize = totByteSize / (gpsInfo.getGuidePostsCount()+1);
         }
         // TODO: configurable number of bytes?
         boolean isSerial = (perScanLimit * estRowSize < estRegionSize);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6a27cecc/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
index 519b38f..b3235e2 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
@@ -22,6 +22,10 @@ import static org.apache.phoenix.monitoring.GlobalClientMetrics.GLOBAL_FAILED_QU
 import static org.apache.phoenix.monitoring.GlobalClientMetrics.GLOBAL_QUERY_TIMEOUT_COUNTER;
 import static org.apache.phoenix.util.ByteUtil.EMPTY_BYTE_ARRAY;
 
+import java.io.ByteArrayInputStream;
+import java.io.DataInput;
+import java.io.DataInputStream;
+import java.io.EOFException;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -46,6 +50,7 @@ import org.apache.hadoop.hbase.HRegionLocation;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter;
 import org.apache.hadoop.hbase.filter.PageFilter;
+import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.phoenix.compile.QueryPlan;
@@ -75,7 +80,10 @@ import org.apache.phoenix.schema.StaleRegionBoundaryCacheException;
 import org.apache.phoenix.schema.TableRef;
 import org.apache.phoenix.schema.stats.GuidePostsInfo;
 import org.apache.phoenix.schema.stats.PTableStats;
+import org.apache.phoenix.util.ByteUtil;
+import org.apache.phoenix.util.PrefixByteCodec;
 import org.apache.phoenix.util.LogUtil;
+import org.apache.phoenix.util.PrefixByteDecoder;
 import org.apache.phoenix.util.SQLCloseables;
 import org.apache.phoenix.util.ScanUtil;
 import org.apache.phoenix.util.SchemaUtil;
@@ -356,22 +364,18 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
         guideIndex = (guideIndex < 0 ? -(guideIndex + 1) : guideIndex);
         return guideIndex;
     }
-    
-    private List<byte[]> getGuidePosts(Set<byte[]> whereConditions) {
+
+    private GuidePostsInfo getGuidePosts(Set<byte[]> whereConditions) {
         /*
-         *  Don't use guide posts if:
-         *  1) We're doing a point lookup, as HBase is fast enough at those
-         *     to not need them to be further parallelized. TODO: pref test to verify
-         *  2) We're collecting stats, as in this case we need to scan entire
-         *     regions worth of data to track where to put the guide posts.
+         * Don't use guide posts if: 1) We're doing a point lookup, as HBase is fast enough at those to not need them to
+         * be further parallelized. TODO: pref test to verify 2) We're collecting stats, as in this case we need to scan
+         * entire regions worth of data to track where to put the guide posts.
          */
-        if (!useStats()) {
-            return Collections.emptyList();
-        }
-        
-        List<byte[]> gps = null;
+        if (!useStats()) { return GuidePostsInfo.EMPTY_GUIDEPOST; }
+
+        GuidePostsInfo gps = null;
         PTable table = getTable();
-        Map<byte[],GuidePostsInfo> guidePostMap = tableStats.getGuidePosts();
+        Map<byte[], GuidePostsInfo> guidePostMap = tableStats.getGuidePosts();
         byte[] defaultCF = SchemaUtil.getEmptyColumnFamily(getTable());
         if (table.getColumnFamilies().isEmpty()) {
             // For sure we can get the defaultCF from the table
@@ -379,37 +383,35 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
         } else {
             byte[] familyInWhere = null;
             if (!whereConditions.isEmpty()) {
-              if (whereConditions.contains(defaultCF)) {
-                gps = getDefaultFamilyGuidePosts(guidePostMap, defaultCF);
-              } else {
-                familyInWhere = whereConditions.iterator().next();
-                if(familyInWhere != null) {
-                  GuidePostsInfo guidePostsInfo = guidePostMap.get(familyInWhere);
-                  if (guidePostsInfo != null) {
-                      gps = guidePostsInfo.getGuidePosts();
-                  } else {
-                    // As there are no guideposts collected for the where family we go with the default CF
+                if (whereConditions.contains(defaultCF)) {
                     gps = getDefaultFamilyGuidePosts(guidePostMap, defaultCF);
-                  }
+                } else {
+                    familyInWhere = whereConditions.iterator().next();
+                    if (familyInWhere != null) {
+                        GuidePostsInfo guidePostsInfo = guidePostMap.get(familyInWhere);
+                        if (guidePostsInfo != null) {
+                            gps = guidePostsInfo;
+                        } else {
+                            // As there are no guideposts collected for the where family we go with the default CF
+                            gps = getDefaultFamilyGuidePosts(guidePostMap, defaultCF);
+                        }
+                    }
                 }
-              }
             } else {
-              gps = getDefaultFamilyGuidePosts(guidePostMap, defaultCF);
+                gps = getDefaultFamilyGuidePosts(guidePostMap, defaultCF);
             }
         }
-        if (gps == null) {
-            return Collections.emptyList();
-        }
+        if (gps == null) { return GuidePostsInfo.EMPTY_GUIDEPOST; }
         return gps;
     }
 
-    private List<byte[]> getDefaultFamilyGuidePosts(Map<byte[], GuidePostsInfo> guidePostMap, byte[] defaultCF) {
-      if (guidePostMap.get(defaultCF) != null) {
-          return guidePostMap.get(defaultCF).getGuidePosts();
-      }
-      return null;
+    private GuidePostsInfo getDefaultFamilyGuidePosts(Map<byte[], GuidePostsInfo> guidePostMap, byte[] defaultCF) {
+        if (guidePostMap.get(defaultCF) != null) {
+                return guidePostMap.get(defaultCF);
+        }
+        return null;
     }
-    
+
     private static String toString(List<byte[]> gps) {
         StringBuilder buf = new StringBuilder(gps.size() * 100);
         buf.append("[");
@@ -461,10 +463,7 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
         for(Pair<byte[], byte[]> where : context.getWhereConditionColumns()) {
           whereConditions.add(where.getFirst());
         }
-        List<byte[]> gps = getGuidePosts(whereConditions);
-        if (logger.isDebugEnabled()) {
-            logger.debug("Guideposts: " + toString(gps));
-        }
+        GuidePostsInfo gps = getGuidePosts(whereConditions);
         boolean traverseAllRegions = isSalted || isLocalIndex;
         if (!traverseAllRegions) {
             byte[] scanStartRow = scan.getStartRow();
@@ -490,15 +489,35 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
         }
         List<List<Scan>> parallelScans = Lists.newArrayListWithExpectedSize(stopIndex - regionIndex + 1);
         
-        byte[] currentKey = startKey;
-        int guideIndex = currentKey.length == 0 ? 0 : getIndexContainingInclusive(gps, currentKey);
-        int gpsSize = gps.size();
+        ImmutableBytesWritable currentKey = new ImmutableBytesWritable(startKey);
+        
+        int gpsSize = gps.getGuidePostsCount();
         int estGuidepostsPerRegion = gpsSize == 0 ? 1 : gpsSize / regionLocations.size() + 1;
         int keyOffset = 0;
+        ImmutableBytesWritable currentGuidePost = ByteUtil.EMPTY_IMMUTABLE_BYTE_ARRAY;
         List<Scan> scans = Lists.newArrayListWithExpectedSize(estGuidepostsPerRegion);
+        ImmutableBytesWritable guidePosts = gps.getGuidePosts();
+        ByteArrayInputStream stream = null;
+        DataInput input = null;
+        PrefixByteDecoder decoder = null;
+        int guideIndex = 0;
+        if (gpsSize > 0) {
+            stream = new ByteArrayInputStream(guidePosts.get(), guidePosts.getOffset(), guidePosts.getLength());
+            input = new DataInputStream(stream);
+            decoder = new PrefixByteDecoder(gps.getMaxLength());
+            try {
+                while (currentKey.compareTo(currentGuidePost = PrefixByteCodec.decode(decoder, input)) >= 0
+                        && currentKey.getLength() != 0) {
+                    guideIndex++;
+                }
+            } catch (EOFException e) {}
+        }
+        byte[] currentKeyBytes = currentKey.copyBytes();
+
         // Merge bisect with guideposts for all but the last region
         while (regionIndex <= stopIndex) {
-            byte[] currentGuidePost, endKey, endRegionKey = EMPTY_BYTE_ARRAY;
+            byte[] currentGuidePostBytes = currentGuidePost.copyBytes();
+            byte[] endKey, endRegionKey = EMPTY_BYTE_ARRAY;
             if (regionIndex == stopIndex) {
                 endKey = stopKey;
             } else {
@@ -510,14 +529,18 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
                 endRegionKey = regionInfo.getEndKey();
                 keyOffset = ScanUtil.getRowKeyOffset(regionInfo.getStartKey(), endRegionKey);
             }
-            while (guideIndex < gpsSize
-                    && (Bytes.compareTo(currentGuidePost = gps.get(guideIndex), endKey) <= 0 || endKey.length == 0)) {
-                Scan newScan = scanRanges.intersectScan(scan, currentKey, currentGuidePost, keyOffset, false);
-                scans = addNewScan(parallelScans, scans, newScan, currentGuidePost, false, regionLocation);
-                currentKey = currentGuidePost;
-                guideIndex++;
-            }
-            Scan newScan = scanRanges.intersectScan(scan, currentKey, endKey, keyOffset, true);
+            try {
+                while (guideIndex < gpsSize && (currentGuidePost.compareTo(endKey) <= 0 || endKey.length == 0)) {
+                    Scan newScan = scanRanges.intersectScan(scan, currentKeyBytes, currentGuidePostBytes, keyOffset,
+                            false);
+                    scans = addNewScan(parallelScans, scans, newScan, currentGuidePostBytes, false, regionLocation);
+                    currentKeyBytes = currentGuidePost.copyBytes();
+                    currentGuidePost = PrefixByteCodec.decode(decoder, input);
+                    currentGuidePostBytes = currentGuidePost.copyBytes();
+                    guideIndex++;
+                }
+            } catch (EOFException e) {}
+            Scan newScan = scanRanges.intersectScan(scan, currentKeyBytes, endKey, keyOffset, true);
             if (isLocalIndex) {
                 if (newScan != null) {
                     newScan.setAttribute(EXPECTED_UPPER_REGION_KEY, endRegionKey);
@@ -526,15 +549,17 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
                 }
             }
             scans = addNewScan(parallelScans, scans, newScan, endKey, true, regionLocation);
-            currentKey = endKey;
+            currentKeyBytes = endKey;
             regionIndex++;
         }
         if (!scans.isEmpty()) { // Add any remaining scans
             parallelScans.add(scans);
         }
+        PrefixByteCodec.close(stream);
         return parallelScans;
     }
 
+   
     public static <T> List<T> reverseIfNecessary(List<T> list, boolean reverse) {
         if (!reverse) {
             return list;
@@ -805,8 +830,9 @@ public abstract class BaseResultIterators extends ExplainTable implements Result
         explain(buf.toString(),planSteps);
     }
 
-	@Override
-	public String toString() {
-		return "ResultIterators [name=" + getName() + ",id=" + scanId + ",scans=" + scans + "]";
-	}
+    @Override
+    public String toString() {
+        return "ResultIterators [name=" + getName() + ",id=" + scanId + ",scans=" + scans + "]";
+    }
+
 }
\ No newline at end of file


Mime
View raw message