Search in sources :

Example 1 with CheckResult

use of com.hubspot.singularity.mesos.SingularityAgentAndRackManager.CheckResult in project Singularity by HubSpot.

the class SingularityMesosOfferScheduler method checkOfferAndAgent.

private void checkOfferAndAgent(Offer offer, Map<String, Offer> offersToCheck) {
    String rolesInfo = MesosUtils.getRoles(offer).toString();
    LOG.debug("Received offer ID {} with roles {} from {} ({}) for {} cpu(s), {} memory, {} ports, and {} disk", offer.getId().getValue(), rolesInfo, offer.getHostname(), offer.getAgentId().getValue(), MesosUtils.getNumCpus(offer), MesosUtils.getMemory(offer), MesosUtils.getNumPorts(offer), MesosUtils.getDisk(offer));
    CheckResult checkResult = agentAndRackManager.checkOffer(offer);
    if (checkResult == CheckResult.NOT_ACCEPTING_TASKS) {
        mesosSchedulerClient.decline(Collections.singletonList(offer.getId()));
        offersToCheck.remove(offer.getId().getValue());
        LOG.debug("Will decline offer {}, agent {} is not currently in a state to launch tasks", offer.getId().getValue(), offer.getHostname());
    }
}
Also used : CheckResult(com.hubspot.singularity.mesos.SingularityAgentAndRackManager.CheckResult)

Aggregations

CheckResult (com.hubspot.singularity.mesos.SingularityAgentAndRackManager.CheckResult)1