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:
committed by
Ilkka Seppälä
parent
7f06f3b78c
commit
eae09fc07e
@@ -38,7 +38,7 @@ public abstract class AbstractMessageManager implements MessageManager {
|
||||
protected Map<Integer, Instance> instanceMap;
|
||||
|
||||
/**
|
||||
* Construtor of AbstractMessageManager
|
||||
* Construtor of AbstractMessageManager.
|
||||
*/
|
||||
public AbstractMessageManager(Map<Integer, Instance> instanceMap) {
|
||||
this.instanceMap = instanceMap;
|
||||
@@ -46,15 +46,16 @@ public abstract class AbstractMessageManager implements MessageManager {
|
||||
|
||||
/**
|
||||
* Find the next instance with smallest ID.
|
||||
*
|
||||
* @return The next instance.
|
||||
*/
|
||||
protected Instance findNextInstance(int currentId) {
|
||||
Instance result = null;
|
||||
List<Integer> candidateList = instanceMap.keySet()
|
||||
.stream()
|
||||
.filter((i) -> i > currentId && instanceMap.get(i).isAlive())
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
.stream()
|
||||
.filter((i) -> i > currentId && instanceMap.get(i).isAlive())
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
if (candidateList.isEmpty()) {
|
||||
int index = instanceMap.keySet()
|
||||
.stream()
|
||||
|
Reference in New Issue
Block a user