Class DatasourceManager
RunPipelineCrawl run and returns its
id + api key directly. Plain blocking call on a VT — no observers, no
futures.
Connector selection is deterministic per source: each
PipelineSource maps to a single connector_type string
("jdbc", "s3"). We look up the connector by type via
DataSourceAdminServiceGrpc.DataSourceAdminServiceBlockingStub.listConnectorTypes(ListConnectorTypesRequest)
and use its real connector_id. No "default" connector, no
fallback id, no hardcoded UUIDs — if the platform doesn't have a
connector of the requested type seeded, we fail loudly.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordCredentials for a freshly-created datasource. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDatasource(String accountId, ai.pipestream.testing.harness.v1.PipelineSource source) Get-or-create a datasource under the given account, bound to the connector type that matches the requestedPipelineSource.createDatasourceForType(String accountId, String connectorType) Get-or-create the (account, connector-type) datasource — thePipelineSource-agnostic core ofcreateDatasource(String, PipelineSource).voidensureConnectorType(String connectorType, String displayName) Idempotently register a connector TYPE — for harnesses that act as their own connector (the engine-perf test registerstesting-sidecar).rotateApiKey(String datasourceId) Rotate the datasource's API key and return the NEW key.
-
Constructor Details
-
DatasourceManager
public DatasourceManager()Creates the datasource manager. The gRPC stubs are injected by the container; instances are managed by CDI.
-
-
Method Details
-
createDatasource
public DatasourceManager.DatasourceCredentials createDatasource(String accountId, ai.pipestream.testing.harness.v1.PipelineSource source) Get-or-create a datasource under the given account, bound to the connector type that matches the requestedPipelineSource.The datasource id is deterministic (
hash(account_id + connector_id)), so reruns under a stable account converge on the same datasource — and therefore the same graph (graphIdis account-derived) and the same idempotent intake-node binding. We reuse an existing datasource when present (its api key is returned by the admin service) instead of churning a new one each run. A fresh/random account naturally has none and gets a freshly-created datasource.- Parameters:
accountId- the account the datasource is created/reused undersource- the requested pipeline source, mapped to a connector type- Returns:
- the datasource's id + api key (reused or freshly created)
- Throws:
IllegalStateException- if the connector type isn't registered or the connector reportssuccess=false
-
ensureConnectorType
Idempotently register a connector TYPE — for harnesses that act as their own connector (the engine-perf test registerstesting-sidecar). ALREADY-EXISTS (by any signal) is success.- Parameters:
connectorType- the connector_type string to registerdisplayName- the human-readable name for the connector type- Throws:
IllegalStateException- if registration fails for a reason other than the type already existing
-
rotateApiKey
Rotate the datasource's API key and return the NEW key. Doubles as a run lock for single-writer test harnesses: any still-open stream from a previous run fails its next handshake on the old key.- Parameters:
datasourceId- the datasource whose api key is rotated (old key invalidated immediately)- Returns:
- the new api key
- Throws:
IllegalStateException- if the rotate call reportssuccess=false
-
createDatasourceForType
public DatasourceManager.DatasourceCredentials createDatasourceForType(String accountId, String connectorType) Get-or-create the (account, connector-type) datasource — thePipelineSource-agnostic core ofcreateDatasource(String, PipelineSource).- Parameters:
accountId- the account the datasource is created/reused underconnectorType- the connector_type whose registered connector the datasource binds to- Returns:
- the datasource's id + api key (reused or freshly created)
- Throws:
IllegalStateException- if no connector of the type is registered or creation reportssuccess=false
-