* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
- enum constructors are private by default
- interface properties are public static final by default
- interface methods are public abstract by default
- interfaces are abstract by default
- inner interfaces are static by default
- inner classes in interfaces are public static by default
Change-Id: I02567e9b21a73406863797a5a4eaa257e6eb20f2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
protected void onLeaderChanged(String oldLeader, String newLeader) {
protected void onLeaderChanged(String oldLeader, String newLeader) {
private String getLeaderAddress(){
if(isLeader()){
private String getLeaderAddress(){
if(isLeader()){
Follower,
Leader,
IsolatedLeader,
Follower,
Leader,
IsolatedLeader,
- private static interface TermInformationReader {
+ private interface TermInformationReader {
long getIndex();
long getTerm();
}
long getIndex();
long getTerm();
}
private final Queue<ClientRequestTracker> trackers = new LinkedList<>();
private Cancellable heartbeatSchedule = null;
private final Queue<ClientRequestTracker> trackers = new LinkedList<>();
private Cancellable heartbeatSchedule = null;
- private Optional<SnapshotHolder> snapshot = Optional.absent();;
+ private Optional<SnapshotHolder> snapshot = Optional.absent();
private int minReplicationCount;
protected AbstractLeader(RaftActorContext context, RaftState state,
private int minReplicationCount;
protected AbstractLeader(RaftActorContext context, RaftState state,
if(snapshotTracker.addChunk(installSnapshot.getChunkIndex(), installSnapshot.getData(),
installSnapshot.getLastChunkHashCode())){
Snapshot snapshot = Snapshot.create(snapshotTracker.getSnapshot(),
if(snapshotTracker.addChunk(installSnapshot.getChunkIndex(), installSnapshot.getData(),
installSnapshot.getLastChunkHashCode())){
Snapshot snapshot = Snapshot.create(snapshotTracker.getSnapshot(),
- new ArrayList<ReplicatedLogEntry>(),
installSnapshot.getLastIncludedIndex(),
installSnapshot.getLastIncludedTerm(),
installSnapshot.getLastIncludedIndex(),
installSnapshot.getLastIncludedIndex(),
installSnapshot.getLastIncludedTerm(),
installSnapshot.getLastIncludedIndex(),
- public <T extends Object> Object toSerializable(short version) {
+ public <T> Object toSerializable(short version) {
*
* @return The term ID
*/
*
* @return The term ID
*/
}
public MockRaftActorContext(){
}
public MockRaftActorContext(){
- super(null, null, "test", newElectionTerm(), -1, -1, new HashMap<String, String>(),
+ super(null, null, "test", newElectionTerm(), -1, -1, new HashMap<>(),
new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
setReplicatedLog(new MockReplicatedLogBuilder().build());
}
public MockRaftActorContext(String id, ActorSystem system, ActorRef actor){
new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
setReplicatedLog(new MockReplicatedLogBuilder().build());
}
public MockRaftActorContext(String id, ActorSystem system, ActorRef actor){
- super(actor, null, id, newElectionTerm(), -1, -1, new HashMap<String, String>(),
+ super(actor, null, id, newElectionTerm(), -1, -1, new HashMap<>(),
new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
this.system = system;
new DefaultConfigParamsImpl(), new NonPersistentDataProvider(), LOG);
this.system = system;