Search in sources :

Example 36 with Node

use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.

the class EventLogTest method initialize.

private void initialize(MetricUpdater updater) {
    eventLog = new EventLog(new FakeTimer(), updater);
    // Avoid NullPointerException...
    NodeInfo nodeInfo = mock(NodeInfo.class);
    when(nodeEvent.getNode()).thenReturn(nodeInfo);
    Node node = mock(Node.class);
    when(nodeInfo.getNode()).thenReturn(node);
}
Also used : Node(com.yahoo.vdslib.state.Node)

Example 37 with Node

use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.

the class NodeInfoTest method stopping_edge_during_init_does_not_mark_as_unstable_init.

@Test
public void stopping_edge_during_init_does_not_mark_as_unstable_init() {
    ClusterFixture fixture = ClusterFixture.forFlatCluster(3).reportStorageNodeState(0, State.INITIALIZING);
    fixture.reportStorageNodeState(0, State.STOPPING);
    final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 0));
    assertFalse(nodeInfo.recentlyObservedUnstableDuringInit());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 38 with Node

use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.

the class NodeInfoTest method maintenance_wanted_state_overrides_config_retired_state.

@Test
public void maintenance_wanted_state_overrides_config_retired_state() {
    ClusterFixture fixture = ClusterFixture.forFlatCluster(3).markNodeAsConfigRetired(1).proposeStorageNodeWantedState(1, State.MAINTENANCE);
    NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
    assertEquals(State.MAINTENANCE, nodeInfo.getWantedState().getState());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 39 with Node

use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.

the class NodeInfoTest method non_zero_crash_count_does_not_implicitly_set_unstable_init_flag.

@Test
public void non_zero_crash_count_does_not_implicitly_set_unstable_init_flag() {
    ClusterFixture fixture = ClusterFixture.forFlatCluster(3);
    final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
    nodeInfo.setPrematureCrashCount(1);
    assertFalse(nodeInfo.recentlyObservedUnstableDuringInit());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 40 with Node

use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.

the class NodeInfoTest method unstable_init_flag_is_initially_clear.

@Test
public void unstable_init_flag_is_initially_clear() {
    ClusterFixture fixture = ClusterFixture.forFlatCluster(3);
    final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
    assertFalse(nodeInfo.recentlyObservedUnstableDuringInit());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Aggregations

Node (com.yahoo.vdslib.state.Node)65 Test (org.junit.Test)34 NodeState (com.yahoo.vdslib.state.NodeState)32 ConfiguredNode (com.yahoo.vdslib.distribution.ConfiguredNode)31 ClusterFixture.storageNode (com.yahoo.vespa.clustercontroller.core.ClusterFixture.storageNode)15 HasStateReasonForNode.hasStateReasonForNode (com.yahoo.vespa.clustercontroller.core.matchers.HasStateReasonForNode.hasStateReasonForNode)15 ClusterState (com.yahoo.vdslib.state.ClusterState)9 NodeInfo (com.yahoo.vespa.clustercontroller.core.NodeInfo)6 NodeType (com.yahoo.vdslib.state.NodeType)5 PrintWriter (java.io.PrintWriter)5 StringWriter (java.io.StringWriter)5 Request (com.yahoo.jrt.Request)4 State (com.yahoo.vdslib.state.State)4 IOException (java.io.IOException)4 Spec (com.yahoo.jrt.Spec)3 StringValue (com.yahoo.jrt.StringValue)3 Supervisor (com.yahoo.jrt.Supervisor)3 Target (com.yahoo.jrt.Target)3 Transport (com.yahoo.jrt.Transport)3 TreeMap (java.util.TreeMap)3