Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/147#discussion_r49880903
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/schema/stats/GuidePostsInfo.java 
---
    @@ -53,22 +70,21 @@
          * @param guidePosts
          * @param rowCount
          */
    -    public GuidePostsInfo(long byteCount, List<byte[]> guidePosts, long 
rowCount) {
    -        this.guidePosts = ImmutableList.copyOf(guidePosts);
    -        int size = 0;
    -        for (byte[] key : guidePosts) {
    -            size += key.length;
    -        }
    -        this.keyByteSize = size;
    +    public GuidePostsInfo(long byteCount, ImmutableBytesWritable 
guidePosts, long rowCount, int maxLength, int guidePostsCount) {
    +        this.guidePosts = guidePosts;
    --- End diff --
    
    Best to make a copy of the ImmutableBytesWritable here in case the caller 
uses the ptr again. Note that this doesn't copy the underlying bytes:
    
        this.guidePosts = new ImmutableBytesWritable(guidePosts);


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to