-
Notifications
You must be signed in to change notification settings - Fork 182
Closed
Description
Abstract OpenRaft Core Data Structures into Traits
Goal
Abstract OpenRaft's foundational data structures into traits to provide greater flexibility, allowing users to customize implementations according to their needs.
To enable users to fully define Entry
types using Protobuf, we need to remove Entry's hard dependencies on other basic types (such as LogId
, Membership
, etc.). This means these basic types also need to be abstracted into traits to achieve complete type customization.
Types to Abstract
Basic Types:
-
Term
-
LogId will not be abstracted in this version for simplicity. It is primarily used internally and is not a critical component for applications, so it can remain as is.LogId
-
LeaderId
and its associated typeCommittedLeaderId
Composite Types:
-
Entry
-
Membership will not be abstracted as it is not on the hot path and can be reconstructed as needed.Membership
-
Vote
Implementation Plan
- Start with abstracting the most fundamental
Term
type into a trait - Gradually complete abstraction of other basic types
- Finally handle composite types that depend on these basic types
Expected Benefits
- Provides greater flexibility, allowing users to fully customize data structures
- Better support for different serialization schemes (e.g., protobuf)
- Maintains compatibility with existing code
SteveLauC, sainad2222 and vigith
Metadata
Metadata
Assignees
Labels
No labels