virajjasani commented on a change in pull request #1822:
URL: https://github.com/apache/hbase/pull/1822#discussion_r436367455



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/filter/MultipleColumnPrefixFilter.java
##########
@@ -40,15 +42,18 @@
  */
 @InterfaceAudience.Public
 public class MultipleColumnPrefixFilter extends FilterBase {
+  private static final Logger LOG = 
LoggerFactory.getLogger(MultipleColumnPrefixFilter.class);
   protected byte [] hint = null;
   protected TreeSet<byte []> sortedPrefixes = createTreeSet();
   private final static int MAX_LOG_PREFIXES = 5;
 
   public MultipleColumnPrefixFilter(final byte [][] prefixes) {
     if (prefixes != null) {
       for (int i = 0; i < prefixes.length; i++) {
-        if (!sortedPrefixes.add(prefixes[i]))
-          throw new IllegalArgumentException ("prefixes must be distinct");
+        if (!sortedPrefixes.add(prefixes[i])) {
+          LOG.error("prefix {} is repeated", Bytes.toString(prefixes[i]));
+          throw new IllegalArgumentException("prefixes must be distinct");

Review comment:
       Now that you are doing this improvement, maybe you can improve looping 
also:
   ```
         for (byte[] prefix : prefixes) {
           if (!sortedPrefixes.add(prefix)){
           }
         }
   
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to