Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.12.3
-
None
-
Unknown
Description
After I tried a little bit, I think there are 2 problems on Consumer side:
- Returned value is null
if we specified family and qualifier options in URI, then all returned values will be null. I did some investigation, and I found the problem is caused by the equals method of HBaseCell class. In poll() method of HBaseConsumer, the resultRow will apply rowModel first before insert the resultCell, see below code:.... HBaseData data = new HBaseData(); HBaseRow resultRow = new HBaseRow(); resultRow.apply(rowModel); //the existing HBaseCell in rowModel will be insert into resultRow byte[] row = result.getRow(); resultRow.setId(endpoint.getCamelContext().getTypeConverter().convertTo(rowModel.getRowType(), row)); List<KeyValue> keyValues = result.list(); if (keyValues != null) { for (KeyValue keyValue : keyValues) { String qualifier = new String(keyValue.getQualifier()); String family = new String(keyValue.getFamily()); HBaseCell resultCell = new HBaseCell(); resultCell.setFamily(family); resultCell.setQualifier(qualifier); resultCell.setValue(endpoint.getCamelContext().getTypeConverter().convertTo(String.class, keyValue.getValue())); resultRow.getCells().add(resultCell); //will fail to insert if some cell with same Family and Qualifier exists } ... }
that means we can't specify family and qualifier option when consuming.
- remove option
the default value of remove option is true, that mean, after scan the table, all scanned row will be removed. I think it's not we expect, so user may have to add option remove=false to stop that. however this option doesn't describe on website http://camel.apache.org/hbase.html .
Besides these problem, I think some descriptions on http://camel.apache.org/hbase.html are not correct, for example the demos and Header Options. please have a check.