Key Classes by Subsystem

This is the "where does X live" map. When you have a behavior and need the class that implements it — or a class name from a stack trace and need to know what subsystem owns it — start here. Each subsystem lists its key classes, a one-line role, and the chapter that explains it in full.

The classes span three roots: OpenSearch server (org.opensearch.*), Apache Lucene (org.apache.lucene.*), and the plugin ecosystems (org.opensearch.knn.*, org.opensearch.security.*). Package prefixes are given once per row where they aren't obvious.

Warning: Class names get refactored across versions — a class may move packages, split, or be renamed. Treat every name here as a starting point and grep to confirm in your checkout:

# Confirm a class exists and find its package:
grep -rn "class BalancedShardsAllocator" server/src/main/java/
# Find an interface's implementations:
grep -rln "implements AllocationDecider\|extends AllocationDecider" server/src/main/java/

Note: "cluster manager" (formerly "master") is the current term. The Java classes and methods were renamed (MasterService→ClusterManagerService, getMasterNode()→getClusterManagerNode()); only user-facing settings/REST params keep a deprecated master alias (e.g. master_timeout). When reading older blogs or 1.x/2.x code, mentally map every Master* symbol to its ClusterManager* name — and grep for both, since branches differ.

Jump to: Node & bootstrap · Cluster coordination · Cluster state · Transport · REST · Actions · Thread pools · Indexing & engine · Translog · Mapping & analysis · Search · Query & scoring · Aggregations · DocValues · Allocation · Recovery · Replication · Snapshots · Circuit breakers · Plugins · k-NN · Security · Telemetry


Node & bootstrap

The startup path: parse settings, build every service, wire them together.

ClassRoleRead
org.opensearch.node.NodeThe god object; its constructor builds and injects every service../deep-dives/cluster-and-node-model.md
org.opensearch.bootstrap.BootstrapProcess entry: checks, security manager, starts the Node../deep-dives/cluster-and-node-model.md
org.opensearch.bootstrap.BootstrapChecksEnforces production prerequisites (heap, file descriptors, vm.max_map_count)../deep-dives/cluster-and-node-model.md
org.opensearch.cluster.node.DiscoveryNodeIn-memory node descriptor: id, address, roles, attributes../deep-dives/cluster-and-node-model.md
org.opensearch.common.settings.Settings / SettingImmutable settings bag; typed, scoped setting definitionsconfig reference
org.opensearch.env.Environment / NodeEnvironmentResolves paths (config, data, logs) and per-node data directories../deep-dives/cluster-and-node-model.md

Cluster coordination

Electing a cluster manager and agreeing on state — the Zen2 / Raft-like layer.

Class (org.opensearch.cluster.coordination.*)RoleRead
CoordinatorThe consensus engine: elections, joins, publication, liveness../deep-dives/discovery-coordination.md
CoordinationStatePersisted (term, version) + accepted/committed state; the safety core../masterclass/distributed-consensus/lab-01-trace-an-election.md
PreVoteCollector / ElectionSchedulerFactoryPre-vote round and randomized election scheduling../masterclass/distributed-consensus/lab-01-trace-an-election.md
JoinHelperDrives start-join requests and join validation../deep-dives/discovery-coordination.md
VotingConfiguration / ReconfiguratorThe quorum set and how it shrinks/grows as nodes join/leave../masterclass/distributed-consensus/lab-01-trace-an-election.md
PublicationTransportHandlerTwo-phase publish → commit of a new cluster state../masterclass/distributed-consensus/lab-03-cluster-state-pub-sub.md
LeaderChecker / FollowersCheckerLiveness probes both directions; trigger failover/removal../masterclass/distributed-consensus/lab-02-failure-detection-partitions.md
ClusterBootstrapServiceForms the initial quorum from cluster.initial_cluster_manager_nodes../deep-dives/discovery-coordination.md
ClusterFormationFailureHelperExplains why a cluster won't form (the log you'll read at 3am)../masterclass/distributed-consensus/lab-02-failure-detection-partitions.md

Cluster state

The immutable, versioned snapshot every node agrees on, and how updates apply.

Class (org.opensearch.cluster.*)RoleRead
ClusterStateThe root immutable snapshot tying the components below together../deep-dives/cluster-state.md
metadata.Metadata / metadata.IndexMetadataIndex settings, mappings, templates, persistent cluster settings../deep-dives/cluster-state.md
routing.RoutingTable / IndexRoutingTable / ShardRoutingWhere each shard copy is assigned and its state../deep-dives/cluster-state.md
node.DiscoveryNodesThe set of nodes in the cluster + who is cluster manager../deep-dives/cluster-state.md
block.ClusterBlocksRead/write/metadata blocks (e.g. read-only-allow-delete)../deep-dives/cluster-state.md
service.ClusterManagerServiceComputes new states from update tasks on the cluster manager../deep-dives/cluster-state-publishing.md
service.ClusterApplierServiceApplies committed states to local services via appliers/listeners../deep-dives/cluster-state-publishing.md
ClusterStateUpdateTask / AckedClusterStateUpdateTaskThe unit of a state change, optionally ack-tracked../deep-dives/cluster-state-publishing.md
Diffable / DiffWire-efficient state diffs sent during publication../deep-dives/cluster-state.md

Transport

The node-to-node RPC fabric (port 9300).

Class (org.opensearch.transport.*)RoleRead
TransportServiceSends requests, registers request handlers, manages connections../deep-dives/transport-layer.md
transport.netty4.Netty4TransportThe Netty-based wire implementation../deep-dives/transport-layer.md
TransportRequestHandler / TransportRequest / TransportResponseThe handler + message base types../deep-dives/transport-layer.md
org.opensearch.core.common.io.stream.Writeable / StreamInput / StreamOutputVersion-gated serialization of any object on the wire../deep-dives/serialization-bwc.md
org.opensearch.common.io.stream.NamedWriteableRegistryMaps wire names to readers for polymorphic types../deep-dives/serialization-bwc.md

REST

The HTTP edge (port 9200): route → handler → client call.

Class (org.opensearch.rest.*)RoleRead
RestControllerDispatches an HTTP request to the matching RestHandler../deep-dives/rest-layer.md
RestHandler / BaseRestHandlerRegisters a route and builds the action call in prepareRequest../deep-dives/rest-layer.md
org.opensearch.client.node.NodeClientThe in-node client a RestHandler uses to execute an ActionType../deep-dives/rest-layer.md
org.opensearch.core.xcontent.XContentParser / XContentBuilderParses request JSON / renders response JSON../deep-dives/rest-layer.md
org.opensearch.http.netty4.Netty4HttpServerTransportThe HTTP server implementation../deep-dives/rest-layer.md

Actions

Binding request types to handlers and intercepting them.

Class (org.opensearch.action.*)RoleRead
ActionTypeA typed handle naming an action (e.g. SearchAction.INSTANCE)../deep-dives/action-framework.md
support.TransportAction / HandledTransportActionBase classes for the server-side action handler../deep-dives/action-framework.md
support.replication.TransportReplicationActionBase for write actions that go primary → replicas../deep-dives/replication.md
org.opensearch.action.ActionModuleRegisters every action, filter, and REST handler at startup../deep-dives/action-framework.md
support.ActionFilter / ActionFiltersThe pre/post interception chain (security hooks in here)../deep-dives/action-framework.md
org.opensearch.core.action.ActionListenerThe async response/failure callback threaded through everything../deep-dives/action-framework.md

Thread pools

The bounded executors that run all work, and the context they carry.

Class (org.opensearch.threadpool.* / common.util.concurrent.*)RoleRead
ThreadPoolThe named-pool registry (search, write, get, management, …)../deep-dives/threadpools-concurrency.md
common.util.concurrent.OpenSearchThreadPoolExecutorThe executor type with bounded queues and rejection../deep-dives/threadpools-concurrency.md
common.util.concurrent.ThreadContextPer-thread headers/transients (carries the authenticated user)../deep-dives/threadpools-concurrency.md
common.util.concurrent.AbstractRunnableThe runnable base that funnels failures to onFailure../deep-dives/threadpools-concurrency.md

Indexing & engine

The per-shard write path over Lucene.

ClassRoleRead
org.opensearch.indices.IndicesServiceOwns all indices on the node; creates IndexServices../deep-dives/index-shard-lifecycle.md
org.opensearch.index.IndexServicePer-index services; creates IndexShards../deep-dives/index-shard-lifecycle.md
org.opensearch.index.shard.IndexShardPer-shard object: state machine, op application, search refs../deep-dives/index-shard-lifecycle.md
org.opensearch.index.engine.InternalEngineThe write engine wrapping Lucene IndexWriter../deep-dives/engine-internals.md
org.opensearch.index.engine.Engine (+ Engine.Searcher)The engine contract and the searcher-acquire abstraction../deep-dives/engine-internals.md
org.opensearch.index.engine.LiveVersionMapIn-memory id → version/seqNo for real-time get and conflicts../deep-dives/engine-internals.md
org.opensearch.index.store.Store / org.apache.lucene.store.DirectoryThe shard's file abstraction and Lucene's I/O abstraction../deep-dives/index-shard-lifecycle.md
org.apache.lucene.index.IndexWriterLucene's single writer: buffers docs, flushes segments, commits../lucene/indexwriter-and-merges.md
org.apache.lucene.index.MergePolicy / ConcurrentMergeSchedulerChooses merges and runs them in the background../lucene/indexwriter-and-merges.md

Translog

The per-shard write-ahead log.

Class (org.opensearch.index.translog.*)RoleRead
TranslogThe WAL: generations, durability, replay; the engine's safety net../deep-dives/translog.md
TranslogWriter / TranslogReaderAppend the current generation / read a sealed one../deep-dives/translog.md
CheckpointThe .ckp file: ops count, seqNo bounds, generation../deep-dives/translog.md
Translog.DurabilityREQUEST (fsync per request) vs ASYNC (periodic)config reference

Mapping & analysis

Schema and the text-to-terms pipeline.

Class (org.opensearch.index.mapper.* / index.analysis.*)RoleRead
MapperServiceHolds the mapping; resolves field name → MappedFieldType../deep-dives/mapping-and-analysis.md
FieldMapper / MappedFieldTypeHow a field indexes / how it is queried../deep-dives/mapping-and-analysis.md
DocumentMapper / DocumentParserParses a JSON doc into indexable Lucene fields../deep-dives/mapping-and-analysis.md
AnalysisRegistry / IndexAnalyzersBuilds and holds analyzers from the analysis chain../deep-dives/mapping-and-analysis.md
org.apache.lucene.analysis.Analyzer / Tokenizer / TokenFilterThe Lucene char-filter → tokenizer → token-filter pipeline../deep-dives/mapping-and-analysis.md

Fanning a search across shards and reducing it.

Class (org.opensearch.search.* / action.search.*)RoleRead
action.search.TransportSearchActionCoordinates scatter/gather across shards../deep-dives/search-execution.md
SearchServicePer-node: creates SearchContext, runs query/fetch phases../deep-dives/search-execution.md
internal.SearchContext / ContextIndexSearcherPer-shard search state / the searcher wrapper that runs collectors../deep-dives/search-execution.md
action.search.SearchPhaseControllerThe coordinator-side reduce of per-shard results../deep-dives/search-execution.md
query.QuerySearchResult / fetch.FetchSearchResultThe per-shard outputs of the two phases../deep-dives/search-execution.md
org.apache.lucene.search.IndexSearcher / CollectorManagerLucene's search entry point / slice-safe collection for concurrency../engineering/concurrent-segment-search.md

Query & scoring

DSL → Lucene query → scored hits.

ClassRoleRead
org.opensearch.index.query.QueryBuilder / AbstractQueryBuilderThe DSL object; toQuery(QueryShardContext) → Lucene Query../deep-dives/query-dsl-querybuilders.md
org.opensearch.index.query.QueryShardContextResolves fields, analyzers, scripts during query building../deep-dives/query-dsl-querybuilders.md
org.apache.lucene.search.Query / Weight / ScorerMatch description → per-searcher factory → per-segment iterator../masterclass/query-engine/lab-01-querybuilder-to-lucene.md
org.apache.lucene.search.similarities.BM25SimilarityThe default scoring function (k1=1.2, b=0.75)../masterclass/query-engine/lab-02-bm25-and-scoring.md
org.apache.lucene.search.WANDScorer / MaxScoreScorerTop-k disjunction skipping (WAND / MaxScore / Block-Max)../masterclass/query-engine/lab-02-bm25-and-scoring.md
org.apache.lucene.search.LRUQueryCache / UsageTrackingQueryCachingPolicyFilter DocIdSet caching + the policy that decides what to cache../masterclass/query-engine/lab-03-query-cache-optimization.md
org.apache.lucene.search.TopScoreDocCollectorCollects the top-k by score with a totalHitsThreshold../deep-dives/search-execution.md

