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 deprecatedmasteralias (e.g.master_timeout). When reading older blogs or 1.x/2.x code, mentally map everyMaster*symbol to itsClusterManager*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.
| Class | Role | Read |
|---|---|---|
org.opensearch.node.Node | The god object; its constructor builds and injects every service | ../deep-dives/cluster-and-node-model.md |
org.opensearch.bootstrap.Bootstrap | Process entry: checks, security manager, starts the Node | ../deep-dives/cluster-and-node-model.md |
org.opensearch.bootstrap.BootstrapChecks | Enforces production prerequisites (heap, file descriptors, vm.max_map_count) | ../deep-dives/cluster-and-node-model.md |
org.opensearch.cluster.node.DiscoveryNode | In-memory node descriptor: id, address, roles, attributes | ../deep-dives/cluster-and-node-model.md |
org.opensearch.common.settings.Settings / Setting | Immutable settings bag; typed, scoped setting definitions | config reference |
org.opensearch.env.Environment / NodeEnvironment | Resolves 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.*) | Role | Read |
|---|---|---|
Coordinator | The consensus engine: elections, joins, publication, liveness | ../deep-dives/discovery-coordination.md |
CoordinationState | Persisted (term, version) + accepted/committed state; the safety core | ../masterclass/distributed-consensus/lab-01-trace-an-election.md |
PreVoteCollector / ElectionSchedulerFactory | Pre-vote round and randomized election scheduling | ../masterclass/distributed-consensus/lab-01-trace-an-election.md |
JoinHelper | Drives start-join requests and join validation | ../deep-dives/discovery-coordination.md |
VotingConfiguration / Reconfigurator | The quorum set and how it shrinks/grows as nodes join/leave | ../masterclass/distributed-consensus/lab-01-trace-an-election.md |
PublicationTransportHandler | Two-phase publish → commit of a new cluster state | ../masterclass/distributed-consensus/lab-03-cluster-state-pub-sub.md |
LeaderChecker / FollowersChecker | Liveness probes both directions; trigger failover/removal | ../masterclass/distributed-consensus/lab-02-failure-detection-partitions.md |
ClusterBootstrapService | Forms the initial quorum from cluster.initial_cluster_manager_nodes | ../deep-dives/discovery-coordination.md |
ClusterFormationFailureHelper | Explains 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.*) | Role | Read |
|---|---|---|
ClusterState | The root immutable snapshot tying the components below together | ../deep-dives/cluster-state.md |
metadata.Metadata / metadata.IndexMetadata | Index settings, mappings, templates, persistent cluster settings | ../deep-dives/cluster-state.md |
routing.RoutingTable / IndexRoutingTable / ShardRouting | Where each shard copy is assigned and its state | ../deep-dives/cluster-state.md |
node.DiscoveryNodes | The set of nodes in the cluster + who is cluster manager | ../deep-dives/cluster-state.md |
block.ClusterBlocks | Read/write/metadata blocks (e.g. read-only-allow-delete) | ../deep-dives/cluster-state.md |
service.ClusterManagerService | Computes new states from update tasks on the cluster manager | ../deep-dives/cluster-state-publishing.md |
service.ClusterApplierService | Applies committed states to local services via appliers/listeners | ../deep-dives/cluster-state-publishing.md |
ClusterStateUpdateTask / AckedClusterStateUpdateTask | The unit of a state change, optionally ack-tracked | ../deep-dives/cluster-state-publishing.md |
Diffable / Diff | Wire-efficient state diffs sent during publication | ../deep-dives/cluster-state.md |
Transport
The node-to-node RPC fabric (port 9300).
Class (org.opensearch.transport.*) | Role | Read |
|---|---|---|
TransportService | Sends requests, registers request handlers, manages connections | ../deep-dives/transport-layer.md |
transport.netty4.Netty4Transport | The Netty-based wire implementation | ../deep-dives/transport-layer.md |
TransportRequestHandler / TransportRequest / TransportResponse | The handler + message base types | ../deep-dives/transport-layer.md |
org.opensearch.core.common.io.stream.Writeable / StreamInput / StreamOutput | Version-gated serialization of any object on the wire | ../deep-dives/serialization-bwc.md |
org.opensearch.common.io.stream.NamedWriteableRegistry | Maps 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.*) | Role | Read |
|---|---|---|
RestController | Dispatches an HTTP request to the matching RestHandler | ../deep-dives/rest-layer.md |
RestHandler / BaseRestHandler | Registers a route and builds the action call in prepareRequest | ../deep-dives/rest-layer.md |
org.opensearch.client.node.NodeClient | The in-node client a RestHandler uses to execute an ActionType | ../deep-dives/rest-layer.md |
org.opensearch.core.xcontent.XContentParser / XContentBuilder | Parses request JSON / renders response JSON | ../deep-dives/rest-layer.md |
org.opensearch.http.netty4.Netty4HttpServerTransport | The HTTP server implementation | ../deep-dives/rest-layer.md |
Actions
Binding request types to handlers and intercepting them.
Class (org.opensearch.action.*) | Role | Read |
|---|---|---|
ActionType | A typed handle naming an action (e.g. SearchAction.INSTANCE) | ../deep-dives/action-framework.md |
support.TransportAction / HandledTransportAction | Base classes for the server-side action handler | ../deep-dives/action-framework.md |
support.replication.TransportReplicationAction | Base for write actions that go primary → replicas | ../deep-dives/replication.md |
org.opensearch.action.ActionModule | Registers every action, filter, and REST handler at startup | ../deep-dives/action-framework.md |
support.ActionFilter / ActionFilters | The pre/post interception chain (security hooks in here) | ../deep-dives/action-framework.md |
org.opensearch.core.action.ActionListener | The 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.*) | Role | Read |
|---|---|---|
ThreadPool | The named-pool registry (search, write, get, management, …) | ../deep-dives/threadpools-concurrency.md |
common.util.concurrent.OpenSearchThreadPoolExecutor | The executor type with bounded queues and rejection | ../deep-dives/threadpools-concurrency.md |
common.util.concurrent.ThreadContext | Per-thread headers/transients (carries the authenticated user) | ../deep-dives/threadpools-concurrency.md |
common.util.concurrent.AbstractRunnable | The runnable base that funnels failures to onFailure | ../deep-dives/threadpools-concurrency.md |
Indexing & engine
The per-shard write path over Lucene.
| Class | Role | Read |
|---|---|---|
org.opensearch.indices.IndicesService | Owns all indices on the node; creates IndexServices | ../deep-dives/index-shard-lifecycle.md |
org.opensearch.index.IndexService | Per-index services; creates IndexShards | ../deep-dives/index-shard-lifecycle.md |
org.opensearch.index.shard.IndexShard | Per-shard object: state machine, op application, search refs | ../deep-dives/index-shard-lifecycle.md |
org.opensearch.index.engine.InternalEngine | The 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.LiveVersionMap | In-memory id → version/seqNo for real-time get and conflicts | ../deep-dives/engine-internals.md |
org.opensearch.index.store.Store / org.apache.lucene.store.Directory | The shard's file abstraction and Lucene's I/O abstraction | ../deep-dives/index-shard-lifecycle.md |
org.apache.lucene.index.IndexWriter | Lucene's single writer: buffers docs, flushes segments, commits | ../lucene/indexwriter-and-merges.md |
org.apache.lucene.index.MergePolicy / ConcurrentMergeScheduler | Chooses merges and runs them in the background | ../lucene/indexwriter-and-merges.md |
Translog
The per-shard write-ahead log.
Class (org.opensearch.index.translog.*) | Role | Read |
|---|---|---|
Translog | The WAL: generations, durability, replay; the engine's safety net | ../deep-dives/translog.md |
TranslogWriter / TranslogReader | Append the current generation / read a sealed one | ../deep-dives/translog.md |
Checkpoint | The .ckp file: ops count, seqNo bounds, generation | ../deep-dives/translog.md |
Translog.Durability | REQUEST (fsync per request) vs ASYNC (periodic) | config reference |
Mapping & analysis
Schema and the text-to-terms pipeline.
Class (org.opensearch.index.mapper.* / index.analysis.*) | Role | Read |
|---|---|---|
MapperService | Holds the mapping; resolves field name → MappedFieldType | ../deep-dives/mapping-and-analysis.md |
FieldMapper / MappedFieldType | How a field indexes / how it is queried | ../deep-dives/mapping-and-analysis.md |
DocumentMapper / DocumentParser | Parses a JSON doc into indexable Lucene fields | ../deep-dives/mapping-and-analysis.md |
AnalysisRegistry / IndexAnalyzers | Builds and holds analyzers from the analysis chain | ../deep-dives/mapping-and-analysis.md |
org.apache.lucene.analysis.Analyzer / Tokenizer / TokenFilter | The Lucene char-filter → tokenizer → token-filter pipeline | ../deep-dives/mapping-and-analysis.md |
Search
Fanning a search across shards and reducing it.
Class (org.opensearch.search.* / action.search.*) | Role | Read |
|---|---|---|
action.search.TransportSearchAction | Coordinates scatter/gather across shards | ../deep-dives/search-execution.md |
SearchService | Per-node: creates SearchContext, runs query/fetch phases | ../deep-dives/search-execution.md |
internal.SearchContext / ContextIndexSearcher | Per-shard search state / the searcher wrapper that runs collectors | ../deep-dives/search-execution.md |
action.search.SearchPhaseController | The coordinator-side reduce of per-shard results | ../deep-dives/search-execution.md |
query.QuerySearchResult / fetch.FetchSearchResult | The per-shard outputs of the two phases | ../deep-dives/search-execution.md |
org.apache.lucene.search.IndexSearcher / CollectorManager | Lucene's search entry point / slice-safe collection for concurrency | ../engineering/concurrent-segment-search.md |
Query & scoring
DSL → Lucene query → scored hits.
| Class | Role | Read |
|---|---|---|
org.opensearch.index.query.QueryBuilder / AbstractQueryBuilder | The DSL object; toQuery(QueryShardContext) → Lucene Query | ../deep-dives/query-dsl-querybuilders.md |
org.opensearch.index.query.QueryShardContext | Resolves fields, analyzers, scripts during query building | ../deep-dives/query-dsl-querybuilders.md |
org.apache.lucene.search.Query / Weight / Scorer | Match description → per-searcher factory → per-segment iterator | ../masterclass/query-engine/lab-01-querybuilder-to-lucene.md |
org.apache.lucene.search.similarities.BM25Similarity | The default scoring function (k1=1.2, b=0.75) | ../masterclass/query-engine/lab-02-bm25-and-scoring.md |
org.apache.lucene.search.WANDScorer / MaxScoreScorer | Top-k disjunction skipping (WAND / MaxScore / Block-Max) | ../masterclass/query-engine/lab-02-bm25-and-scoring.md |
org.apache.lucene.search.LRUQueryCache / UsageTrackingQueryCachingPolicy | Filter DocIdSet caching + the policy that decides what to cache | ../masterclass/query-engine/lab-03-query-cache-optimization.md |
org.apache.lucene.search.TopScoreDocCollector | Collects the top-k by score with a totalHitsThreshold | ../deep-dives/search-execution.md |
Aggregations
Building and reducing summaries.
Class (org.opensearch.search.aggregations.*) | Role | Read |
|---|---|---|
AggregatorFactories / AggregatorFactory | Builds the aggregator tree for a shard | ../deep-dives/aggregations.md |
Aggregator / AggregatorBase | Per-shard collection + buildAggregations | ../masterclass/aggregations/lab-01-trace-an-aggregation.md |
LeafBucketCollector | collect(doc, owningBucketOrd) — the hot inner loop | ../masterclass/aggregations/lab-01-trace-an-aggregation.md |
bucket.terms.GlobalOrdinalsStringTermsAggregator / MapStringTermsAggregator | terms agg via global ordinals / via a hash map | ../deep-dives/aggregations.md |
bucket.composite.CompositeAggregator | The 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.MultiBucketConsumer | Enforces search.max_buckets | config reference |
pipeline.PipelineAggregator | Runs over other aggs' output during reduce | ../masterclass/aggregations/lab-03-composite-pipeline-memory.md |
DocValues
Columnar per-doc storage and its legacy heap cousin.
| Class | Role | Read |
|---|---|---|
org.apache.lucene.index.DocValues / SortedSetDocValues / NumericDocValues | Lucene's columnar per-doc access | ../lucene/docvalues-columnar.md |
org.opensearch.index.fielddata.IndexFieldData | The 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.BigArrays | Breaker-accounted paged arrays used by aggs/fielddata | ../deep-dives/circuit-breakers-memory.md |
Allocation
Placing and balancing shards.
Class (org.opensearch.cluster.routing.allocation.*) | Role | Read |
|---|---|---|
AllocationService | Orchestrates allocation, applies decider verdicts, reroutes | ../deep-dives/shard-allocation.md |
allocator.BalancedShardsAllocator | The 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 / ExistingShardsAllocator | Allocates existing (already-on-disk) primaries/replicas | ../deep-dives/shard-allocation.md |
RoutingAllocation / RoutingNodes | The mutable working view of routing during a reroute | ../deep-dives/shard-allocation.md |
Recovery
Filling a placed shard.
Class (org.opensearch.indices.recovery.*) | Role | Read |
|---|---|---|
PeerRecoverySourceService / RecoverySourceHandler | Source side: drive phase 1 (segments) + phase 2 (translog) | ../deep-dives/recovery.md |
PeerRecoveryTargetService / RecoveryTarget | Target side: receive files and replay ops | ../deep-dives/recovery.md |
RecoveryState | The progress/stages surfaced by _recovery | ../deep-dives/recovery.md |
Replication
Keeping copies in sync.
| Class | Role | Read |
|---|---|---|
org.opensearch.action.support.replication.TransportReplicationAction | The document-replication write path (primary → replicas) | ../deep-dives/replication.md |
org.opensearch.index.seqno.ReplicationTracker | Tracks in-sync copies, local/global checkpoints | ../deep-dives/replication.md |
org.opensearch.indices.replication.SegmentReplicationSourceService / SegmentReplicationTargetService | Segment replication (copy files instead of replaying docs) | ../deep-dives/replication.md |
org.opensearch.index.seqno.LocalCheckpointTracker | Per-shard contiguous-seqNo tracking | ../deep-dives/engine-internals.md |
Snapshots
Backup/restore to a repository.
Class (org.opensearch.snapshots.* / repositories.*) | Role | Read |
|---|---|---|
SnapshotsService | Orchestrates snapshot creation/deletion across the cluster | ../deep-dives/snapshots-repositories.md |
RestoreService | Drives restore back into a cluster | ../deep-dives/snapshots-repositories.md |
repositories.RepositoriesService / Repository | Manages repositories / the backend contract | ../deep-dives/snapshots-repositories.md |
repositories.blobstore.BlobStoreRepository | Incremental, 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.*) | Role | Read |
|---|---|---|
HierarchyCircuitBreakerService | Owns the parent + child breakers; real-memory accounting | ../deep-dives/circuit-breakers-memory.md |
core.common.breaker.CircuitBreaker | The breaker contract (addEstimateBytesAndMaybeBreak) | ../deep-dives/circuit-breakers-memory.md |
ChildMemoryCircuitBreaker | A single child (fielddata / request / in-flight) | ../deep-dives/circuit-breakers-memory.md |
Plugins
The extension model.
Class (org.opensearch.plugins.*) | Role | Read |
|---|---|---|
Plugin (+ ActionPlugin, SearchPlugin, NetworkPlugin, ClusterPlugin, EnginePlugin, …) | The base + the extension-point interfaces a plugin implements | ../deep-dives/plugin-architecture.md |
PluginsService | Discovers, 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.*) | Role | Read |
|---|---|---|
index.mapper.KNNVectorFieldMapper | The 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 / KNNQuery | The 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.NativeMemoryCacheManager | Off-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 / OnHeapHnswGraph | Lucene's HNSW construction (the lucene engine) | ../lucene/hnsw-vector-search.md |
Security
The bundled security plugin (org.opensearch.security.*).
| Class | Role | Read |
|---|---|---|
filter.SecurityFilter | The ActionFilter that authorizes every transport action | ../masterclass/security/index.md |
filter.SecurityRestFilter | REST-layer interception (authn before dispatch) | ../masterclass/security/lab-01-authn-tls.md |
auth.BackendRegistry | Runs the authenticator chain; sets the user in ThreadContext | ../masterclass/security/lab-01-authn-tls.md |
privileges.PrivilegesEvaluator | Per-action authorization decision over roles/action groups | ../masterclass/security/lab-02-authz-dls-fls.md |
configuration.DlsFlsValveImpl / DlsQueryParser | Document- and field-level security enforcement | ../masterclass/security/lab-02-authz-dls-fls.md |
transport.SecurityInterceptor | Wraps transport messages with security context | ../masterclass/security/lab-03-build-security-extension.md |
auditlog.AuditLog | Audit event sink | ../masterclass/security/index.md |
Telemetry
Tracing and metrics (org.opensearch.telemetry.*).
| Class | Role | Read |
|---|---|---|
tracing.Tracer / Span / SpanScope | Start/scope/end spans on a code path (OpenTelemetry under telemetry-otel) | ../masterclass/debugging-profiling/index.md |
metrics.MetricsRegistry / Counter / Histogram / Tag | Register 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.mdchapters. A frame inorg.opensearch.knn.*ororg.opensearch.security.*means a plugin owns it — go to the k-NN or security material, which live in separate repos.