Package org.apache.ambari.server.state

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


    host.handleEvent(e);
  }

  private void sendUnhealthyHeartbeat(Host host, long counter)
      throws Exception {
    HostHealthStatus healthStatus = new HostHealthStatus(HealthStatus.UNHEALTHY,
        "Unhealthy server");
    HostUnhealthyHeartbeatEvent e = new HostUnhealthyHeartbeatEvent(
        host.getHostName(), counter, healthStatus);
    host.handleEvent(e);
  }
View Full Code Here


      //not stored to DB
      Host host = hostFactory.create(hostEntity, false);
      host.setAgentVersion(new AgentVersion(""));
      List<DiskInfo> emptyDiskList = new ArrayList<DiskInfo>();
      host.setDisksInfo(emptyDiskList);
      host.setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, ""));
      host.setHostAttributes(new HashMap<String, String>());
      host.setState(HostState.INIT);
      hosts.put(hostname, host);
      hostClusterMap.put(hostname, Collections.newSetFromMap(new ConcurrentHashMap<Cluster, Boolean>()));
View Full Code Here

    hostStateEntity = hostEntity.getHostStateEntity();
    if (hostStateEntity == null) {
      hostStateEntity = new HostStateEntity();
      hostStateEntity.setHostEntity(hostEntity);
      hostEntity.setHostStateEntity(hostStateEntity);
      setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, ""));
      if (persisted) {
        persist();
      }
    } else {
      this.stateMachine.setCurrentState(hostStateEntity.getCurrentState());
View Full Code Here

      HostStatusUpdatesReceivedEvent e = (HostStatusUpdatesReceivedEvent)event;
      // TODO Audit logs
      LOG.debug("Host transition to host status updates received state"
          + ", host=" + e.getHostName()
          + ", heartbeatTime=" + e.getTimestamp());
      host.setHealthStatus(new HostHealthStatus(HealthStatus.HEALTHY,
        host.getHealthStatus().getHealthReport()));
    }
View Full Code Here

      host.setLastHeartbeatTime(e.getHeartbeatTime());
      // TODO Audit logs
      LOG.debug("Host transitioned to a healthy state"
              + ", host=" + e.getHostName()
              + ", heartbeatTime=" + e.getHeartbeatTime());
      host.setHealthStatus(new HostHealthStatus(HealthStatus.HEALTHY, host.getHealthStatus().getHealthReport()));
    }
View Full Code Here

      HostHeartbeatLostEvent e = (HostHeartbeatLostEvent) event;
      // TODO Audit logs
      LOG.debug("Host transitioned to heartbeat lost state"
          + ", host=" + e.getHostName()
          + ", lastHeartbeatTime=" + host.getLastHeartbeatTime());
      host.setHealthStatus(new HostHealthStatus(HealthStatus.UNKNOWN, host.getHealthStatus().getHealthReport()));
    }
View Full Code Here

    host.handleEvent(e);
  }

  private void sendUnhealthyHeartbeat(Host host, long counter)
      throws Exception {
    HostHealthStatus healthStatus = new HostHealthStatus(HealthStatus.UNHEALTHY,
        "Unhealthy server");
    HostUnhealthyHeartbeatEvent e = new HostUnhealthyHeartbeatEvent(
        host.getHostName(), counter, healthStatus);
    host.handleEvent(e);
  }
View Full Code Here

    Set<HostResponse> allResponse = new HashSet<HostResponse>();
    allResponse.add(new HostResponse("Host100", "Cluster100",
        "", "", 2, 1, "", "", "", 100000L, 200000L, null, 10L,
        0L, "rack info", null, null,
        new HostHealthStatus(HostHealthStatus.HealthStatus.HEALTHY, "HEALTHY"), "HEALTHY"));
    allResponse.add(new HostResponse("Host101", "Cluster100",
        "", "", 2, 1, "", "", "", 100000L, 200000L, null, 10L,
        0L, "rack info", null, null,
        new HostHealthStatus(HostHealthStatus.HealthStatus.HEALTHY, "HEALTHY"), "HEALTHY"));
    allResponse.add(new HostResponse("Host102", "Cluster100",
        "", "", 2, 1, "", "", "", 100000L, 200000L, null, 10L,
        0L, "rack info", null, null,
        new HostHealthStatus(HostHealthStatus.HealthStatus.HEALTHY, "HEALTHY"), "HEALTHY"));

    // set expectations
    expect(managementController.getHosts(
        AbstractResourceProviderTest.Matcher.getHostRequestSet(null, "Cluster100", null))).
        andReturn(allResponse).once();
View Full Code Here

    RequestStatusResponse response = createNiceMock(RequestStatusResponse.class);

    HostResponse hr = new HostResponse("Host100", "Cluster100",
        "", "", 2, 1, "", "", "", 100000L, 200000L, null, 10L,
        0L, "rack info", null, null,
        new HostHealthStatus(HostHealthStatus.HealthStatus.HEALTHY, "HEALTHY"), "HEALTHY");
   
    Set<HostResponse> hostResponseSet = new HashSet<HostResponse>();
    hostResponseSet.add(hr);

    // set expectations
View Full Code Here

    Set<HostResponse> hostResponseSet = new HashSet<HostResponse>();
    hostResponseSet.add(new HostResponse("Host100", "Cluster100",
        "", "", 2, 1, "", "", "", 100000L, 200000L, null, 10L,
        0L, "rack info", null, null,
        new HostHealthStatus(HostHealthStatus.HealthStatus.HEALTHY, "HEALTHY"), "HEALTHY"));

    // set expectations
    expect(managementController.getHosts(
        AbstractResourceProviderTest.Matcher.getHostRequestSet("Host100", "Cluster100", null))).
        andReturn(hostResponseSet);
View Full Code Here

TOP

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

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.