Skip to content

Simplify Exchange interfaces#13945

Merged
arhimondr merged 3 commits intotrinodb:masterfrom
arhimondr:remove-some-exchange-methods
Sep 2, 2022
Merged

Simplify Exchange interfaces#13945
arhimondr merged 3 commits intotrinodb:masterfrom
arhimondr:remove-some-exchange-methods

Conversation

@arhimondr
Copy link
Copy Markdown
Contributor

Description

Remove Exchange#getExchangeSourceStatistics and Exchange#split method methods. See commit messages for more details.

Is this change a fix, improvement, new feature, refactoring, or other?

Refactoring

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Exchange

How would you describe this change to a non-technical end user or system administrator?

N/A

Related issues, pull requests, and links

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

@cla-bot cla-bot bot added the cla-signed label Aug 31, 2022
@arhimondr arhimondr changed the title Remove some exchange methods Simplify Exchange interfaces Aug 31, 2022
@arhimondr arhimondr force-pushed the remove-some-exchange-methods branch from 61d0a3a to 0e3b077 Compare August 31, 2022 20:00
@arhimondr arhimondr force-pushed the remove-some-exchange-methods branch from 0e3b077 to 2c5a5b5 Compare September 1, 2022 03:37
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: worth caching?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(preexistent)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I fixed it to be called only once per handle. Caching is not ideal as it would use an extra memory. Ideally it shouldn't be called more than once.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am not convinced that we should drop this one. It make the SPI contract not obvious. What is the expected size of source handles to be returned by getSourceHandles now. What if exchange implementation can split the data into arbitrarly small chunks. Should it return 1M handles each serving 10 bytes of data or 1K each serving 10K?

If we drop split maybe we should pass a hint targetSourceHandleSizeInBytes to getSourceHandles?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Discussed offline

Copy link
Copy Markdown
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

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

removal of statistics fine.
Regarding split lets talk.

…shed

Added for testing, committed by mistake
In favor of ExchangeSourceHandle#getDataSizeInBytes

The additional indirection is inconvenient as it requires the Exchange
object to be available to simply get the size of data referenced by a
certain ExchangeSourceHandle. In practice this information is either
available in ExchangeSourceHandle internally or can easily be made
available.
In favor of creating smaller ExchangeSourceHandle's.

It is possible to create more than a single ExchangeSourceHandle per
partition. Instead of splitting an existing ExchangeSourceHandle it
is more natural not to create too large ExchangeSourceHandle in first
place.
@arhimondr arhimondr force-pushed the remove-some-exchange-methods branch from 2c5a5b5 to 30da438 Compare September 1, 2022 16:00
@arhimondr
Copy link
Copy Markdown
Contributor Author

@losipiuk Updated

@arhimondr arhimondr merged commit d68ee01 into trinodb:master Sep 2, 2022
@arhimondr arhimondr deleted the remove-some-exchange-methods branch September 2, 2022 13:28
@github-actions github-actions bot added this to the 395 milestone Sep 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants