Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7296

camel-hbase component have some bugs on Consumer side

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.12.3
    • Fix Version/s: 2.12.4, 2.13.1, 2.14.0
    • Component/s: camel-hbase
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      After I tried a little bit, I think there are 2 problems on Consumer side:

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

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

        Attachments

          Activity

            People

            • Assignee:
              njiang Willem Jiang
              Reporter:
              gangliu liugang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: