!10      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                              !"#$%&'()*+,-./None_ libraftAStarting a timer will only work if the timer is currently stopped0libraft`Spawn a timer thread. This function assumes that there are no other threads are using the timerlibraftJCreate a new timer with the given random seed and range of timer timeouts.Safe_!b12345678None ,.7HMSX_'libraft#Representation of monotonic indiceslibraft*Representation of monotonic election terms libraftUnique identifier of a leader libraftUnique identifier of a clientlibraft Unique identifier of a Raft nodelibraftInitial term. Terms start at 0libraft!Initial index. Indeces start at 0libraftADecrement index. If the given index is 0, return the given index    None,79>@AHSVX_.5/libraftHPersistent state that all Raft nodes maintain, regardless of node state.1libraftLast term server has seen2libraft/Candidate id that received vote in current term3libraftFProvides an interface to read and write the persistent state to disk.7libraftIA node initiates its persistent state with term 0 and with its vote blank /02136547 3654/0217None&',789>@AHSVX_k>;libraftoRepresentation of possible errors that come from reading, writing or deleting logs from the persistent storageAlibraftAProvides an interface for nodes to read log entries from storage.ClibraftRead the log at a given indexDlibraftMRead log entries from a specific index onwards, including the specific indexElibraft"Read the last log entry in the logFlibraftCProvides an interface for nodes to delete log entries from storage.HlibraftwDelete log entries from a given index; e.g. 'deleteLogEntriesFrom 7' should delete every log entry with an index >= 7.Klibraft@Provides an interface for nodes to write log entries to storage.Mlibraft&Write the given log entries to storageOlibraft0Representation of an entry in the replicated logQlibraftIndex of entry in the logRlibraft&Term when entry was received by leaderSlibraftCommand to update state machineTlibraft(Id of the client that issued the commandWlibraft-Used as a first committed entry of a new term!;>=<?@AEDCBFHGIJKMLNOPTSRQUWVXZY[!XZYUWVOPTSRQNKMLIJFHGAEDCB@?;>=<[None 79=>?@AHV_Velibraft5Representation of a response to a RequestVote messageglibraft+current term for candidate to update itselfhlibraft"true means candidate recieved voteilibraftVRepresentation of the message sent by candidates to their peers to request their voteklibraftcandidates termllibraftcandidate requesting votemlibraft#index of candidate's last log entrynlibraft"term of candidate's last log entryolibraftJRepresentation of the response from a follower to an AppendEntries messageqlibraft(current term for leader to update itselfrlibraftJtrue if follower contained entry matching aePrevLogIndex and aePrevLogTermslibraft.which read request the response corresponds totlibraft;Representation of a message sent from a leader to its peersvlibraft Leader's termwlibraft:Leader's identifier so that followers can redirect clientsxlibraft1Index of log entry immediately preceding new onesylibraftTerm of aePrevLogIndex entryzlibraft*Log entries to store (empty for heartbeat){libraftLeader's commit index|libraft-which read request the message corresponds to}libraftThe data used to construct an AppendEntries value, snapshotted from the node state at the time the AppendEntries val should be created.libraft.Representation of a message sent between nodeslibraft9Interface for nodes to receive messages from one anotherlibrafthInterface for nodes to send messages to one another. E.g. Control.Concurrent.Chan, Network.Socket, etc.7efhgijnmlkopsrqtu|{zyxwv}~7}~tu|{zyxwvopsrqijnmlkefhgNone &'.17HSX_vlibraft0Index of highest log entry known to be committedlibraft3Index of highest log entry applied to state machinelibraftCFor each server, index of the next log entry to send to that serverlibraftLFor each server, index of highest log entry known to be replicated on serverlibraftIndex, term, and client id of the last log entry in the node's log. The only time `Maybe ClientId` will be Nothing is at the initial term.libraft)Number of read requests handled this termlibraftYThe number of successful responses received regarding a specific read request heartbeat.libraft0Index of highest log entry known to be committedlibraft3Index of highest log entry applied to state machinelibraft*Votes from other nodes in the raft networklibraft6Index and term of the last log entry in the node's loglibraftId of the current leaderlibraft0Index of highest log entry known to be committedlibraft3Index of highest log entry applied to state machinelibraft6Index and term of the last log entry in the node's loglibraft;The term of the log entry specified in and AppendEntriesRPClibraftvRepresentation of the current leader in the cluster. The system is considered to be unavailable if there is no leaderlibraft!The volatile state of a Raft Nodelibraft/Existential type hiding the internal node statelibraft7Existential type hiding the result type of a transitionlibraft*All valid state transitions of a Raft nodelibraft#A node in Raft begins as a followerlibraft+Update the last log entry in the node's loglibraftXGet the last applied index and the commit index of the last log entry in the node's loglibraftuGet the index of highest log entry applied to state machine and the index of highest log entry known to be committedlibraft$Check if node is in a follower statelibraft%Check if node is in a candidate statelibraft"Check if node is in a leader state==None"#MSX_{jlibraft*Representation of the severity of the logslibraft'Representation of the logs' destination!libraft.The computation from which to extract the logs)      !"#$%&)      !"#$%&None_b/libraft&Configuration of a node in the cluster1libraftNode id of the running node2libraft(Set of all other node ids in the cluster3libraft+Range of times an election timeout can take4libraftHeartbeat timeout timer/04312/04312 None 7>@AHV_6libraft1Representation of a redirect response to a client8libraft.Representation of a write response to a client9libraftIIndex of the entry appended to the log due to the previous client request:libraft3Representation of a read response to a client The s4 stands for the "current" state of the state machine<libraft#Representation of a client response=libraft3Respond with the latest state of the state machine.>libraft7Respond with the index of the entry appended to the log?libraft.Respond with the node id of the current leader@libraft"Representation of a client requestAlibraft-Request the latest state of the state machineBlibraftWrite a commandClibraft=Representation of a client request coupled with the client idElibraft9Interface for Raft nodes to receive messages from clientsHlibraft4Interface for Raft nodes to send messages to clients6789:;<?>=@BACDEGFHIHIEGFCD@BA<?>=:;8967 None17_/\libraft*Representation of message events to a node]libraftIncoming event from a peer^libraftIncoming event from a client_libraftRepresentation of timeouts`libraft4Timeout after which a follower will become candidatealibraftETimeout after which a leader will send AppendEntries RPC to all peersblibraft9Representation of events a raft node can send and receive \^]_a`bdc bdc_a`\^] None1SX_5plibraft$Send a message to a specific node idqlibraft3Send a unique message to specific nodes in parallelrlibraft'Broadcast the same message to all nodesslibraft$Append entries to the replicated logtlibraft(Respond to client after a client requestulibraftReset a timeout timer jnmlkoutsrqp outsrqpjnmlk None&'18=>?@ACHMSVX_VlibraftInterface to handle commands in the underlying state machine. Functional dependency permitting only a single state machine command to be defined to update the state machine.libraftResets the election timeout.libraftLast log entry data!xyz{|}~!~{|}zyx None"#&'.=>?@AX_libraftLeaders should not respond to t messages.libraftLeaders should not respond to i messages.libraftLeaders should not respond to e messages.libraftThe leader handles all client requests, responding with the current state machine on a client read, and appending an entry to the log on a valid client write.9libraftIf there exists an N such that N > commitIndex, a majority of matchIndex[i] >= N, and log[N].term == currentTerm: set commitIndex = N:libraftCConstruct an AppendEntriesRPC given log entries and a leader state.None"#&'.=>?@AX_librafttHandle AppendEntries RPC message from Leader Sections 5.2 and 5.3 of Raft Paper & Figure 2: Receiver Implementation Note: see /E datatype for discussion about not keeping the entire log in memory.libraft Followers should not respond to o messages.libraft Followers should not respond to e messages.libraft:Follower converts to Candidate if handling ElectionTimeoutlibraftWhen a client handles a client request, it redirects the client to the current leader by responding with the current leader id, if it knows of one.None"#&'.=>?@APX_`libraft!Candidates should not respond to o messages.libraft!Candidates should not respond to e messages.libraftWhen candidates handle a client request, they respond with NoLeader, as the very reason they are candidate is because there is no leader. This is done instead of simply not responding such that the client can know that the node is live but that there is an election taking place.None"#&'.=>?@ASX_libraft$Main entry point for handling eventsNone"#&'1=>?@AMSX_kĻlibraftcThe raft server environment composed of the concurrent variables used in the effectful raft layer.libraftXRun timers, RPC and client request handlers and start event loop. It should run forever;libraftProducer for rpc message events<libraftProducer for rpc message events=libraft'Producer for the election timeout event>libraft(Producer for the heartbeat timeout eventlibraftNode configurationlibraftLogs destinationlibraft Timer seedlibraftInitial state machine state /01234567;<=>?@ABCDEFGHIJKLMNOPQRSTefghijklmnopqrstuvwxyz{|}~/021346789:;<=>?@ABCDEFGHI\]^_`abcdHIEFG3456CD@AB<=>?:;8967/02134bcd_`a\]^OPQRSTNKLMIJFGHABCDE@;<=>?/0127   tuvwxyz{|opqrsijklmnefgh}~None"#1=>?@ACHMSVX_˹  None_΁libraft+Convert a host and a port to a valid NodeIdlibraft.Retrieve the host and port from a valid NodeIdlibraftGet a free port number.None"#1=>?@AHMSVX_ libraft9Handles connections failures by first trying to reconnectlibraft]Recursively accept a connection. It keeps trying to accept connections even when a node diesNone"#MSX_ص"libraftARandomly select a node from a set of nodes a send a message to it#libraft(Randomly read the state of a random node$libraftRandomly write to a random node%libraft>Request the state of a node. It blocks until the node responds&libraft2Write to a node. It blocks until the node responds'libraft@Accept a connection and return the client response synchronously !"#$%&' !"#$%&'? !!"#$%&'()*+,-./0123456789:;<=>?@ABBCDEFGHIJKLMNOPQRSTUVWXYZ[[\]^_``abcdeefghijklmnopqrsttuvwwxyz{||}~       !"#$%&'()*+,-.//01234 5 5 6 6 7 7 8 9 : ; < = > ? ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] W ^ _ ` a b c d e f g h i j k l m n o p q r s t u u v w w x y z { | } ~                 $ %                    &libraft-0.1.1.0-8nwazCMBvi7EUIW9UIbZhFControl.Concurrent.STM.Timer Raft.TypesRaft.PersistentRaft.LogRaft.RPCRaft.NodeState Raft.Logging Raft.Config Raft.Client Raft.Event Raft.Action Raft.Monad Raft.Leader Raft.FollowerRaft.Candidate Raft.HandleRaftExamples.Raft.FileStoreExamples.Raft.Socket.CommonExamples.Raft.Socket.NodeExamples.Raft.Socket.Client Paths_libraftTimer waitTimer startTimer resetTimernewTimer newTimerRangeIndexTermLeaderId unLeaderIdClientIdNodeIdsNodeIdterm0incrTermprevTermindex0 incrIndexdecrIndexWithDefault0$fShowClientId $fEqClientId $fOrdClientId$fGenericClientId$fSerializeClientId$fShowLeaderId $fEqLeaderId$fGenericLeaderId$fSerializeLeaderId $fShowTerm$fEqTerm $fOrdTerm $fEnumTerm $fGenericTerm$fSerializeTerm $fShowIndex $fEqIndex $fOrdIndex $fEnumIndex $fNumIndex$fIntegralIndex $fRealIndex$fGenericIndex$fSerializeIndexPersistentState currentTermvotedFor RaftPersistRaftPersistErrorreadPersistentStatewritePersistentStateinitPersistentState$fShowPersistentState$fGenericPersistentState$fSerializePersistentState RaftLogErrorRaftLogReadErrorRaftLogWriteErrorRaftLogDeleteErrorRaftLogExceptionsRaftLog RaftReadLogRaftReadLogError readLogEntryreadLogEntriesFromreadLastLogEntry RaftDeleteLogRaftDeleteLogErrordeleteLogEntriesFrom DeleteSuccess RaftWriteLogRaftWriteLogErrorwriteLogEntriesEntriesEntry entryIndex entryTerm entryValue entryIssuer EntryValueNoValue EntryIssuer ClientIssuer LeaderIssuer updateLog$fShowEntryIssuer$fGenericEntryIssuer$fSerializeEntryIssuer$fShowEntryValue$fGenericEntryValue$fSerializeEntryValue $fShowEntry$fGenericEntry$fSerializeEntryRequestVoteResponservrTermrvrVoteGranted RequestVotervTerm rvCandidateIdrvLastLogIndex rvLastLogTermAppendEntriesResponseaerTerm aerSuccessaerReadRequest AppendEntriesaeTerm aeLeaderIdaePrevLogIndex aePrevLogTerm aeEntriesaeLeaderCommit aeReadRequestAppendEntriesDataaedTermaedLeaderCommitaedEntriesSpec EntriesSpec FromIndex FromNewLeaderFromClientWriteReq NoEntries NoEntriesSpecFromInconsistency FromHeartbeatFromClientReadReqRPCTypetoRPCRPCAppendEntriesRPCAppendEntriesResponseRPCRequestVoteRPCRequestVoteResponseRPC RPCMessagesenderrpc RaftRecvRPCRaftRecvRPCError receiveRPC RaftSendRPCsendRPCrpcTerm$fRPCTypeRequestVoteResponsev$fRPCTypeRequestVotev$fRPCTypeAppendEntriesResponsev$fRPCTypeAppendEntriesv$fShowNoEntriesSpec$fShowEntriesSpec$fShowAppendEntriesData$fShowAppendEntries$fGenericAppendEntries$fSerializeAppendEntries$fShowAppendEntriesResponse$fGenericAppendEntriesResponse $fSerializeAppendEntriesResponse$fShowRequestVote$fGenericRequestVote$fSerializeRequestVote$fShowRequestVoteResponse$fGenericRequestVoteResponse$fSerializeRequestVoteResponse $fShowRPC $fGenericRPC$fSerializeRPC$fShowRPCMessage$fGenericRPCMessage$fSerializeRPCMessage LeaderState lsCommitIndex lsLastApplied lsNextIndex lsMatchIndexlsLastLogEntryDatalsReadReqsHandled lsReadRequestClientReadReqsCandidateState csCommitIndex csLastAppliedcsVotescsLastLogEntryData FollowerStatefsCurrentLeader fsCommitIndex fsLastAppliedfsLastLogEntryDatafsTermAtAEPrevIndex CurrentLeaderNoLeader NodeStateNodeFollowerStateNodeCandidateStateNodeLeaderState RaftNodeStateunRaftNodeState ResultState Transition StartElectionHigherTermFoundFollowerRestartElectionDiscoverLeaderHigherTermFoundCandidate BecomeLeader SendHeartbeatDiscoverNewLeaderHigherTermFoundLeaderNoopModeFollower CandidateLeaderfollowerResultStatecandidateResultStateleaderResultStatenodeModeinitRaftNodeStatesetLastLogEntryDatagetLastLogEntryDatagetLastAppliedAndCommitIndex isFollower isCandidateisLeader$fSerializeCurrentLeader $fShowMode$fShowCurrentLeader$fEqCurrentLeader$fGenericCurrentLeader$fShowFollowerState$fShowCandidateState$fShowLeaderState$fShowNodeState$fShowRaftNodeState$fShowResultState$fShowTransition RaftLoggerM RaftLoggerT unRaftLoggerT RaftLogger loggerNodeIdloggerNodeState LogMsgData logMsgNodeIdlogMsgNodeStatelogMsgLogMsgmTimeseverity logMsgDataSeverityInfoDebugCriticalLogDestLogFile LogStdoutNoLogs logMsgToTextlogMsgDataToText mkLogMsgData logToDest logToStdout logToFilelogWithSeverityIO logInfoIO logDebugIO logCriticalIOrunRaftLoggerTrunRaftLoggerMlogWithSeveritylogInfologDebug logCritical$fRaftLoggerRaftLoggerT$fShowSeverity$fShowLogMsgData$fFunctorRaftLoggerT$fApplicativeRaftLoggerT$fMonadRaftLoggerT$fMonadStateRaftLoggerT$fMonadTransRaftLoggerT NodeConfig configNodeId configNodeIdsconfigElectionTimeoutconfigHeartbeatTimeout$fShowNodeConfigClientRedirRespClientWriteRespClientReadRespClientResponseClientReadResponseClientWriteResponseClientRedirectResponse ClientReq ClientReadReqClientWriteReq ClientRequestRaftRecvClientRaftRecvClientError receiveClientRaftSendClient sendClient$fSerializeClientReq$fSerializeClientRequest$fSerializeClientReadResp$fSerializeClientWriteResp$fSerializeClientRedirResp$fSerializeClientResponse$fShowClientReq$fGenericClientReq$fShowClientRequest$fGenericClientRequest$fShowClientReadResp$fGenericClientReadResp$fShowClientWriteResp$fGenericClientWriteResp$fShowClientRedirResp$fGenericClientRedirResp$fShowClientResponse$fGenericClientResponse MessageEventRPCMessageEventClientRequestEventTimeoutElectionTimeoutHeartbeatTimeoutEvent TimeoutEvent$fSerializeMessageEvent $fShowTimeout$fShowMessageEvent$fGenericMessageEvent $fShowEvent SendRPCActionSendAppendEntriesRPCSendAppendEntriesResponseRPCSendRequestVoteRPCSendRequestVoteResponseRPCActionSendRPCSendRPCs BroadcastRPCAppendLogEntriesRespondToClientResetTimeoutTimer$fShowSendRPCAction $fShowActionClientReqHandlerTimeoutHandler RPCHandler TransitionM unTransitionM TransitionEnv nodeConfig stateMachine nodeStateRSM validateCmd askRSMPCtxRSMP RSMPErrorRSMPCtx applyCmdRSMP applyEntryRSM tellAction tellActionsrunTransitionM askNodeId broadcastsendresetElectionTimeoutresetHeartbeatTimeoutredirectClientToLeaderrespondClientReadappendLogEntries startElection$fRaftLoggerRWST&$fMonadStatePersistentStateTransitionM%$fMonadReaderTransitionEnvTransitionM$fMonadWriter[]TransitionM$fFunctorTransitionM$fApplicativeTransitionM$fMonadTransitionMhandleAppendEntrieshandleAppendEntriesResponsehandleRequestVotehandleRequestVoteResponse handleTimeouthandleClientRequest RaftHandler handleEventfollowerRaftHandlercandidateRaftHandlerleaderRaftHandler mkRaftHandler handleEvent'RaftEnv eventChanresetElectionTimerresetHeartbeatTimerraftNodeConfigraftNodeLogDest EventChanrunRaftT runRaftNodehandleEventLoop$fRaftLoggerRaftT$fMonadTransRaftT$fFunctorRaftT$fApplicativeRaftT $fMonadRaftT$fMonadReaderRaftT$fMonadStateRaftT$fMonadFailRaftT$fAlternativeRaftT$fMonadPlusRaftT$fMonadConcRaftT$fMonadMaskRaftT$fMonadCatchRaftT$fMonadThrowRaftT$fMonadIORaftTRaftFileStoreTunRaftFileStoreTNodeFileStoreEnvnfsPersistentState nfsLogEntries NodeEnvErrorreadLogEntries$fExceptionNodeEnvError$fRaftDeleteLogRaftFileStoreTv$fRaftReadLogRaftFileStoreTv$fRaftPersistRaftFileStoreT$fRaftWriteLogRaftFileStoreTv$fShowNodeEnvError$fFunctorRaftFileStoreT$fApplicativeRaftFileStoreT$fMonadRaftFileStoreT$fMonadIORaftFileStoreT$fMonadFailRaftFileStoreT$fMonadReaderRaftFileStoreT$fAlternativeRaftFileStoreT$fMonadPlusRaftFileStoreT$fMonadTransRaftFileStoreT$fMonadConcRaftFileStoreT$fMonadMaskRaftFileStoreT$fMonadCatchRaftFileStoreT$fMonadThrowRaftFileStoreT hostPortToNid nidToHostPort getFreePort RaftSocketT unRaftSocketT NodeSocketEnvnsSocketnsPeers nsMsgQueuensClientReqQueueretryConnection handleFailurerunRaftSocketTacceptForkNodenewSock$fRaftRecvRPCRaftSocketTv$fRaftSendRPCRaftSocketTv$fRaftRecvClientRaftSocketTv$fRaftSendClientRaftSocketTsm$fFunctorRaftSocketT$fApplicativeRaftSocketT$fMonadRaftSocketT$fMonadIORaftSocketT$fMonadFailRaftSocketT$fMonadReaderRaftSocketT$fAlternativeRaftSocketT$fMonadPlusRaftSocketT$fMonadTransRaftSocketT$fMonadConcRaftSocketT$fMonadMaskRaftSocketT$fMonadCatchRaftSocketT$fMonadThrowRaftSocketTRaftSocketClientMunRaftSocketClientMClientSocketEnv clientPort clientHost clientSocketrunRaftSocketClientM selectRndNodesendReadRndNodesendWriteRndNodesendRead sendWriteacceptClientConnections$fShowClientSocketEnv$fFunctorRaftSocketClientM$fApplicativeRaftSocketClientM$fMonadRaftSocketClientM$fMonadIORaftSocketClientM$fMonadReaderRaftSocketClientM$fAlternativeRaftSocketClientM$fMonadPlusRaftSocketClientM spawnTimerversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameincrCommitIndexmkAppendEntriesData rpcHandlerclientReqHandlerelectionTimeoutTimerheartbeatTimeoutTimer