Algorithm::Paxos::Role::Acceptor - An Acceptor role for the Paxos algorithm
version 0.001
package MyApp::PaxosBasic; use Moose; with qw(Algorithm::Paxos::Role::Acceptor); 1; __END__
From Wikipedia
The Acceptors act as the fault-tolerant "memory" of the protocol. Acceptors are collected into groups called Quorums. Any message sent to an Acceptor must be sent to a Quorum of Acceptors. Any message received from an Acceptor is ignored unless a copy is received from each Acceptor in a Quorum.
Internal method used by the algorithm. Returns the last id for a prepared proposal.
Internal method used by the algorithm. Returns the last id for an accepted proposal.
Returns a list of learners.
One of the two required methods for an Acceptor. When a proposal is made, the first step is to ask acceptors to prepare. If the proposed ID is too low (meaning another proposal is already in process) an exception will be thrown. If the proposal is new the ID returned is 0. If there is a pending proposal the ID for that proposal is returned.
One of two required methods for an Acceptor. After a quorum is reached a proposal is then accepted and submitted to the learners. If all the learners return clean the proposal id and value are returned. If the ID for the proposal exceeds the allowed value (ie we're trying to accept an ID that is lower than a prepared ID) we throw an exception.
Chris Prather <chris@prather.org>
This software is copyright (c) 2012 by Chris Prather.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Algorithm::Paxos, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::Paxos
CPAN shell
perl -MCPAN -e shell install Algorithm::Paxos
For more information on module installation, please visit the detailed CPAN module installation guide.