Class DataSourceService
java.lang.Object
org.elasticsearch.xpack.esql.datasources.datasource.DataSourceService
Orchestrates create / replace / delete of data sources in cluster state.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDataSourceService(ClusterService clusterService, Map<String, DataSourceValidator> validatorsByType, EncryptionService encryptionService) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteDataSources(ProjectId projectId, TimeValue masterNodeTimeout, TimeValue ackTimeout, Collection<String> names, ActionListener<AcknowledgedResponse> listener) Delete data sources by name.protected DataSourceMetadatagetMetadata(ProjectMetadata projectMetadata) voidputDataSource(ProjectId projectId, PutDataSourceAction.Request request, ActionListener<AcknowledgedResponse> listener) Create or replace a data source.validatePutDataSource(ProjectMetadata project, PutDataSourceAction.Request request) Validate the put-data-source request and build the domainDataSource.
-
Field Details
-
MAX_DATA_SOURCES_COUNT_SETTING
-
clusterService
-
-
Constructor Details
-
DataSourceService
public DataSourceService(ClusterService clusterService, Map<String, DataSourceValidator> validatorsByType, EncryptionService encryptionService)
-
-
Method Details
-
getMetadata
-
validatePutDataSource
public DataSource validatePutDataSource(ProjectMetadata project, PutDataSourceAction.Request request) Validate the put-data-source request and build the domainDataSource. -
putDataSource
public void putDataSource(ProjectId projectId, PutDataSourceAction.Request request, ActionListener<AcknowledgedResponse> listener) Create or replace a data source. A newly-supplied secret is encrypted master-side (applyEncryption(java.lang.String, org.elasticsearch.xpack.esql.datasources.metadata.DataSourceSettings)) off the CAS task thread, since that's expensive and would otherwise block the master on every concurrent PUT. A secret omitted from the request is instead carried forward from the current entry inside the CAS task (viamergeCarriedForwardSecrets(org.elasticsearch.xpack.esql.datasources.metadata.DataSource, java.lang.String, org.elasticsearch.xpack.esql.datasources.metadata.DataSourceSettings, org.elasticsearch.xpack.esql.datasources.datasource.PutDataSourceAction.Request)), wherecurrentis read fresh against authoritative state and carrying the secret forward needs no encryption. The task also re-validates against that same fresh state, so a concurrent change to a secret this request relies on carrying forward fails the PUT instead of silently persisting an incomplete data source. Every other field is a full replace, matching the pre-existing PUT semantics. -
deleteDataSources
public void deleteDataSources(ProjectId projectId, TimeValue masterNodeTimeout, TimeValue ackTimeout, Collection<String> names, ActionListener<AcknowledgedResponse> listener) Delete data sources by name. Fails with 409 if any dataset references one; 404 if a name doesn't exist.
-