OpenSearch 1.3.x porting guide (codebase map)

This repository now ships an OpenSearch 1.3.x-based Elassandra integration on top of Cassandra 4.0. Use this guide when rebasing to a newer OpenSearch tag or when replaying the Elassandra-specific delta onto a fresh upstream checkout in the side-car harness.

Bootstrap and process model

  • Merged baseline: org.apache.cassandra.service.ElassandraDaemon in the Cassandra fork extends CassandraDaemon and calls org.opensearch.bootstrap.Bootstrap / org.opensearch.node.Node.

  • Future rebases: Keep the same class location in the Cassandra fork and reconcile Node construction / validation hooks with the target OpenSearch version.

Cluster state, gateway, discovery

  • org.elassandra.discovery.CassandraDiscovery — map to OpenSearch discovery plugin SPI.

  • org.elassandra.gateway.CassandraGatewayService / CassandraGatewayModule — align with OpenSearch gateway and persisted cluster state services.

  • Patched upstream types (examples): org.opensearch.cluster.service.ClusterService, MasterService, DiscoveryModule, GatewayModule → move patches to org.opensearch.cluster.* equivalents.

Metadata and mapping

  • MetaDataCreateIndexService, IndexMetaData, IndicesModule, IndexModule, MapperService, DocumentMapper — heavy legacy touch points; expect the largest diff vs 1.3.

Mapper fork (CqlMapper / CQL columns)

Elassandra adds CqlMapper, CQL-related state on ObjectMapper / FieldMapper / MappedFieldType, and parsing hooks in TypeParsers. Stock OpenSearch does not include these; you must merge the legacy mapper fork into the matching org.opensearch.index.mapper types (often starting with ObjectMapper and FieldMapper).

Export the full forked mapper directory next to your OpenSearch clone as a read-only reference for diff and 3-way merge (does not overwrite OpenSearch sources):

./scripts/export-elassandra-mapper-fork-for-opensearch-merge.sh

Output path: <OpenSearch clone>/elassandra-mapper-fork-reference/.

To stage the fork inside this repo with package org.opensearch.index.mapper and the same automated rewrites used for the side-car (for diffing against upstream without touching the OpenSearch clone):

./scripts/stage-elassandra-mapper-fork-as-opensearch.sh
./scripts/prioritize-mapper-fork-merge.sh

Default output: build/elassandra-mapper-staged-opensearch/server/src/main/java/org/opensearch/index/mapper/.

Shard coordination

  • org.elassandra.shard.CassandraShardStateListener, CassandraShardStartedBarrier.

Secondary index bridge

  • org.elassandra.index.ElasticSecondaryIndex and related index/query handlers — JVM bridge from Cassandra writes to the search engine; must compile against OpenSearch client/index APIs.

Modules and tests

  • modules/ingest-common Elassandra processors (e.g. timeuuid, base64).

  • server/src/test/java/org/elassandra — update test framework imports; keep “single node per JVM” assumptions documented in MockCassandraDiscovery.

  • After the test framework is rebased onto OpenSearch, expect renames such as ESSingleNodeTestCaseorg.opensearch.test.OpenSearchSingleNodeTestCase and ESTestCaseOpenSearchTestCase (see upstream test/framework in the OpenSearch tree).