Map < String , byte [ ] > getRowKeyValue ( List < IndexExpression > expressions , String primaryKeyName ) { Map < String , byte [ ] > rowKeys = new HashMap < String , byte [ ] > ( ) ; List < IndexExpression > rowExpressions = new ArrayList < IndexExpression > ( ) ; if ( expressions != null ) { for ( IndexExpression e : expressions ) { if ( primaryKeyName . equals ( new String ( e . getColumn_name ( ) ) ) ) { IndexOperator operator = e . op ; if ( operator . equals ( IndexOperator . LTE ) || operator . equals ( IndexOperator . LT ) ) { rowKeys . put ( MAX_ , e . getValue ( ) ) ; rowExpressions . add ( e ) ; } else if ( operator . equals ( IndexOperator . GTE ) || operator . equals ( IndexOperator . GT ) ) { rowKeys . put ( MIN_ , e . getValue ( ) ) ; rowExpressions . add ( e ) ; } else if ( operator . equals ( IndexOperator . EQ ) ) { rowKeys . put ( MAX_ , e . getValue ( ) ) ; rowKeys . put ( MIN_ , e . getValue ( ) ) ; rowExpressions . add ( e ) ; } } } expressions . removeAll ( rowExpressions ) ; } return rowKeys ; }
Returns list of row keys . First element will be min value and second will be major value .