Skip to content

Conversation

@tkhurana
Copy link
Contributor

@tkhurana tkhurana commented Oct 2, 2025

Changes in the patch:

  1. Allow page timeouts on valid (not dummy) results
  2. Perf optimization of not creating multiple scanner context objects on every next() call. The current code allocates 2 and sometimes 4 scanner context objects on every next() call. Also, the metrics are copied from one scanner context to other. This patch only allocates one scanner context object for every rpc.
  3. Introduces PhoenixScannerContext which tracks the startTime of the rpc so that all the scanners work with the same start time rather than each having their own. This gives more consistent paging behavior.
  4. Also fixes count of rows scanned metric for offset queries.

long numRows = getMetricValue(metrics, MetricType.COUNT_ROWS_SCANNED);
assertEquals(expectedValidRows, numRows);
long numRpcs = getMetricValue(metrics, MetricType.COUNT_RPC_CALLS);
assertTrue(numRpcs > 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming that HBase will return at most 100 rows per RPC, should this be assertTrue(numRpcs > Math.ceil(numRows / (double) 100));?

Copy link
Contributor

@kadirozde kadirozde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve this. It will be good if you make the minor change on the test I suggested. Thanks!

Copy link
Contributor

@palashc palashc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, this is a nice change!

@tkhurana tkhurana merged commit 96b8ffe into apache:master Oct 9, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants