raft algorithm scala implimentation