zk1931 / jzab

ZooKeeper Atomic Broadcast in Java
http://zk1931.github.io/jzab/master/
Apache License 2.0
54 stars 23 forks source link

Code refactoring on the logic of taking message from queue. #214

Closed EasonLiao closed 9 years ago

EasonLiao commented 9 years ago

The logic of taking message from message queue was messy. For example, the leader and follower need to filter and process certain messages in getMessage method, and so does FastLeaderElection. This results in duplicate code and makes the intention of the code unclear(code needs to deal with different kinds of messages just in one method). Refactoring the code so that we have different kinds of message filters and each filter filters and processes certain types of messages. This makes the logic clearer and code reuse better.

EasonLiao commented 9 years ago

hey @m1ch1 Can you take a look when you have time?