These private methods can be made static, let's do that.
Change-Id: I275e465f3424ae87f7a2a5ddaaca1f09c5072685
Signed-off-by: Robert Varga <rovarga@cisco.com>
replicatedLog().getSnapshotTerm(), replicatedLog().size());
}
- private boolean isServerConfigurationPayload(ReplicatedLogEntry repLogEntry){
+ private static boolean isServerConfigurationPayload(ReplicatedLogEntry repLogEntry){
return (repLogEntry.getData() instanceof ServerConfigurationPayload);
}
}
testLog.info("createRaftActors starting");
}
- private void verifyRaftState(ActorRef raftActor, final RaftState expState) throws Throwable {
+ private static void verifyRaftState(ActorRef raftActor, final RaftState expState) throws Throwable {
Timeout timeout = new Timeout(500, TimeUnit.MILLISECONDS);
Throwable lastError = null;
Stopwatch sw = Stopwatch.createStarted();
throw lastError;
}
- private void assertNullLeaderIdChange(TestActorRef<MessageCollectorActor> notifierActor) {
+ private static void assertNullLeaderIdChange(TestActorRef<MessageCollectorActor> notifierActor) {
LeaderStateChanged change = expectFirstMatching(notifierActor, LeaderStateChanged.class);
assertNull("Expected null leader Id", change.getLeaderId());
}
assertEquals("isVotingMember", false, context.isVotingMember());
}
- private void verifyPeerInfo(RaftActorContextImpl context, String peerId, Boolean voting) {
+ private static void verifyPeerInfo(RaftActorContextImpl context, String peerId, Boolean voting) {
PeerInfo peerInfo = context.getPeerInfo(peerId);
if(voting != null) {
assertNotNull("Expected peer " + peerId, peerInfo);
assertEquals("getStatus", ServerChangeStatus.NOT_SUPPORTED, removeServerReply.getStatus());
}
- private ServerInfo votingServer(String id) {
+ private static ServerInfo votingServer(String id) {
return new ServerInfo(id, true);
}
- private ServerInfo nonVotingServer(String id) {
+ private static ServerInfo nonVotingServer(String id) {
return new ServerInfo(id, false);
}
return Futures.successful(Option.<SelectedSnapshot>none());
}
- private boolean matches(StoredSnapshot snapshot, SnapshotSelectionCriteria criteria) {
+ private static boolean matches(StoredSnapshot snapshot, SnapshotSelectionCriteria criteria) {
return snapshot.metadata.sequenceNr() <= criteria.maxSequenceNr() &&
snapshot.metadata.timestamp() <= criteria.maxTimestamp();
}