Aggregations

Building and reducing summaries.

Class (org.opensearch.search.aggregations.*)RoleRead
AggregatorFactories / AggregatorFactoryBuilds the aggregator tree for a shard../deep-dives/aggregations.md
Aggregator / AggregatorBasePer-shard collection + buildAggregations../masterclass/aggregations/lab-01-trace-an-aggregation.md
LeafBucketCollectorcollect(doc, owningBucketOrd) — the hot inner loop../masterclass/aggregations/lab-01-trace-an-aggregation.md
bucket.terms.GlobalOrdinalsStringTermsAggregator / MapStringTermsAggregatorterms agg via global ordinals / via a hash map../deep-dives/aggregations.md
bucket.composite.CompositeAggregatorThe paginating bucket agg (after key)../masterclass/aggregations/lab-03-composite-pipeline-memory.md
InternalAggregation (+ reduce(List, ReduceContext))The serializable result + the coordinator merge../deep-dives/aggregations.md
MultiBucketConsumerService.MultiBucketConsumerEnforces search.max_bucketsconfig reference
pipeline.PipelineAggregatorRuns over other aggs' output during reduce../masterclass/aggregations/lab-03-composite-pipeline-memory.md

DocValues

Columnar per-doc storage and its legacy heap cousin.

ClassRoleRead
org.apache.lucene.index.DocValues / SortedSetDocValues / NumericDocValuesLucene's columnar per-doc access../lucene/docvalues-columnar.md
org.opensearch.index.fielddata.IndexFieldDataThe fielddata abstraction over a field's columnar values../deep-dives/docvalues-fielddata.md
org.opensearch.index.fielddata.plain.*Concrete DocValues-backed and heap fielddata implementations../deep-dives/docvalues-fielddata.md
org.opensearch.common.util.BigArraysBreaker-accounted paged arrays used by aggs/fielddata../deep-dives/circuit-breakers-memory.md

Allocation

Placing and balancing shards.

Class (org.opensearch.cluster.routing.allocation.*)RoleRead
AllocationServiceOrchestrates allocation, applies decider verdicts, reroutes../deep-dives/shard-allocation.md
allocator.BalancedShardsAllocatorThe balancing heuristic deciding placements/moves../masterclass/distributed-consensus/lab-04-allocation-rebalancing-churn.md
decider.AllocationDeciders (+ each *AllocationDecider)The chain of YES/NO/THROTTLE rules../deep-dives/shard-allocation.md
org.opensearch.gateway.GatewayAllocator / ExistingShardsAllocatorAllocates existing (already-on-disk) primaries/replicas../deep-dives/shard-allocation.md
RoutingAllocation / RoutingNodesThe mutable working view of routing during a reroute../deep-dives/shard-allocation.md

Recovery

Filling a placed shard.

Class (org.opensearch.indices.recovery.*)RoleRead
PeerRecoverySourceService / RecoverySourceHandlerSource side: drive phase 1 (segments) + phase 2 (translog)../deep-dives/recovery.md
PeerRecoveryTargetService / RecoveryTargetTarget side: receive files and replay ops../deep-dives/recovery.md
RecoveryStateThe progress/stages surfaced by _recovery../deep-dives/recovery.md

Replication

Keeping copies in sync.

ClassRoleRead
org.opensearch.action.support.replication.TransportReplicationActionThe document-replication write path (primary → replicas)../deep-dives/replication.md
org.opensearch.index.seqno.ReplicationTrackerTracks in-sync copies, local/global checkpoints../deep-dives/replication.md
org.opensearch.indices.replication.SegmentReplicationSourceService / SegmentReplicationTargetServiceSegment replication (copy files instead of replaying docs)../deep-dives/replication.md
org.opensearch.index.seqno.LocalCheckpointTrackerPer-shard contiguous-seqNo tracking../deep-dives/engine-internals.md

Snapshots

Backup/restore to a repository.

Class (org.opensearch.snapshots.* / repositories.*)RoleRead
SnapshotsServiceOrchestrates snapshot creation/deletion across the cluster../deep-dives/snapshots-repositories.md
RestoreServiceDrives restore back into a cluster../deep-dives/snapshots-repositories.md
repositories.RepositoriesService / RepositoryManages repositories / the backend contract../deep-dives/snapshots-repositories.md
repositories.blobstore.BlobStoreRepositoryIncremental, segment-level snapshot storage on a blob store../deep-dives/snapshots-repositories.md

