Package mesos

Examples of mesos.TaskDescription


        Collections.shuffle(indices);
        while (indices.size() > 0) {
          for (Iterator<Integer> it = indices.iterator(); it.hasNext();) {
            int i = it.next();
            SlaveOffer offer = offers.get(i);
            TaskDescription task = findTask(
                offer.getSlaveId(), offer.getHost(), cpus[i], mem[i]);
            if (task != null) {
              cpus[i] -= Integer.parseInt(task.getParams().get("cpus"));
              mem[i] -= Integer.parseInt(task.getParams().get("mem"));
              tasks.add(task);
            } else {
              it.remove();
            }
          }
View Full Code Here


    // Create a task description to pass back to Mesos
    String name = "task " + mesosId + " (" + taskType + ")";
    Map<String, String> params = new HashMap<String, String>();
    params.put("cpus", "" + cpusPerTask);
    params.put("mem", "" + memPerTask);
    return new TaskDescription(mesosId, slaveId, name, params, new byte[0]);
  }
View Full Code Here

TOP

Related Classes of mesos.TaskDescription

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.