[Main ]Create datasource API#1458
Conversation
99e6fdf to
b98edbb
Compare
I will add all the required issues.
It should work for queries on default Opensearch Connector even in case of red
I was thinking on similar lines whether this code is really required in core or some other place. will discuss with you and try to move this. ** Captured important comments from other PR** |
| @Override | ||
| public List<DataSourceMetadata> getDataSourceMetadata() { | ||
| if (!this.clusterService.state().routingTable().hasIndex(DATASOURCE_INDEX_NAME)) { | ||
| createDataSourcesIndex(); |
There was a problem hiding this comment.
in which condition .ql-datasources index is created? plugin load time? client call create datasource API?
There was a problem hiding this comment.
client call create datasource API.
There was a problem hiding this comment.
check other plugins when they are creating an index.
There was a problem hiding this comment.
https://github.com/opensearch-project/ml-commons/blob/main/plugin/src/main/java/org/opensearch/ml/indices/MLIndicesHandler.java#L62
https://github.com/opensearch-project/observability/blob/main/src/main/kotlin/org/opensearch/observability/index/ObservabilityIndex.kt#L90
Both of these plugins uses similar patterns. Going ahead with this approach. Will create a fix , fi we uncover any bugs.
penghuo
left a comment
There was a problem hiding this comment.
High level comments,
- The CRUD operation on
.ql-datasourcecould be rewrite as plan, then we can reuse existing query execution logic. - Failure cases we should consider. for example, (1) if cluster write blocked. then plugin can not create/write. (2) if the data in .ql-datasource lost.
b98edbb to
6196af5
Compare
Any advantage in doing so and also I need to stash current context of thread to behave like an admin and make changes to system index. (.ql-datasources)
Need to look into other plugins when cluster writes are blocked.[Mostly apis stop working until we fix it.] |
6196af5 to
621ee4e
Compare
Signed-off-by: vamsi-amazon <reddyvam@amazon.com>
621ee4e to
e12087a
Compare
Signed-off-by: vamsi-amazon <reddyvam@amazon.com> (cherry picked from commit 12bc2b4)
Signed-off-by: vamsi-amazon <reddyvam@amazon.com>
Signed-off-by: vamsi-amazon <reddyvam@amazon.com>

Description
Earlier PR on 2.x branch: #1427
This PR covers Create datasource REST API.
Create datasource [REST API]
Get datasource along with storage engine and other artifacts [Internal use case only]
Issues Resolved
#1454
Check List
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.