Circuit breakers

Memory safety.

Class (org.opensearch.indices.breaker.* / core.common.breaker.*)RoleRead
HierarchyCircuitBreakerServiceOwns the parent + child breakers; real-memory accounting../deep-dives/circuit-breakers-memory.md
core.common.breaker.CircuitBreakerThe breaker contract (addEstimateBytesAndMaybeBreak)../deep-dives/circuit-breakers-memory.md
ChildMemoryCircuitBreakerA single child (fielddata / request / in-flight)../deep-dives/circuit-breakers-memory.md

Plugins

The extension model.

Class (org.opensearch.plugins.*)RoleRead
Plugin (+ ActionPlugin, SearchPlugin, NetworkPlugin, ClusterPlugin, EnginePlugin, …)The base + the extension-point interfaces a plugin implements../deep-dives/plugin-architecture.md
PluginsServiceDiscovers, loads, and isolates plugins at startup../deep-dives/plugin-architecture.md
plugin-descriptor.properties (resource)Declares plugin name, version, classname, OpenSearch version../deep-dives/plugin-architecture.md

k-NN

Vector search (the k-NN plugin).

Class (org.opensearch.knn.*)RoleRead
index.mapper.KNNVectorFieldMapperThe knn_vector field type../knn/architecture.md
index.codec.* (per-version KNNxxxCodec, KNNVectorsFormat)The per-field vector codec attached to knn_vector fields../knn/architecture.md
index.query.KNNQueryBuilder / KNNQueryThe knn query DSL → Lucene query../knn/query-path.md
jni.JNIService (+ FaissService, NmslibService)The JNI bridge to native faiss/nmslib../knn/native-jni-and-memory.md
index.memory.NativeMemoryCacheManagerOff-heap native-index cache + the k-NN memory breaker../knn/native-jni-and-memory.md
training.* (PQ/quantization)Builds coarse quantizers and PQ codebooks../masterclass/vector-internals/lab-03-quantization-math.md
org.apache.lucene.util.hnsw.HnswGraphBuilder / OnHeapHnswGraphLucene's HNSW construction (the lucene engine)../lucene/hnsw-vector-search.md

Security

The bundled security plugin (org.opensearch.security.*).

ClassRoleRead
filter.SecurityFilterThe ActionFilter that authorizes every transport action../masterclass/security/index.md
filter.SecurityRestFilterREST-layer interception (authn before dispatch)../masterclass/security/lab-01-authn-tls.md
auth.BackendRegistryRuns the authenticator chain; sets the user in ThreadContext../masterclass/security/lab-01-authn-tls.md
privileges.PrivilegesEvaluatorPer-action authorization decision over roles/action groups../masterclass/security/lab-02-authz-dls-fls.md
configuration.DlsFlsValveImpl / DlsQueryParserDocument- and field-level security enforcement../masterclass/security/lab-02-authz-dls-fls.md
transport.SecurityInterceptorWraps transport messages with security context../masterclass/security/lab-03-build-security-extension.md
auditlog.AuditLogAudit event sink../masterclass/security/index.md

Telemetry

Tracing and metrics (org.opensearch.telemetry.*).

ClassRoleRead
tracing.Tracer / Span / SpanScopeStart/scope/end spans on a code path (OpenTelemetry under telemetry-otel)../masterclass/debugging-profiling/index.md
metrics.MetricsRegistry / Counter / Histogram / TagRegister and emit metrics that surface in _nodes/stats../masterclass/debugging-profiling/index.md

Using this map from a stack trace

The fastest path from a stack trace to understanding:

# 1. Take the most specific opensearch/lucene/knn/security frame, e.g.:
#    org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.balance(...)

# 2. Find the subsystem in this doc (Allocation) and confirm the class:
grep -rn "class BalancedShardsAllocator" server/src/main/java/

# 3. Read the chapter the row points at, then return to the trace.

Note: A frame in org.apache.lucene.* means the failure is below OpenSearch — in storage/search primitives. Switch to the ../lucene/index.md chapters. A frame in org.opensearch.knn.* or org.opensearch.security.* means a plugin owns it — go to the k-NN or security material, which live in separate repos.