Class OpenSearchTestSetupService
E2EPipelineTestService's
registerConfigs(...) chain — registers the minimum ChunkerConfigs,
EmbeddingConfigs, VectorSet recipes, and IndexPlan the opensearch-sink needs
to resolve a plan and publish indexing work (inline Kafka event below the
size threshold, S3 claim-check + pointer above it; OSM's
KafkaIndexingConsumer indexes — no redis on this path).
Targets the same data the court-1000 chunker fixtures actually carry:
chunk_config_id values "sentence-10-3" and
"sentences_internal", both on source_field_name = "body".
Idempotent: every step recovers from ALREADY_EXISTS by looking
up the existing row by name and reusing its id. Re-running setup against
the same OSM instance is safe — it returns the same plan id every time.
Exceptions on the gRPC stubs propagate verbatim — no swallowing, no debug-only logging.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of a single setup run.static final recordResult of a sink-perf setup: the plan the sink resolves plus what to tear down afterwards. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault index name when the caller doesn't override. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRun the full setup.setupForSink(String indexName, ai.pipestream.opensearch.v1.IndexingStrategy strategy, List<String> vectorSetIds) E2E-faithful sink setup for the module perf test: create an IndexPlan with a PINNED id (plan-<indexName>— the sink resolvesplan_ids[]entries viaGetIndexPlan(id), so the id must be the value we hand it), the caller-chosenIndexingStrategy, and the caller's vector-set ids (the e2e 2×2 fromEmbedderFixturesRegistrar.registerForEmbedderPipeline()), then gate on READY exactly like the crawl does — the sink rejects any doc whose plan isn't READY.Flattens aOpenSearchTestSetupService.SetupResultinto an ordered map shape suitable for JAX-RS serialization, exposing every id field plus the audit log.Inverse ofsetup(String): destroy everything a setup run provisioned for one index, leaving the shared deterministic recipes (ChunkerConfigs, EmbeddingConfig, VectorSet definitions) in place for the next run to reuse.Teardown for asetupForSink(String, IndexingStrategy, List)session — same steps asteardown(SetupResult), driven off the sink-perf result's ids.Core teardown by ids — seeteardown(SetupResult)for semantics.
-
Field Details
-
DEFAULT_INDEX_NAME
Default index name when the caller doesn't override. Prefix matches the cleanup allow-list (idx-test-) so/cleanupcan drop it.- See Also:
-
-
Constructor Details
-
OpenSearchTestSetupService
public OpenSearchTestSetupService()CDI.
-
-
Method Details
-
setup
Run the full setup. Sequential — Hibernate session corruption shows up under concurrent create-with-duplicate-key contention (see comment inE2EPipelineTestService#registerConfigs).- Parameters:
indexName- OS index name; defaults toDEFAULT_INDEX_NAME- Returns:
- ids of everything created or reused, plus a human audit log
-
setupToJson
Flattens aOpenSearchTestSetupService.SetupResultinto an ordered map shape suitable for JAX-RS serialization, exposing every id field plus the audit log.- Parameters:
r- the setup result to convert- Returns:
- an ordered map of the result's fields ready for JSON serialization
-
setupForSink
public OpenSearchTestSetupService.SinkPerfSetup setupForSink(String indexName, ai.pipestream.opensearch.v1.IndexingStrategy strategy, List<String> vectorSetIds) E2E-faithful sink setup for the module perf test: create an IndexPlan with a PINNED id (plan-<indexName>— the sink resolvesplan_ids[]entries viaGetIndexPlan(id), so the id must be the value we hand it), the caller-chosenIndexingStrategy, and the caller's vector-set ids (the e2e 2×2 fromEmbedderFixturesRegistrar.registerForEmbedderPipeline()), then gate on READY exactly like the crawl does — the sink rejects any doc whose plan isn't READY.- Parameters:
indexName- OS index name; also names the plan asplan-<indexName>strategy- the indexing strategy to provision the plan withvectorSetIds- vector-set ids to attach to the plan- Returns:
- the pinned plan id plus the index and vector sets to tear down
-
teardown
Teardown for asetupForSink(String, IndexingStrategy, List)session — same steps asteardown(SetupResult), driven off the sink-perf result's ids.- Parameters:
s- the sink-perf setup to tear down- Returns:
- human audit log of what was destroyed or skipped
-
teardown
Inverse ofsetup(String): destroy everything a setup run provisioned for one index, leaving the shared deterministic recipes (ChunkerConfigs, EmbeddingConfig, VectorSet definitions) in place for the next run to reuse.- Unbind each vector set from the index (drops the binding rows).
DeleteIndexPlan(deleteIndices=true)— OSM resolves the plan's strategy and drops every OS index it governs (including SEPARATE_INDICES per-vector-set indices) plus the plan row.- Delete the session's claim-check drives (
{account}:index:{indexName}) — the sink's S3-staged indexing payloads (Kafka carries pointers).
Refuses (throws) unless the index name starts with a
disposable prefix— same spirit as the cleanup endpoint's allow-list, hard-coded here because this path is only ever called on indices this service itself named.Best-effort per step: a failed unbind or trim is recorded in the audit and the remaining steps still run, so a partial earlier failure never wedges cleanup permanently.
- Parameters:
r- the setup result whose index, plan, and vector sets to destroy- Returns:
- human audit log of what was destroyed/skipped
-
teardown
Core teardown by ids — seeteardown(SetupResult)for semantics.- Parameters:
idx- OS index name; must start with a disposable prefix (TEARDOWN_PREFIXES) or teardown is refusedplanId- id of the IndexPlan to delete (along with its indices)vectorSetIds- vector-set ids to unbind from the index- Returns:
- human audit log of what was destroyed or skipped
-