[ 
https://issues.apache.org/jira/browse/HBASE-8526?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13658479#comment-13658479
 ] 

Jean-Marc Spaggiari commented on HBASE-8526:
--------------------------------------------

So. After some discussions and looking deeper into this, we have mulitple 
options with pros and cons. I will try to list all of them.

h2.Option 1

Add a flag and delimiter to the wire.

+Pros+
Will allow to use ALL the possible flags including Pattern.CANON_EQ and 
Pattern.LITERAL
New clients not using the flags to old servers wire will still be working fine.
New servers receiving from old clients will still be working.

+Cons+
New clients using the flags to old servers wire will not work since old servers 
will not know what to do with the delimiter.


h2.Option 2

Append the flags to the regex string and not use any delimiter. Like (?i) for 
Pattern.CASE_INSENSITIVE, etc.

+Pros+
Will allow all new and old servers/clients to communicate without any 
limitation.

+Cons+
There is no canonical form for Pattern.CANON_EQ and Pattern.LITERAL so those 2 
flags are going to be ignored. See 
http://docs.oracle.com/javase/tutorial/essential/regex/pattern.html


.h2Option 3

A mix of the 2 previous options. Append the flags to the regex, but if 
Pattern.CANON_EQ or Pattern.LITERAL is used, then pass them with a delimiter.

+Pros+
Will allow to use ALL the possible flags including Pattern.CANON_EQ and 
Pattern.LITERAL
Will allow all new and old servers/clients to communicate without any 
limitation expect if Pattern.CANON_EQ or Pattern.LITERAL is used.

+Cons+
New clients using the Pattern.CANON_EQ or Pattern.LITERAL flags to old servers 
wire will not work since old servers will not know what to do with the 
delimiter.



.h2+Summary+

I think that option 2 is a very safe way while Option 3 is still acceptable as 
long as this is documented into the constructor comments.


Does anyone have any comment? [~lhofhansl]? [~jxiang]? Others?
                
> Backport HBASE-5667 into 0.94
> -----------------------------
>
>                 Key: HBASE-8526
>                 URL: https://issues.apache.org/jira/browse/HBASE-8526
>             Project: HBase
>          Issue Type: Improvement
>          Components: Filters
>    Affects Versions: 0.94.7
>            Reporter: Jean-Marc Spaggiari
>            Assignee: Jean-Marc Spaggiari
>            Priority: Minor
>         Attachments: HBASE-8526-v1-0.94.patch
>
>
> RegexStringComparator supports java.util.regex.Pattern flags
> https://issues.apache.org/jira/browse/HBASE-5667

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to