sofastack / sofa-jraft

A production-grade java implementation of RAFT consensus algorithm.
https://www.sofastack.tech/projects/sofa-jraft/
Apache License 2.0
3.6k stars 1.15k forks source link

USe leader election along with RheaKV #589

Closed amit2103 closed 3 years ago

amit2103 commented 3 years ago

Hey , thanks for the awesome project. I have an usecase where I need to use the RheaKV and also need leader election along with it. Is there a way to do it without instantiating two raft clusters ? What I want is kind of support for multi-raft which will allow me to do consensus in parallel for different sets of keys

Regards

fengjiachun commented 3 years ago

Maybe this is what you need: com.alipay.sofa.jraft.rhea.LeaderStateListener See RheaKVStore#addLeaderStateListener