Skip to content

Commit

Permalink
Avoid this escape
Browse files Browse the repository at this point in the history
  • Loading branch information
baldersheim committed Aug 21, 2024
1 parent b666cc6 commit 7c18bb7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static com.yahoo.vdslib.state.NodeState.ORCHESTRATOR_RESERVED_DESCRIPTION;
import static com.yahoo.vespa.clustercontroller.core.NodeStateChangeChecker.Result;

public class ContentCluster {
public final class ContentCluster {

private static final int pollingFrequency = 5000;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core.database;

import org.apache.zookeeper.AsyncCallback;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;
import org.apache.zookeeper.data.Stat;
import org.apache.zookeeper.*;

import java.nio.charset.StandardCharsets;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Logger;
import java.util.*;

import java.util.logging.Level;

public class MasterDataGatherer {
public final class MasterDataGatherer {

private static final Logger log = Logger.getLogger(MasterDataGatherer.class.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ public UnitStateImpl(NodeState ns) throws StateRestApiException {
this.reason = ns.getDescription();
}

public String parseId(State id) throws StateRestApiException {
switch (id) {
case UP: return "up";
case DOWN: return "down";
case INITIALIZING: return "initializing";
case MAINTENANCE: return "maintenance";
case RETIRED: return "retired";
case STOPPING: return "stopping";
}
throw new InternalFailure("Unknown state '" + id + "' found.");
public static String parseId(State id) throws StateRestApiException {
return switch (id) {
case UP -> "up";
case DOWN -> "down";
case INITIALIZING -> "initializing";
case MAINTENANCE -> "maintenance";
case RETIRED -> "retired";
case STOPPING -> "stopping";
default -> throw new InternalFailure("Unknown state '" + id + "' found.");
};
}

@Override
Expand Down

0 comments on commit 7c18bb7

Please sign in to comment.