use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.
the class ClusterFixture method forHierarchicCluster.
public static ClusterFixture forHierarchicCluster(DistributionBuilder.GroupBuilder root) {
List<ConfiguredNode> nodes = DistributionBuilder.buildConfiguredNodes(root.totalNodeCount());
Distribution distribution = DistributionBuilder.forHierarchicCluster(root);
ContentCluster cluster = new ContentCluster("foo", nodes, distribution, 0, 0.0);
return new ClusterFixture(cluster, distribution);
}
use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.
the class ClusterFixture method forFlatCluster.
public static ClusterFixture forFlatCluster(int nodeCount) {
Collection<ConfiguredNode> nodes = DistributionBuilder.buildConfiguredNodes(nodeCount);
Distribution distribution = DistributionBuilder.forFlatCluster(nodeCount);
ContentCluster cluster = new ContentCluster("foo", nodes, distribution, 0, 0.0);
return new ClusterFixture(cluster, distribution);
}
use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.
the class EventDiffCalculator method emitPerNodeDiffEvents.
private static void emitPerNodeDiffEvents(final PerStateParams params, final List<Event> events) {
final ContentCluster cluster = params.cluster;
final ClusterState fromState = params.fromState.getClusterState();
final ClusterState toState = params.toState.getClusterState();
for (ConfiguredNode node : cluster.getConfiguredNodes().values()) {
for (NodeType nodeType : NodeType.getTypes()) {
final Node n = new Node(nodeType, node.index());
emitSingleNodeEvents(params, events, cluster, fromState, toState, n);
}
}
}
use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.
the class NodeSlobrokConfigurationMembershipTest method test_removed_retired_node_is_not_included_in_state.
@Test
public void test_removed_retired_node_is_not_included_in_state() throws Exception {
final Set<ConfiguredNode> configuredNodes = asConfiguredNodes(nodeIndices);
FleetControllerOptions options = optionsForConfiguredNodes(configuredNodes);
setUpFleetController(true, options);
setUpVdsNodes(true, new DummyVdsNodeOptions(), false, nodeIndices);
waitForState("version:\\d+ distributor:4 storage:4");
// Update options with 1 node config-retired
assertTrue(configuredNodes.remove(new ConfiguredNode(0, false)));
configuredNodes.add(new ConfiguredNode(0, true));
options.nodes = configuredNodes;
fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:4 storage:4 .0.s:r");
// Now remove the retired node entirely from config
assertTrue(configuredNodes.remove(new ConfiguredNode(0, true)));
fleetController.updateOptions(options, 0);
// The previously retired node should now be marked as down, as it no longer
// exists from the point of view of the content cluster. We have to use a subset
// state waiter, as the controller will not send the new state to node 0.
waitForStateExcludingNodeSubset("version:\\d+ distributor:4 .0.s:d storage:4 .0.s:d", asIntSet(0));
// Ensure it remains down for subsequent cluster state versions as well.
nodes.get(3).disconnect();
waitForStateExcludingNodeSubset("version:\\d+ distributor:4 .0.s:d storage:4 .0.s:d .1.s:d", asIntSet(0, 1));
}
use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.
the class RpcServerTest method testGetNodeStateWithConfiguredRetired.
@Test
public void testGetNodeStateWithConfiguredRetired() throws Exception {
startingTest("RpcServerTest::testGetNodeStateWithConfiguredRetired");
List<ConfiguredNode> configuredNodes = new ArrayList<>();
for (int i = 0; i < 9; i++) configuredNodes.add(new ConfiguredNode(i, false));
// Last node is configured retired
configuredNodes.add(new ConfiguredNode(9, true));
FleetControllerOptions options = new FleetControllerOptions("mycluster", configuredNodes);
options.minRatioOfStorageNodesUp = 0;
options.maxInitProgressTime = 30000;
options.stableStateTimePeriod = 60000;
setUpFleetController(true, options);
setUpVdsNodes(true, new DummyVdsNodeOptions(), false, configuredNodes);
waitForState("version:\\d+ distributor:10 storage:10 .9.s:r");
setWantedNodeState(State.DOWN, NodeType.DISTRIBUTOR, 2);
setWantedNodeState(State.RETIRED, NodeType.STORAGE, 2);
setWantedNodeState(State.MAINTENANCE, NodeType.STORAGE, 7);
waitForCompleteCycle();
timer.advanceTime(1000000);
// Make fleet controller notice that time has changed before any disconnects
waitForCompleteCycle();
nodes.get(0).disconnect();
nodes.get(3).disconnect();
nodes.get(5).disconnect();
waitForState("version:\\d+ distributor:10 .0.s:d .2.s:d storage:10 .1.s:m .2.s:m .7.s:m .9.s:r");
timer.advanceTime(1000000);
waitForState("version:\\d+ distributor:10 .0.s:d .2.s:d storage:10 .1.s:d .2.s:d .7.s:m .9.s:r");
timer.advanceTime(1000000);
// Make fleet controller notice that time has changed before any disconnects
waitForCompleteCycle();
nodes.get(3).setNodeState(new NodeState(nodes.get(3).getType(), State.INITIALIZING).setInitProgress(0.2));
nodes.get(3).connect();
waitForState("version:\\d+ distributor:10 .0.s:d .2.s:d storage:10 .1.s:i .1.i:0.2 .2.s:d .7.s:m .9.s:r");
}
Aggregations