Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.
This repository was archived by the owner on May 10, 2024. It is now read-only.

RPCHBaseService closes HTableInterfaceFactory before return data #2

@pobla

Description

@pobla

Hi folks,

I think I've found an issue that may affect how the default implementation of HBaseService returns the data from HBase. It would just affect the 'scan' operation which is the one that returns the results as ResultIterable. The problem is that the returned value by the scan method in RPCHBaseService is an instance of ResultsIterable which contains the Scan object, the fetch size and an instance of HTableInterface (*) which is closed right after being returned in the finally block.

They way it usually proceeds is passing a callback instance (TableCallBack) to the private method doWithTable and then it follows the sequence:
1.- Create table: obtain the instance of HTableInterface.
2.- Invoke doWithHBaseAdmin method in the callback instance
3.- Return the object returned by doWithHBaseAdmin method.
4.- In the finally block, if the htable is not null, close it.

The problem with this method is that the results from HBase hasn't been retrieved (actually the hbase scan method is not yet invoked) when the doWithHBaseAdmin returns, they are expected to be fetched when the ResultIterable object is iterated over (see RPCHBaseService$ResultIterable#getMoreResults), but in that moment the HTableInterface instance (*) will have been closed and the results won't be returned.

I've noticed this issue runing mule-module-hbase-2.0.2, but I've checked the implementation in 2.0.3 and looks like there haven't been changes in that class.

Perhaps I'm missing something, so please, let me know if I need to add anything to avoid that or if you need any further indication in case it this can be actually happening,

Thanks in advance for your help,
Regards,
Alberto.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions