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

[2.x]Changes in DataSourceService and DataSourceMetadataStorage interface #1391

Conversation

vamsimanohar
Copy link
Member

@vamsimanohar vamsimanohar commented Mar 3, 2023

Description

Definitions

  • Datasource : Datasource class holds basic datasource info(name, connector), storage engine and other objects created specific to a datasource.
  • DatasourceMetadata: DatasourceMetadata class carries all the metadata required for a datasource.
  • DatasourceService: This class acts as interface for datasources and datasource metadata management.
  • DatasourceMetadataStorageService: This class acts as interface for datasource metadata storage.

usecases

  • CRUD APIs for datasources.
  • Analyzer class
    • Fully Qualified Name Resolution requires names of all datasources. [Queries GetAllDatasourceMetadata]
    • DataSourceTable class requires metadata(name, connector) of all datasources for show datasources command. [Queries GetAllDatasourceMetadata]
    • Requires storage engine to implement and execute queries. [Queries GetAllDatasourceMetadata]

code flow for each usecase.

Datasource bootstrapping during plugin startup [Internal usecase for storage engine creation]

Screen Shot 2023-03-06 at 5 56 34 PM

Create datasource [REST API]

Screen Shot 2023-03-06 at 6 09 58 PM

Get datasource along with storage engine and other artifacts [Internal use case only]

Screen Shot 2023-03-06 at 6 13 39 PM

Get datasource [REST API]

Screen Shot 2023-03-06 at 6 21 26 PM

Delete datasource [REST API]

Screen Shot 2023-03-06 at 6 21 44 PM

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@vamsimanohar vamsimanohar force-pushed the datasource-metadata-interface branch from b4f0dc5 to 61343b8 Compare March 3, 2023 06:46
@vamsimanohar vamsimanohar self-assigned this Mar 3, 2023
@vamsimanohar vamsimanohar added the enhancement New feature or request label Mar 3, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2023

Codecov Report

Merging #1391 (61343b8) into 2.x (a32bcbe) will increase coverage by 0.00%.
The diff coverage is 100.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##                2.x    #1391   +/-   ##
=========================================
  Coverage     98.38%   98.38%           
- Complexity     3698     3699    +1     
=========================================
  Files           345      345           
  Lines          9113     9118    +5     
  Branches        585      585           
=========================================
+ Hits           8966     8971    +5     
  Misses          142      142           
  Partials          5        5           
Flag Coverage Δ
sql-engine 98.38% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ain/java/org/opensearch/sql/analysis/Analyzer.java 100.00% <100.00%> (ø)
...ensearch/sql/datasource/DataSourceServiceImpl.java 100.00% <100.00%> (ø)
...anner/physical/datasource/DataSourceTableScan.java 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@vamsimanohar vamsimanohar marked this pull request as ready for review March 3, 2023 08:25
@vamsimanohar vamsimanohar requested a review from a team as a code owner March 3, 2023 08:25
@vamsimanohar vamsimanohar changed the title Added DataSourceMetadataStorage interface Changes in DataSourceService and DataSourceMetadataStorage interface Mar 7, 2023
Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
…taStorage

Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
@vamsimanohar vamsimanohar force-pushed the datasource-metadata-interface branch from da4d1ee to d5b01dc Compare March 7, 2023 21:33
Copy link
Collaborator

@penghuo penghuo left a comment

Choose a reason for hiding this comment

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

thanks for the change!
Could you merge to main first? Then backport to 2.x.

@vamsimanohar vamsimanohar changed the title Changes in DataSourceService and DataSourceMetadataStorage interface [2.x]Changes in DataSourceService and DataSourceMetadataStorage interface Mar 8, 2023
Copy link
Collaborator

@dai-chen dai-chen left a comment

Choose a reason for hiding this comment

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

Thanks for the refactoring! Could you add the detailed design in PR description to a dev doc under https://github.com/opensearch-project/sql/blob/main/docs/dev/index.md#data-sources ?

@dai-chen dai-chen added the maintenance Improves code quality, but not the product label Mar 8, 2023
@vamsimanohar
Copy link
Member Author

#1414
Closing in favour of this backport PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request maintenance Improves code quality, but not the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants