aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-06-05 15:07:50 +0200
committerHarald Musum <musum@yahooinc.com>2023-06-05 15:07:50 +0200
commitabf620e10fb21a1295a2f6ca69b4c592d824a385 (patch)
treebf4df1b525b3944576050f30298a92bce22651ef /clustercontroller-core
parentbb8821ac9afffe44e7d47d2573cfaf62a64ed07c (diff)
Inline and simplify
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MasterElectionHandler.java17
1 files changed, 2 insertions, 15 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MasterElectionHandler.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MasterElectionHandler.java
index fc8a6a05573..01240da2fc8 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MasterElectionHandler.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/MasterElectionHandler.java
@@ -180,9 +180,8 @@ public class MasterElectionHandler implements MasterInterface {
}
if (nextInLineCount != ourPosition) {
nextInLineCount = ourPosition;
- if (ourPosition > 0) {
- context.log(logger, Level.FINE, () -> "We are now " + getPosition(nextInLineCount) + " in queue to take over being master.");
- }
+ if (nextInLineCount > 0)
+ context.log(logger, Level.FINE, () -> "We are now in position " + nextInLineCount + " in queue to take over being master.");
}
}
masterData = state;
@@ -207,14 +206,6 @@ public class MasterElectionHandler implements MasterInterface {
return sb.toString();
}
- private String getPosition(int val) {
- if (val < 1) return "invalid(" + val + ")";
- if (val == 1) { return "first"; }
- if (val == 2) { return "second"; }
- if (val == 3) { return "third"; }
- return val + "th";
- }
-
public void handleFleetData(Map<Integer, Integer> data) {
context.log(logger, Level.INFO, "Got new fleet data with " + data.size() + " entries: " + data);
synchronized (monitor) {
@@ -225,10 +216,6 @@ public class MasterElectionHandler implements MasterInterface {
public void lostDatabaseConnection() {
context.log(logger, Level.INFO, "Clearing master data as we lost connection on node " + index);
- resetElectionProgress();
- }
-
- private void resetElectionProgress() {
masterData = null;
masterCandidate = null;
followers = 0;