Class RaftMemberContext

java.lang.Object
io.atomix.raft.cluster.impl.RaftMemberContext

public final class RaftMemberContext extends Object
Cluster member state.
  • Method Details

    • resetState

      public void resetState(RaftLog log)
      Resets the member state.
    • close

      public void close()
    • isOpen

      public boolean isOpen()
    • hasReplicationContext

      public boolean hasReplicationContext()
    • openReplicationContext

      public void openReplicationContext(RaftLog log)
    • 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

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public DefaultRaftMember 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

      public ByteBuffer getNextSnapshotChunk()
      Returns the member's next expected snapshot chunk ID.
      Returns:
      The member's next expected chunk ID.
    • setNextSnapshotChunkId

      public void setNextSnapshotChunkId(ByteBuffer nextSnapshotChunk)
      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

      public SnapshotChunkReader getSnapshotChunkReader()
    • setSnapshotChunkReader

      public void setSnapshotChunkReader(SnapshotChunkReader snapshotChunkReader)
    • hasNextEntry

      public boolean hasNextEntry()
    • nextEntry

      public IndexedRaftLogEntry nextEntry()
    • getCurrentEntry

      public IndexedRaftLogEntry getCurrentEntry()
    • getCurrentIndex

      public long getCurrentIndex()
    • reset

      public void reset(long index)