Github user ankitsinghal commented on the pull request:

    https://github.com/apache/phoenix/pull/147#issuecomment-172089737
  
    Thanks @JamesRTaylor  for the review.
    I have made the changes you have suggested above except this one.
    byte[] currentGuidePostBytes = 
SchemaUtil.copyKeyIfNecessary(currentGuidePost);
    
    As PrefixByteDecoder updates the previous buffer only whenever maxLength is 
passed as a part of optimization.
    
    public ImmutableBytesWritable decode(DataInput in) throws IOException {
            int prefixLen = WritableUtils.readVInt(in);
            int suffixLen = WritableUtils.readVInt(in);
            int length = prefixLen + suffixLen;
            byte[] b;
            if (maxLength == -1) { // Allocate new byte array each time
                b = new byte[length];
                System.arraycopy(previous.get(), previous.getOffset(), b, 0, 
prefixLen);
            } else { // Reuse same buffer each time
                b = previous.get();
            }
            in.readFully(b, prefixLen, suffixLen);
            previous.set(b, 0, length);
            return previous;
        }
    
    so I need to copy bytes even if the length of the ImmutableByteWritable is 
equal to byte[] contained in it.
    
    What do you think about this?
    
    And also I have fixed the failure test cases as well. there was logical 
operator problem while incrementing 
    guidePosts till the start key.
    
    
    I have run the complete test suite now and will confirm you once it is 
completed.


---
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