Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

What is the correct way to get the HBase table using the end point co-processor?

What is the correct way to get the HBase table using the end point co-processor?

Contributor

Hi All,

I am using the endpoint coprocessor in HBase for fetching the records .

And here is the code Snippet of how I am getting the internal Scanner

InternalScanner internalScanner = regionCoprocessorEnv.getRegion().getScanner(scan); List<Cell> results2 = new ArrayList<Cell>(); boolean hasMore = false; do { if (internalScanner != null) hasMore = internalScanner.next(results2); String instance = null; for (Cell cell : results2) { instance = Bytes .toString(Bytes.copy(cell.getRowArray(), cell.getRowOffset(), cell.getRowLength())); } }while (hasMore);

The Question is : Is it the right way to get the Intrnal Scanner ? If so ,

The next Question is why even the simple request to this coprocessor is loading all regions present on all the Region Servers to process it though the data I am fetching is not distributed on all over the regions present as it is the call for the recent data.

And Please suggest me the way to solve this problem . The main issue is it is simply scanning all the regions so the over all time taken is increasing .

Thanks in Advance ,

Param.

2 REPLIES 2

Re: What is the correct way to get the HBase table using the end point co-processor?

Super Collaborator

Re: What is the correct way to get the HBase table using the end point co-processor?

Contributor

Yes, I am creating the MultiRowRangeFilter and adding to the filter list and then setting to the same on scan object.

Don't have an account?
Coming from Hortonworks? Activate your account here