* Invoked by candidates to gather votes (ยง5.2).
*/
public final class RequestVote extends AbstractRaftRPC {
+ @java.io.Serial
private static final long serialVersionUID = -6967509186297108657L;
// candidate requesting vote
@Override
Object writeReplace() {
- return new Proxy(this);
+ return new RV(this);
}
+ @Deprecated(since = "7.0.0", forRemoval = true)
private static class Proxy implements Externalizable {
+ @java.io.Serial
private static final long serialVersionUID = 1L;
private RequestVote requestVote;
public Proxy() {
}
- Proxy(final RequestVote requestVote) {
- this.requestVote = requestVote;
- }
-
@Override
- public void writeExternal(final ObjectOutput out) throws IOException {
- out.writeLong(requestVote.getTerm());
- out.writeObject(requestVote.candidateId);
- out.writeLong(requestVote.lastLogIndex);
- out.writeLong(requestVote.lastLogTerm);
+ public void writeExternal(final ObjectOutput out) {
+ throw new UnsupportedOperationException();
}
@Override
requestVote = new RequestVote(term, candidateId, lastLogIndex, lastLogTerm);
}
+ @java.io.Serial
private Object readResolve() {
return requestVote;
}