Skip to content

Code Layout

AOSC source lives in a single aosc-plugin/ module. Shared code is at src/main/java/com/atlassian/opensearch/aosc/; files that differ between OpenSearch 2.x and 3.x live in src/main/java-2x/ and src/main/java-3x/. Gradle selects the matching compat directory based on -PopensearchVersion. The same pattern applies to test source sets (src/{test,itTest,smokeTest,scaleTest,benchmarkTest,yamlRestTest}/). See Running Tests for the test tiers and opensearch-docker/ for the local cluster.

Main Packages

PackageResponsibility
action.*Transport actions and request/response types.
rest.*REST handlers that parse HTTP requests and call transport actions.
model.*Migration documents, options, phases, routing mode, and DTOs.
service.coordinator.*Cluster-manager-side orchestration and cutover.
service.worker.*Data-node shard workers, backfill, replay, retention leases.
service.bulk.*Bulk writer pipeline and write controllers.
service.adaptive.*AIMD and adaptive control helpers.
transform.*Identity and update-script transform functions.
statemachine.*Async state-machine framework.
utils.*Logging, JSON, async, and OpenSearch helper utilities.

Key Classes

ClassWhy it matters
AoscPluginPlugin entry point and component registration.
RestStartMigrationActionPOST /_plugins/_aosc/{index}/_start.
TransportStartMigrationActionStart validation and coordinator handoff.
AoscCoordinatorServiceManages active coordinators on the cluster-manager node.
MigrationCoordinatorCoordinator phase handlers and cutover orchestration.
AoscShardServiceCreates and manages shard workers on data nodes.
ShardMigrationWorkerWorker state machine.
BackfillEngineReads source documents and emits target index requests.
TranslogReplayEngineReplays source operation history into the target.
TransformFactoryBuilds transform functions from transform_script.
AoscSettingsCluster setting definitions and defaults.

Where Changes Usually Go

ChangeLikely files
New REST endpointrest/, action/, REST specs/tests.
New start optionMigrationRequestOptions, validators, docs, tests.
Coordinator phase behaviorMigrationCoordinator, CoordinatorPhase, state-machine tests.
Worker phase behaviorShardMigrationWorker, ShardPhase, worker tests.
Backfill or replay behaviorBackfillEngine, TranslogReplayEngine, bulk tests.
Transform behaviortransform/, TransformFactory, transform tests.
New settingAoscSettings, configuration docs, tests.

Style Notes

  • Use AoscLogger for plugin logging.
  • Keep public wire fields stable and documented.
  • Prefer existing async ActionListener and CompletableFuture bridging patterns.
  • Run Spotless before sending a pull request.

Released under the Apache 2.0 License.