MCPcopy Index your code
hub / github.com/apache/ratis

github.com/apache/ratis @ratis-3.2.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release ratis-3.2.2 ↗ · + Follow
7,257 symbols 32,858 edges 674 files 1,350 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Apache Ratis

Apache Ratis is a Java library that implements the Raft protocol [1], where an extended version of the Raft paper is available at https://raft.github.io/raft.pdf. The paper introduces Raft and states its motivations in following words:

Raft is a consensus algorithm for managing a replicated log. It produces a result equivalent to (multi-)Paxos, and it is as efficient as Paxos, but its structure is different from Paxos; this makes Raft more understandable than Paxos and also provides a better foundation for building practical systems.

Ratis aims to make Raft available as a java library that can be used by any system that needs to use a replicated log. It provides pluggability for state machine implementations to manage replicated states. It also provides pluggability for Raft log, rpc implementations and metric implementations to make it easy for integration with other projects. Another important goal is to support high throughput data ingest so that it can be used for more general data replication use cases.

Reference

  1. Diego Ongaro and John Ousterhout, In Search of an Understandable Consensus Algorithm, 2014 USENIX Annual Technical Conference (USENIX ATC 14) (Philadelphia, PA), USENIX Association, 2014, pp. 305-319.

Extension points exported contracts — how you extend this code

RetryPolicy (Interface)
Policy abstract for retrying. [7 implementers]
ratis-common/src/main/java/org/apache/ratis/retry/RetryPolicy.java
DataStreamRpcApi (Interface)
An RPC interface which extends the user interface DataStreamApi. [6 implementers]
ratis-client/src/main/java/org/apache/ratis/client/DataStreamRpcApi.java
DataStreamServer (Interface)
Interface for streaming server. [6 implementers]
ratis-server-api/src/main/java/org/apache/ratis/server/DataStreamServer.java
MetricRegistryFactory (Interface)
A Factory for creating MetricRegistries. This is the main plugin point for metrics implementation [10 implementers]
ratis-metrics-api/src/main/java/org/apache/ratis/metrics/MetricRegistryFactory.java
NettyConfigKeys (Interface)
(no doc) [15 implementers]
ratis-netty/src/main/java/org/apache/ratis/netty/NettyConfigKeys.java
Evaluable (Interface)
(no doc) [7 implementers]
ratis-examples/src/main/java/org/apache/ratis/examples/arithmetic/Evaluable.java
Command (Interface)
An interface for all the commands that can be run from a shell. [2 implementers]
ratis-shell/src/main/java/org/apache/ratis/shell/cli/Command.java
GrpcServices (Interface)
The gRPC services extending RaftServerRpc. [1 implementers]
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcServices.java

Core symbols most depended-on inside this repo

assertEquals
called by 668
ratis-common/src/main/java/org/apache/ratis/util/Preconditions.java
assertTrue
called by 653
ratis-common/src/main/java/org/apache/ratis/util/Preconditions.java
info
called by 504
ratis-client/src/main/java/org/apache/ratis/client/api/GroupManagementApi.java
get
called by 425
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderElection.java
get
called by 409
ratis-common/src/main/java/org/apache/ratis/conf/ConfUtils.java
getId
called by 351
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderElection.java
toString
called by 230
ratis-common/src/main/java/org/apache/ratis/util/ProtoUtils.java
add
called by 214
ratis-client/src/main/java/org/apache/ratis/client/api/GroupManagementApi.java

Shape

Method 6,219
Class 797
Interface 196
Enum 45

Languages

Java100%

Modules by API surface

ratis-server-api/src/main/java/org/apache/ratis/server/RaftServerConfigKeys.java173 symbols
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java118 symbols
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java117 symbols
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogCache.java84 symbols
ratis-server/src/test/java/org/apache/ratis/server/impl/MiniRaftCluster.java74 symbols
ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java73 symbols
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLogWorker.java63 symbols
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java62 symbols
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/SegmentedRaftLog.java59 symbols
ratis-common/src/main/java/org/apache/ratis/util/SlidingWindow.java58 symbols
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderElection.java55 symbols
ratis-grpc/src/main/java/org/apache/ratis/grpc/GrpcConfigKeys.java54 symbols

For agents

$ claude mcp add ratis \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact