Package org.apache.ambari.server.state

Examples of org.apache.ambari.server.state.Alert


              }
             
              if (null != status.getAlerts()) {
                List<Alert> clusterAlerts = new ArrayList<Alert>();
                for (AgentAlert aa : status.getAlerts()) {
                  Alert alert = new Alert(aa.getName(), aa.getInstance(),
                      scHost.getServiceName(), scHost.getServiceComponentName(),
                      scHost.getHostName(), aa.getState());
                  alert.setLabel(aa.getLabel());
                  alert.setText(aa.getText());
                 
                  clusterAlerts.add(alert);
                }
               
               if (0 != clusterAlerts.size())
View Full Code Here


   
    handler.handleHeartBeat(hb);
   
    Assert.assertNotNull(hdfs.getCluster().getAlerts());
    Assert.assertEquals(1, hdfs.getCluster().getAlerts().size());
    Alert clusterAlert = hdfs.getCluster().getAlerts().iterator().next();
    Assert.assertNotNull(clusterAlert);
    Assert.assertEquals(HDFS, clusterAlert.getService());
    Assert.assertEquals(DATANODE, clusterAlert.getComponent());
    Assert.assertEquals(DummyHostname1, clusterAlert.getHost());
    Assert.assertEquals(AlertState.CRITICAL, clusterAlert.getState());
  }
View Full Code Here

    Injector inj = Guice.createInjector(new GuiceModule());
   
    Clusters clusters = inj.getInstance(Clusters.class);
    Cluster cluster = createMock(Cluster.class);
   
    Alert alert = new Alert("ganglia_madeup", null, "GANGLIA", "GANGLIA_MYSTERY",
        "h1", AlertState.CRITICAL);
   
    expect(cluster.getAlerts()).andReturn(Collections.singleton(alert)).anyTimes();
    expect(clusters.getCluster("c1")).andReturn(cluster);
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.state.Alert

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.