public static class AppendRequest.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AppendRequest.Builder |
addEntry(RaftLogEntry entry)
Adds an entry to the request.
|
AppendRequest |
build() |
AppendRequest.Builder |
withCommitIndex(long commitIndex)
Sets the request commit index.
|
AppendRequest.Builder |
withEntries(List<RaftLogEntry> entries)
Sets the request entries.
|
AppendRequest.Builder |
withEntries(RaftLogEntry... entries)
Sets the request entries.
|
AppendRequest.Builder |
withLeader(MemberId leader)
Sets the request leader.
|
AppendRequest.Builder |
withPrevLogIndex(long prevLogIndex)
Sets the request last log index.
|
AppendRequest.Builder |
withPrevLogTerm(long prevLogTerm)
Sets the request last log term.
|
AppendRequest.Builder |
withTerm(long term)
Sets the request term.
|
public AppendRequest.Builder withTerm(long term)
term - The request term.IllegalArgumentException - if the term is not positivepublic AppendRequest.Builder withLeader(MemberId leader)
leader - The request leader.IllegalArgumentException - if the leader is not positivepublic AppendRequest.Builder withPrevLogIndex(long prevLogIndex)
prevLogIndex - The request last log index.IllegalArgumentException - if the index is not positivepublic AppendRequest.Builder withPrevLogTerm(long prevLogTerm)
prevLogTerm - The request last log term.IllegalArgumentException - if the term is not positivepublic AppendRequest.Builder withEntries(RaftLogEntry... entries)
entries - The request entries.NullPointerException - if entries is nullpublic AppendRequest.Builder withEntries(List<RaftLogEntry> entries)
entries - The request entries.NullPointerException - if entries is nullpublic AppendRequest.Builder addEntry(RaftLogEntry entry)
entry - The entry to add.NullPointerException - if entry is nullpublic AppendRequest.Builder withCommitIndex(long commitIndex)
commitIndex - The request commit index.IllegalArgumentException - if index is not positivepublic AppendRequest build()
IllegalStateException - if the term, log term, log index, commit index, or global index are not positive, or
if entries is nullCopyright © 2013–2017. All rights reserved.