sofastack / sofa-jraft

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

custom thread pool #855

Closed shihuili1218 closed 2 years ago

shihuili1218 commented 2 years ago

custom thread pool, todo: DefaultFixedThreadsExecutorGroupFactory.toString

Motivation:

Explain the context, and why you're making that change. To make others understand what is the problem you're trying to solve.

Modification:

Describe the idea and modifications you've done.

Result:

Fixes #.

If there is no issue then describe the changes introduced by this PR.

shihuili1218 commented 2 years ago

this is the implementation of issue https://github.com/sofastack/sofa-jraft/issues/853

shihuili1218 commented 2 years ago

Main changes: ThreadPool are all passed in through Options. The ThreadPoolthat sends AppendEntries messages is saved in DefaultRaftClientService; The ThreadPoolfor processing tasks is saved in the Mapof the ThreadPoolGroup and obtained with the groupid.