Package io.atomix.raft.cluster.impl
Class RaftMemberContext
java.lang.Object
io.atomix.raft.cluster.impl.RaftMemberContext
Cluster member state.
-
Method Summary
Modifier and TypeMethodDescriptionvoidFlags the last append to the member is failed.voidFlags the last append to the member as successful.booleanReturns a boolean indicating whether an append request can be sent to the member.booleanReturns a boolean indicating whether a configure request can be sent to the member.booleanReturns whether a heartbeat can be sent to the member.booleanReturns a boolean indicating whether an install request can be sent to the member.voidclose()voidvoidCompletes an append request to the member.voidcompleteAppend(long time) Completes an append request to the member.voidCompletes a configure request to the member.voidCompletes an install request to the member.longReturns the member configuration index.longReturns the member term.longintReturns the member failure count.longReturns the member failure time.longReturns the member heartbeat time.longReturns the member's match index.Returns the member.Returns the member's next expected snapshot chunk ID.longReturns the member's next snapshot index.longReturns the member response time.longReturns the member's current snapshot index.booleanbooleanintIncrements the member failure count.booleanisOpen()voidvoidreset(long index) voidResets the member failure count.voidresetState(RaftLog log) Resets the member state.voidsetConfigIndex(long configIndex) Sets the member configuration index.voidsetConfigTerm(long term) Sets the member term.voidsetHeartbeatTime(long heartbeatTime) Sets the member heartbeat time.voidsetMatchIndex(long matchIndex) Sets the member's match index.voidsetNextSnapshotChunkId(ByteBuffer nextSnapshotChunk) Sets the member's next expected snapshot chunk ID.voidsetNextSnapshotIndex(long nextSnapshotIndex) Sets the member's next snapshot index.voidsetResponseTime(long responseTime) Sets the member response time.voidsetSnapshotChunkReader(SnapshotChunkReader snapshotChunkReader) voidsetSnapshotIndex(long snapshotIndex) Sets the member's current snapshot index.voidStarts an append request to the member.voidStarts a configure request to the member.voidStarts an install request to the member.toString()
-
Method Details
-
resetState
Resets the member state. -
close
public void close() -
isOpen
public boolean isOpen() -
hasReplicationContext
public boolean hasReplicationContext() -
openReplicationContext
-
closeReplicationContext
public void closeReplicationContext() -
canAppend
public boolean canAppend()Returns a boolean indicating whether an append request can be sent to the member.- Returns:
- Indicates whether an append request can be sent to the member.
-
canHeartbeat
public boolean canHeartbeat()Returns whether a heartbeat can be sent to the member.- Returns:
- Indicates whether a heartbeat can be sent to the member.
-
appendSucceeded
public void appendSucceeded()Flags the last append to the member as successful. -
appendFailed
public void appendFailed()Flags the last append to the member is failed. -
startAppend
public void startAppend()Starts an append request to the member. -
completeAppend
public void completeAppend()Completes an append request to the member. -
completeAppend
public void completeAppend(long time) Completes an append request to the member.- Parameters:
time- The time in milliseconds for the append.
-
canConfigure
public boolean canConfigure()Returns a boolean indicating whether a configure request can be sent to the member.- Returns:
- Indicates whether a configure request can be sent to the member.
-
startConfigure
public void startConfigure()Starts a configure request to the member. -
completeConfigure
public void completeConfigure()Completes a configure request to the member. -
canInstall
public boolean canInstall()Returns a boolean indicating whether an install request can be sent to the member.- Returns:
- Indicates whether an install request can be sent to the member.
-
startInstall
public void startInstall()Starts an install request to the member. -
completeInstall
public void completeInstall()Completes an install request to the member. -
incrementFailureCount
public int incrementFailureCount()Increments the member failure count.- Returns:
- The member state.
-
resetFailureCount
public void resetFailureCount()Resets the member failure count. -
toString
-
getConfigIndex
public long getConfigIndex()Returns the member configuration index.- Returns:
- The member configuration index.
-
setConfigIndex
public void setConfigIndex(long configIndex) Sets the member configuration index.- Parameters:
configIndex- The member configuration index.
-
getConfigTerm
public long getConfigTerm()Returns the member term.- Returns:
- The member term.
-
setConfigTerm
public void setConfigTerm(long term) Sets the member term.- Parameters:
term- The member term.
-
getFailureCount
public int getFailureCount()Returns the member failure count.- Returns:
- The member failure count.
-
getFailureTime
public long getFailureTime()Returns the member failure time.- Returns:
- the member failure time
-
getHeartbeatTime
public long getHeartbeatTime()Returns the member heartbeat time.- Returns:
- The member heartbeat time.
-
setHeartbeatTime
public void setHeartbeatTime(long heartbeatTime) Sets the member heartbeat time.- Parameters:
heartbeatTime- The member heartbeat time.
-
getMatchIndex
public long getMatchIndex()Returns the member's match index.- Returns:
- The member's match index.
-
setMatchIndex
public void setMatchIndex(long matchIndex) Sets the member's match index.- Parameters:
matchIndex- The member's match index.
-
getMember
Returns the member.- Returns:
- The member.
-
getNextSnapshotIndex
public long getNextSnapshotIndex()Returns the member's next snapshot index.- Returns:
- The member's next snapshot index.
-
setNextSnapshotIndex
public void setNextSnapshotIndex(long nextSnapshotIndex) Sets the member's next snapshot index.- Parameters:
nextSnapshotIndex- The member's next snapshot index.
-
getNextSnapshotChunk
Returns the member's next expected snapshot chunk ID.- Returns:
- The member's next expected chunk ID.
-
setNextSnapshotChunkId
Sets the member's next expected snapshot chunk ID.- Parameters:
nextSnapshotChunk- The member's next expected snapshot chunk ID.
-
getResponseTime
public long getResponseTime()Returns the member response time.- Returns:
- The member response time.
-
setResponseTime
public void setResponseTime(long responseTime) Sets the member response time.- Parameters:
responseTime- The member response time.
-
getSnapshotIndex
public long getSnapshotIndex()Returns the member's current snapshot index.- Returns:
- The member's current snapshot index.
-
setSnapshotIndex
public void setSnapshotIndex(long snapshotIndex) Sets the member's current snapshot index.- Parameters:
snapshotIndex- The member's current snapshot index.
-
getSnapshotChunkReader
-
setSnapshotChunkReader
-
hasNextEntry
public boolean hasNextEntry() -
nextEntry
-
getCurrentEntry
-
getCurrentIndex
public long getCurrentIndex() -
reset
public void reset(long index)
-