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

    https://github.com/apache/phoenix/pull/12#discussion_r17405196
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 ---
    @@ -1671,4 +1787,68 @@ private boolean allViewsInMultipleRegions() {
                 return results.size() > 0 && allViewsNotInSingleRegion;
             }
         }
    +
    +    /**
    +     * 
    +     * Matches rows that end with a given byte array suffix
    +     *
    +     * 
    +     * @since 3.0
    +     */
    +    private static class SuffixFilter extends FilterBase {
    +        protected byte[] suffix = null;
    +
    +        public SuffixFilter(final byte[] suffix) {
    +            this.suffix = suffix;
    +        }
    +        
    +        @Override
    +        public ReturnCode filterKeyValue(Cell ignored) throws IOException {
    +          return ReturnCode.INCLUDE;
    +        }
    +        
    +        @Override
    +        public boolean filterRowKey(byte[] buffer, int offset, int length) 
{
    +            if (buffer == null || this.suffix == null) return true;
    +            if (length < suffix.length) return true;
    +            // if they are equal, return false => pass row
    +            // else return true, filter row
    +            // if we are passed the suffix, set flag
    +            int cmp = Bytes.compareTo(buffer, offset + (length - 
this.suffix.length),
    +                    this.suffix.length, this.suffix, 0, 
this.suffix.length);
    +            return cmp != 0;
    +        }
    +    }
    +    
    +    @Override
    +    public void clearCacheForTable(RpcController controller, 
ClearCacheForTableRequest request,
    --- End diff --
    
    This should look very close to getTable(RpcController controller, 
GetTableRequest request, RpcCallback<MetaDataResponse> done);


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