Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor shardingsphere-infra-expr to expose the use of Row Value Expressions SPI #28340

Merged
merged 2 commits into from
Sep 23, 2023

Conversation

linghengqian
Copy link
Member

@linghengqian linghengqian commented Sep 2, 2023

For #22899.

Changes proposed in this pull request:

  • Refactor shardingsphere-infra-expr to expose the use of Row Value Expressions SPI. Introduced the use of SPI for <SPITypeName>dataNodes. A simple implementation of this SPI is located at CustomInlineExpressionParserFixture. Unit tests are located at InlineExpressionParserFactoryTest.
  • The shardingsphere-infra-expr-hotsopt module was renamed shardingsphere-infra-expr-groovy, and the Type Name of the corresponding SPI implementation was changed from HOTSPOT to GROOVY.
  • For the InlineExpressionParser interface, the input parameters of all functions are processed in advance to InlineExpressionParserFactory#newInstance. The existence of handlePlaceHolder() and evaluateClosure() is as diluted as possible, and users should only implement the splitAndEvaluate() method and a fixed-content handlePlaceHolder() method in most cases.
  • Going forward, evaluateClosure() should be extracted to some different classes, as it is foreseeable that in most cases the SPI implementation will not use Groovy's class.
  • Also for Make ShardingSphere Proxy in GraalVM Native Image form available #21347 .

Before committing this PR, I'm sure that I have checked the following options:

  • My code follows the code of conduct of this project.
  • I have self-reviewed the commit code.
  • I have (or in comment I request) added corresponding labels for the pull request.
  • I have passed maven check locally : ./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e.
  • I have made corresponding changes to the documentation.
  • I have added corresponding unit tests for my changes.

@linghengqian linghengqian force-pushed the add-new-spi branch 10 times, most recently from 5e19929 to 3de6da6 Compare September 3, 2023 07:56
@linghengqian linghengqian marked this pull request as ready for review September 3, 2023 09:35
@linghengqian linghengqian changed the title Refactor shardingsphere-infra-expr to expose the use of SPI Refactor shardingsphere-infra-expr to expose the use of Row Value Expressions SPI Sep 3, 2023
@terrymanu terrymanu merged commit 065fe17 into apache:master Sep 23, 2023
127 checks passed
@linghengqian linghengqian deleted the add-new-spi branch September 23, 2023 13:09
@linghengqian linghengqian added this to the 5.4.1 milestone Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants