Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Remove RaftLogReader trait dependency from RaftLogStorage #1153

Commits on Jul 6, 2024

  1. Refactor: Remove RaftLogReader trait dependency from RaftLogStorage

    This commit removes the dependency of the `RaftLogReader` trait from the
    `RaftLogStorage` interface in Openraft.
    
    `trait RaftLogStorage<C>: RaftLogReader<C> + ...` becomes
    `trait RaftLogStorage<C>: ...`.
    
    This change reflects the infrequent need for reading log entries
    directly from storage, as it primarily occurs when applying logs to the
    state machine.
    
    Inside Openraft, logs can now be read by acquiring a reader via
    `RaftLogStorage.get_log_reader().await.xxx()`, rather than requiring
    `RaftLogStorage` to implement the `RaftLogReader` trait.
    
    Upgrade(non-breaking) tip:
    
    Implementations are advised (though it is not mandatory) to remove the
    `impl RaftLogReader for YourRaftLogStore` from their codebase.
    
    - Fix: databendlabs#1118
    drmingdrmer committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    98ab9ac View commit details
    Browse the repository at this point in the history