Resolves checkstyle errors for api-gateway, lazy-loading, leader-election (#1066)

* Reduces checkstyle errors in lazy-loading

* Reduces checkstyle errors in leader-election

* Reduces checkstyle errors in api-gateway
This commit is contained in:
Anurag Agarwal
2019-11-10 22:43:40 +05:30
committed by Ilkka Seppälä
parent 7f06f3b78c
commit eae09fc07e
30 changed files with 188 additions and 172 deletions

View File

@ -23,11 +23,10 @@
package com.iluwatar.leaderelection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Abstract class of all the instance implementation classes.
@ -69,7 +68,9 @@ public abstract class AbstractInstance implements Instance, Runnable {
}
/**
* Once messages are sent to the certain instance, it will firstly be added to the queue and wait to be executed.
* Once messages are sent to the certain instance, it will firstly be added to the queue and wait
* to be executed.
*
* @param message Message sent by other instances
*/
@Override
@ -79,6 +80,7 @@ public abstract class AbstractInstance implements Instance, Runnable {
/**
* Check if the instance is alive or not.
*
* @return {@code true} if the instance is alive.
*/
@Override
@ -88,6 +90,7 @@ public abstract class AbstractInstance implements Instance, Runnable {
/**
* Set the health status of the certain instance.
*
* @param alive {@code true} for alive.
*/
@Override
@ -97,6 +100,7 @@ public abstract class AbstractInstance implements Instance, Runnable {
/**
* Process the message according to its type.
*
* @param message Message polled from queue.
*/
private void processMessage(Message message) {
@ -131,8 +135,8 @@ public abstract class AbstractInstance implements Instance, Runnable {
}
/**
* Abstract methods to handle different types of message. These methods need to be implemented in concrete instance
* class to implement corresponding leader-selection pattern.
* Abstract methods to handle different types of message. These methods need to be implemented in
* concrete instance class to implement corresponding leader-selection pattern.
*/
protected abstract void handleElectionMessage(Message message);