-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[main]Changes in DataSourceService and DataSourceMetadataStorage inte…
…rface (#1408) * Added DataSourceMetadataStorage interface Signed-off-by: Vamsi Manohar <[email protected]> * Added new interface methods in DataSourceService and DataSourceMetadataStorage Signed-off-by: Vamsi Manohar <[email protected]> --------- Signed-off-by: Vamsi Manohar <[email protected]>
- Loading branch information
Showing
13 changed files
with
221 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ gen | |
/.prom.pid.lock | ||
|
||
.java-version | ||
.worktrees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
core/src/main/java/org/opensearch/sql/datasource/DataSourceMetadataStorage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* | ||
* * Copyright OpenSearch Contributors | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.opensearch.sql.datasource; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import javax.xml.crypto.Data; | ||
import org.opensearch.sql.datasource.model.DataSource; | ||
import org.opensearch.sql.datasource.model.DataSourceMetadata; | ||
|
||
/** | ||
* Interface for DataSourceMetadata Storage | ||
* which will be only used by DataSourceService for Storage. | ||
*/ | ||
public interface DataSourceMetadataStorage { | ||
|
||
/** | ||
* Returns all dataSource Metadata objects. The returned objects won't contain | ||
* any of the credential info. | ||
* | ||
* @return list of {@link DataSourceMetadata}. | ||
*/ | ||
List<DataSourceMetadata> getDataSourceMetadata(); | ||
|
||
|
||
/** | ||
* Gets {@link DataSourceMetadata} corresponding to the | ||
* datasourceName from underlying storage. | ||
* | ||
* @param datasourceName name of the {@link DataSource}. | ||
*/ | ||
Optional<DataSourceMetadata> getDataSourceMetadata(String datasourceName); | ||
|
||
|
||
/** | ||
* Stores {@link DataSourceMetadata} in underlying storage. | ||
* | ||
* @param dataSourceMetadata {@link DataSourceMetadata}. | ||
*/ | ||
void createDataSourceMetadata(DataSourceMetadata dataSourceMetadata); | ||
|
||
|
||
/** | ||
* Updates {@link DataSourceMetadata} in underlying storage. | ||
* | ||
* @param dataSourceMetadata {@link DataSourceMetadata}. | ||
*/ | ||
void updateDataSourceMetadata(DataSourceMetadata dataSourceMetadata); | ||
|
||
|
||
/** | ||
* Deletes {@link DataSourceMetadata} corresponding to the | ||
* datasourceName from underlying storage. | ||
* | ||
* @param datasourceName name of the {@link DataSource}. | ||
*/ | ||
void deleteDataSourceMetadata(String datasourceName); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.