[jira] [Comment Edited] (HBASE-9359) Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, ColumnInterpreter

2013-08-28 Thread Jonathan Hsieh (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-9359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13752683#comment-13752683
 ] 

Jonathan Hsieh edited comment on HBASE-9359 at 8/28/13 6:30 PM:


In v1, basically, any method whose return type changes will require apps to do 
some code changes.  Methods where arguments change from KeyValue to Cell should 
still work since Cell can accept KeyValues.  I'm leaning towards making sure 
the commonly used but inefficient KeyValue methods (including #getQualifier, 
#getFamily, and #getValue, and #getRow) get ported into the Cell interface.  
Clients would essentially only have to replace KeyValue with Cell in these 
cases.

{code}
Put:
-  public ListKeyValue get(byte[] family, byte[] qualifier)
+  public ListCell get(byte[] family, byte[] qualifier) 

Result:
-  public KeyValue[] raw() {
+  public Cell[] raw() {

-  public ListKeyValue list() {
+  public ListCell list() {

-  public ListKeyValue getColumn(byte [] family, byte [] qualifier) {
+  public ListCell getColumn(byte [] family, byte [] qualifier) {

-  public KeyValue getColumnLatest(byte [] family, byte [] qualifier) {
+  public Cell getColumnLatest(byte [] family, byte [] qualifier) {

-  public KeyValue getColumnLatest(byte [] family, int foffset, int flength,
+  public Cell getColumnLatest(byte [] family, int foffset, int flength,
   byte [] qualifier, int qoffset, int qlength) {
{code}

For extension interfaces that have changed signatures (like filters in 
HBASE-9334 and in here, coprocessors) we can keep both the old and new 
signature and have the abstract implementation helper have the new call the 
old.  For the shim to handle the ListKeyValue - ListCell conversion, I'm 
going to use a naive array copy.  (Another option is to change the signature to 
List? extends Cell -- will look at this option one more time).

{code}
ColumnInterpreter:  (abstract class)
-  public abstract T getValue(byte[] colFamily, byte[] colQualifier, KeyValue 
kv)
+  public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
 
BaseRegionObserver: (abstract class)
RegionObserver:  (inteface)
   void preGet(final ObserverContextRegionCoprocessorEnvironment c, final Get 
get,
-  final ListKeyValue result)
+  final ListCell result)
 throws IOException;
   void postGet(final ObserverContextRegionCoprocessorEnvironment c, final 
Get get,
-  final ListKeyValue result)
+  final ListCell result)
 throws IOException;
{code}

  was (Author: jmhsieh):
In v1, basically, any method whose return type will require apps to do some 
code changes.  Methods where arguments change from KeyValue to Cell should 
still work since Cell can accept KeyValues.  I'm leaning towards making sure 
the commonly used but inefficient KeyValue methods (including #getQualifier, 
#getFamily, and #getValue, and #getRow) get ported into the Cell interface.  
Clients would essentially only have to replace KeyValue with Cell in these 
cases.

{code}
Put:
-  public ListKeyValue get(byte[] family, byte[] qualifier)
+  public ListCell get(byte[] family, byte[] qualifier) 

Result:
-  public KeyValue[] raw() {
+  public Cell[] raw() {

-  public ListKeyValue list() {
+  public ListCell list() {

-  public ListKeyValue getColumn(byte [] family, byte [] qualifier) {
+  public ListCell getColumn(byte [] family, byte [] qualifier) {

-  public KeyValue getColumnLatest(byte [] family, byte [] qualifier) {
+  public Cell getColumnLatest(byte [] family, byte [] qualifier) {

-  public KeyValue getColumnLatest(byte [] family, int foffset, int flength,
+  public Cell getColumnLatest(byte [] family, int foffset, int flength,
   byte [] qualifier, int qoffset, int qlength) {
{code}

For extension interfaces that have changed signatures (like filters in 
HBASE-9334 and in here, coprocessors) we can keep both the old and new 
signature and have the abstract implementation helper have the new call the 
old.  For the shim to handle the ListKeyValue - ListCell conversion, I'm 
going to use a naive array copy.  (Another option is to change the signature to 
List? extends Cell -- will look at this option one more time).

{code}
ColumnInterpreter:  (abstract class)
-  public abstract T getValue(byte[] colFamily, byte[] colQualifier, KeyValue 
kv)
+  public abstract T getValue(byte[] colFamily, byte[] colQualifier, Cell kv)
 
BaseRegionObserver: (abstract class)
RegionObserver:  (inteface)
   void preGet(final ObserverContextRegionCoprocessorEnvironment c, final Get 
get,
-  final ListKeyValue result)
+  final ListCell result)
 throws IOException;
   void postGet(final ObserverContextRegionCoprocessorEnvironment c, final 
Get get,
-  final ListKeyValue result)
+  final ListCell result)
 throws IOException;
{code}
  
 Convert KeyValue to Cell in hbase-client module - 

[jira] [Comment Edited] (HBASE-9359) Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, ColumnInterpreter

2013-08-27 Thread Jonathan Hsieh (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-9359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13751827#comment-13751827
 ] 

Jonathan Hsieh edited comment on HBASE-9359 at 8/27/13 10:45 PM:
-

After the filter patch, and then this patch, when we applied this command:

{code}
grep -R KeyValue hbase-client/ hbase-common/ | grep java: | grep -v 
KeyValue[\\.\(]
{code}

we only yields KeyValue used in comments and or as imports only.  (not present 
in function signatures.)

  was (Author: jmhsieh):
After the filter patch, is applied this command:

{code}
grep -R KeyValue hbase-client/ hbase-common/ | grep java: | grep -v 
KeyValue[\\.\(]
{code}

yields KeyValue used in comments and or as imports only.  (not present in 
function signatures.)
  
 Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, 
 ColumnInterpreter
 --

 Key: HBASE-9359
 URL: https://issues.apache.org/jira/browse/HBASE-9359
 Project: HBase
  Issue Type: Sub-task
Reporter: Jonathan Hsieh

 This path is the second half of eliminating KeyValue from the client 
 interfaces.  This percolated through quite a bit. 

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


[jira] [Comment Edited] (HBASE-9359) Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, ColumnInterpreter

2013-08-27 Thread Jonathan Hsieh (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-9359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13751827#comment-13751827
 ] 

Jonathan Hsieh edited comment on HBASE-9359 at 8/27/13 10:49 PM:
-

After the filter patch, and then this patch, when we applied this command:

{code}
grep -R KeyValue hbase-client/ hbase-common/ | grep java: | grep -v 
KeyValue[\\.\(]
{code}

we only yield KeyValue used in comments, strings, as imports, part of other 
class names/methods (like KeyValueUtil, #decodeKeyValues), and KeyValueUtil's 
function signatures.  (not present in function signatures.)

  was (Author: jmhsieh):
After the filter patch, and then this patch, when we applied this command:

{code}
grep -R KeyValue hbase-client/ hbase-common/ | grep java: | grep -v 
KeyValue[\\.\(]
{code}

we only yields KeyValue used in comments and or as imports only.  (not present 
in function signatures.)
  
 Convert KeyValue to Cell in hbase-client module - Result/Put/Delete, 
 ColumnInterpreter
 --

 Key: HBASE-9359
 URL: https://issues.apache.org/jira/browse/HBASE-9359
 Project: HBase
  Issue Type: Sub-task
Reporter: Jonathan Hsieh

 This path is the second half of eliminating KeyValue from the client 
 interfaces.  This percolated through quite a bit. 

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