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

stack commented on HBASE-14997:
-------------------------------

DynamoDB has notion of a Condition and ComparisonOperator.

http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Condition.html

http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/dynamodbv2/model/ComparisonOperator.html

You stipulate KeyCondition like this (in JSON) as part of a Query....

This late in the game, let me just fix the CompareOp reveal in API. Condition 
would be nice... say a CellCondition... but would have to teach users new means 
of using API.

> Move compareOp and Comparators out of filter to client package
> --------------------------------------------------------------
>
>                 Key: HBASE-14997
>                 URL: https://issues.apache.org/jira/browse/HBASE-14997
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: Enis Soztutar
>            Priority: Critical
>             Fix For: 2.0.0-alpha-3
>
>
> {{Table.checkAndPut()}} and its cousins depend on CompareOp from the filter 
> package. Originally, ComparaOp and ByteArrayComparable, and various 
> "comparators" have been used in filters, so these are in the filter package. 
> However, for checkAndPut(), etc we depend on the filter subpackage although 
> these are not filter related operations. We can use some clean up.
> {code}
>   boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier,
>     CompareFilter.CompareOp compareOp, byte[] value, Put put) throws 
> IOException;
> {code}
> Some ideas
>  - Cleanup ByteArrayComparable interface (see the TODO at the class) 
>  - Maybe introduce a {{Condition}} or a similar concept and do 
> {{checkAndPut(Condition condition, Put put)}} and change filters to use that 
> as well. 
>  - Introducing Condition like thing will allow us to have an interface like: 
> {{checkAndMutate(List<Condition> conditions, List<Mutation> mutations)}}. 
>  - BinaryComparator, etc are not "Comparators", they are comparables. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to