Class/Object

com.github.trex_paxos.library

PaxosAlgorithm

Related Docs: object PaxosAlgorithm | package library

Permalink

class PaxosAlgorithm extends PaxosLenses with CommitHandler with FollowerHandler with RetransmitHandler with PrepareHandler with AcceptHandler with PrepareResponseHandler with AcceptResponseHandler with ResendHandler with ReturnToFollowerHandler with ClientCommandHandler

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PaxosAlgorithm
  2. ClientCommandHandler
  3. ReturnToFollowerHandler
  4. ResendHandler
  5. AcceptResponseHandler
  6. PrepareResponseHandler
  7. AcceptHandler
  8. PrepareHandler
  9. RetransmitHandler
  10. FollowerHandler
  11. BackdownAgent
  12. CommitHandler
  13. PaxosLenses
  14. AnyRef
  15. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PaxosAlgorithm()

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val acceptResponseFunction: PaxosFunction

    Permalink
  5. val acceptResponsesClientCommandsLens: Lens[PaxosData, (SortedMap[Identifier, AcceptResponsesAndTimeout], Map[Identifier, (CommandValue, String)])]

    Permalink
    Definition Classes
    PaxosLenses
  6. val acceptResponsesLens: Lens[PaxosData, SortedMap[Identifier, AcceptResponsesAndTimeout]]

    Permalink
    Definition Classes
    PaxosLenses
  7. val acceptStateFunction: PaxosFunction

    Permalink
  8. val acceptVoteDiscriminator: (AcceptResponse) ⇒ Boolean

    Permalink
    Definition Classes
    AcceptResponseHandler
  9. def apply(e: PaxosEvent): PaxosAgent

    Permalink
  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def backdownAgent(io: PaxosIO, agent: PaxosAgent): PaxosAgent

    Permalink
    Definition Classes
    BackdownAgent
  12. val backdownLens: Lens[PaxosData, (SortedMap[Identifier, Map[Int, PrepareResponse]], SortedMap[Identifier, AcceptResponsesAndTimeout], Map[Identifier, (CommandValue, String)], Option[BallotNumber], Long)]

    Permalink
    Definition Classes
    PaxosLenses
  13. val clientCommandsLens: Lens[PaxosData, Map[Identifier, (CommandValue, String)]]

    Permalink
    Definition Classes
    PaxosLenses
  14. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. def commit(io: PaxosIO, agent: PaxosAgent, identifier: Identifier): (Progress, Seq[(Identifier, Any)])

    Permalink

    Attempts to commit up to the log index specified by the slot specified.

    Attempts to commit up to the log index specified by the slot specified. A committed value is delivered to the application

    io

    The IO.

    agent

    The current agent.

    identifier

    The value to commit specified by its number and slot position.

    returns

    A tuple of the new progress and a seq of the identifiers and the response to the deliver operation.

    Definition Classes
    CommitHandler
  16. val commonStateFunction: PaxosFunction

    Permalink
  17. def computeResendAccepts(io: PaxosIO, agent: PaxosAgent, time: Long): AcceptsAndData

    Permalink
    Definition Classes
    ResendHandler
  18. val epochLens: Lens[PaxosData, Option[BallotNumber]]

    Permalink
    Definition Classes
    PaxosLenses
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. val followerFunction: PaxosFunction

    Permalink
  23. val followingFunction: PaxosFunction

    Permalink
  24. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  25. def handelFollowerPrepareResponse(io: PaxosIO, agent: PaxosAgent, vote: PrepareResponse): PaxosAgent

    Permalink
    Definition Classes
    FollowerHandler
  26. def handleAccept(io: PaxosIO, agent: PaxosAgent, accept: Accept): PaxosAgent

    Permalink
    Definition Classes
    AcceptHandler
  27. def handleAcceptResponse(io: PaxosIO, agent: PaxosAgent, vote: AcceptResponse): PaxosAgent

    Permalink
    Definition Classes
    AcceptResponseHandler
  28. def handleClientCommand(io: PaxosIO, agent: PaxosAgent, value: CommandValue, client: String): PaxosAgent

    Permalink
    Definition Classes
    ClientCommandHandler
  29. def handleFollowerCommit(io: PaxosIO, agent: PaxosAgent, c: Commit): PaxosAgent

    Permalink
    Definition Classes
    CommitHandler
  30. def handleFollowerResendLowPrepares(io: PaxosIO, agent: PaxosAgent): PaxosAgent

    Permalink
    Definition Classes
    FollowerHandler
  31. def handleFollowerTimeout(io: PaxosIO, agent: PaxosAgent): PaxosAgent

    Permalink
    Definition Classes
    FollowerHandler
  32. def handleFreshResponse(io: PaxosIO, agent: PaxosAgent, votes: Map[Int, AcceptResponse], accept: Accept, vote: AcceptResponse): PaxosAgent

    Permalink
    Definition Classes
    AcceptResponseHandler
  33. def handleHighAccept(io: PaxosIO, agent: PaxosAgent, accept: Accept): PaxosAgent

    Permalink

    Ack an Accept as high as promise.

    Ack an Accept as high as promise. If the accept number > highestPromised it must update it's promise http://stackoverflow.com/q/29880949/329496

    io

    The PaxosIO.

    agent

    The PaxosAgent.

    accept

    The accept required to have number greater or equal to the agent's promise.

    Definition Classes
    AcceptHandler
  34. def handleHighPrepare(io: PaxosIO, agent: PaxosAgent, prepare: Prepare): PaxosAgent

    Permalink

    Makes a higher promise, journals it and responds to the sender with a PrepareAck.

    Makes a higher promise, journals it and responds to the sender with a PrepareAck. Returns to follower if the agent was not already a follower. If the agent was a leader send out NoLongerLeader messages to any clients.

    io

    The IO operations.

    agent

    The current agent.

    prepare

    The message.

    returns

    The updated agent.

    Definition Classes
    PrepareHandler
  35. def handleLowPrepareResponse(io: PaxosIO, agent: PaxosAgent, vote: PrepareResponse): PaxosAgent

    Permalink
    Definition Classes
    FollowerHandler
  36. def handleMajorityResponse(io: PaxosIO, agent: PaxosAgent, votes: Map[Int, PrepareResponse]): PaxosAgent

    Permalink
    Definition Classes
    FollowerHandler
  37. def handlePrepare(io: PaxosIO, agent: PaxosAgent, prepare: Prepare): PaxosAgent

    Permalink
    Definition Classes
    PrepareHandler
  38. def handlePrepareResponse(io: PaxosIO, agent: PaxosAgent, vote: PrepareResponse): PaxosAgent

    Permalink
    Definition Classes
    PrepareResponseHandler
  39. def handleResendAccepts(io: PaxosIO, agent: PaxosAgent, time: Long): PaxosAgent

    Permalink

    Locates the accepts where we have timed-out on getting a majority accept response.

    Locates the accepts where we have timed-out on getting a majority accept response. If we have seen evidence of other nodes using a higher BallotNumber we "go higher" moving to a new epoch and refreshing our accepts to use the new ballot number.

    io

    input and output

    agent

    The current role and state

    time

    The current time

    Definition Classes
    ResendHandler
  40. def handleResendPrepares(io: PaxosIO, agent: PaxosAgent, time: Long): PaxosAgent

    Permalink
    Definition Classes
    ResendHandler
  41. def handleRetransmitRequest(io: PaxosIO, agent: PaxosAgent, request: RetransmitRequest): PaxosAgent

    Permalink
    Definition Classes
    RetransmitHandler
  42. def handleRetransmitResponse(io: PaxosIO, agent: PaxosAgent, response: RetransmitResponse): PaxosAgent

    Permalink
    Definition Classes
    RetransmitHandler
  43. def handleReturnToFollowerOnHigherCommit(io: PaxosIO, agent: PaxosAgent, c: Commit): PaxosAgent

    Permalink

    If we see a commit at a higher slot we should backdown and request retransmission.

    If we see a commit at a higher slot we should backdown and request retransmission. If we see a commit for the same slot but with a higher epoch id we should backdown. Other commits are ignored.

    Definition Classes
    ReturnToFollowerHandler
  44. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  45. def highestAcceptedIndex(io: PaxosIO): Long

    Permalink
    Definition Classes
    FollowerHandler
  46. def highestNumberProgressed(data: PaxosData): BallotNumber

    Permalink
    Definition Classes
    ResendHandler
  47. val highestPromisedLens: Lens[PaxosData, BallotNumber]

    Permalink
    Definition Classes
    PaxosLenses
  48. val highestPromisedTimeoutEpochPrepareResponsesAcceptResponseLens: Lens[PaxosData, (BallotNumber, Long, Option[BallotNumber], SortedMap[Identifier, Map[Int, PrepareResponse]], SortedMap[Identifier, AcceptResponsesAndTimeout])]

    Permalink
    Definition Classes
    PaxosLenses
  49. val ignoreHeartbeatStateFunction: PaxosFunction

    Permalink
  50. val ignoreNotTimedOutCheck: PaxosFunction

    Permalink

    If no other logic has caught a timeout then do nothing.

  51. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  52. val leaderFunction: PaxosFunction

    Permalink
  53. val leaderLens: Lens[PaxosData, (SortedMap[Identifier, Map[Int, PrepareResponse]], SortedMap[Identifier, AcceptResponsesAndTimeout], Map[Identifier, (CommandValue, String)])]

    Permalink
    Definition Classes
    PaxosLenses
  54. val leaderLikeFunction: PaxosFunction

    Permalink
  55. val leaderStateFunction: PaxosFunction

    Permalink
  56. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  57. val notLeaderFunction: PaxosFunction

    Permalink
  58. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  59. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  60. val prepareResponsesLens: Lens[PaxosData, SortedMap[Identifier, Map[Int, PrepareResponse]]]

    Permalink
    Definition Classes
    PaxosLenses
  61. val prepareStateFunction: PaxosFunction

    Permalink
  62. val prepareVoteDiscriminator: (PrepareResponse) ⇒ Boolean

    Permalink
    Definition Classes
    PrepareResponseHandler
  63. def processCommit(io: PaxosIO, agent: PaxosAgent, lastId: Identifier): PaxosAgent

    Permalink
    Definition Classes
    AcceptResponseHandler
  64. def processRetransmitResponse(io: PaxosIO, agent: PaxosAgent, response: RetransmitResponse): Retransmission

    Permalink

    Computes the contiguous committable messages, all messages that may be accepted and the corresponding new progress.

    Computes the contiguous committable messages, all messages that may be accepted and the corresponding new progress. If the accept messages are not in log index order they will not be processed which is a bug on send which will halt the progress of the receiving node.

    Definition Classes
    RetransmitHandler
  65. val progressAcceptResponsesEpochTimeoutLens: Lens[PaxosData, (Progress, SortedMap[Identifier, AcceptResponsesAndTimeout], Option[BallotNumber], Long)]

    Permalink
    Definition Classes
    PaxosLenses
  66. val progressLens: Lens[PaxosData, Progress]

    Permalink
    Definition Classes
    PaxosLenses
  67. val recovererFunction: PaxosFunction

    Permalink
  68. val recoveringFunction: PaxosFunction

    Permalink
  69. def requestRetransmissionIfBehind(io: PaxosIO, agent: PaxosAgent, from: Int, highestCommitted: Identifier): Unit

    Permalink
    Definition Classes
    PrepareResponseHandler
  70. val resendFunction: PaxosFunction

    Permalink

    Here on a timeout we deal with either pending prepares or pending accepts putting a priority on prepare handling which backs down easily.

    Here on a timeout we deal with either pending prepares or pending accepts putting a priority on prepare handling which backs down easily. Only if we have dealt with all timed out prepares do we handle timed out accepts which is more aggressive as it attempts to go-higher than any other node number.

  71. val retransmissionStateFunction: PaxosFunction

    Permalink
  72. def sendLowPrepares(io: PaxosIO, agent: PaxosAgent): PaxosAgent

    Permalink
    Definition Classes
    FollowerHandler
  73. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  74. val takeoverFunction: PaxosFunction

    Permalink
  75. val timeoutLens: Lens[PaxosData, Long]

    Permalink
    Definition Classes
    PaxosLenses
  76. val timeoutPrepareResponsesLens: Lens[PaxosData, (Long, SortedMap[Identifier, Map[Int, PrepareResponse]])]

    Permalink
    Definition Classes
    PaxosLenses
  77. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  78. val unknown: PaxosFunction

    Permalink
  79. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  80. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ClientCommandHandler

Inherited from ReturnToFollowerHandler

Inherited from ResendHandler

Inherited from AcceptResponseHandler

Inherited from PrepareResponseHandler

Inherited from AcceptHandler

Inherited from PrepareHandler

Inherited from RetransmitHandler

Inherited from FollowerHandler

Inherited from BackdownAgent

Inherited from CommitHandler

Inherited from PaxosLenses

Inherited from AnyRef

Inherited from Any

Ungrouped