Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid this escape #32211

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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