Examples of TwillRunResources


Examples of org.apache.twill.api.TwillRunResources

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof TwillRunResources)) {
      return false;
    }
    TwillRunResources other = (TwillRunResources) o;
    return (instanceId == other.getInstanceId()) &&
      containerId.equals(other.getContainerId()) &&
      host.equals(other.getHost()) &&
      (virtualCores == other.getVirtualCores()) &&
      (memoryMB == other.getMemoryMB());
    // debugPort is ignored here
  }
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

    };
  }

  private RunningContainers initRunningContainers(ContainerId appMasterContainerId,
                                                  String appMasterHost) throws Exception {
    TwillRunResources appMasterResources = new DefaultTwillRunResources(
      0,
      appMasterContainerId.toString(),
      Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_VIRTUAL_CORES)),
      Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_MEMORY_MB)),
      appMasterHost, null);
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

      int instanceId = getStartInstanceId(runnableName);
      RunId runId = getRunId(runnableName, instanceId);
      TwillContainerController controller = launcher.start(runId, instanceId,
                                                           TwillContainerMain.class, "$HADOOP_CONF_DIR");
      containers.put(runnableName, containerInfo.getId(), controller);
      TwillRunResources resources = new DynamicTwillRunResources(instanceId,
                                                                 containerInfo.getId(),
                                                                 containerInfo.getVirtualCores(),
                                                                 containerInfo.getMemoryMB(),
                                                                 containerInfo.getHost().getHostName(),
                                                                 controller);
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

   *
   * @param runnableName name of runnable.
   * @param containerId container id of the runnable.
   */
  public void removeRunnableResources(String runnableName, String containerId) {
    TwillRunResources toRemove = null;
    // could be faster if usedResources was a Table, but that makes returning the
    // report a little more complex, and this does not need to be terribly fast.
    for (TwillRunResources resources : usedResources.get(runnableName)) {
      if (resources.getContainerId().equals(containerId)) {
        toRemove = resources;
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

  @Override
  public boolean equals(Object o) {
    if (!(o instanceof TwillRunResources)) {
      return false;
    }
    TwillRunResources other = (TwillRunResources) o;
    return (instanceId == other.getInstanceId()) &&
      containerId.equals(other.getContainerId()) &&
      host.equals(other.getHost()) &&
      (virtualCores == other.getVirtualCores()) &&
      (memoryMB == other.getMemoryMB());
  }
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

  @Override
  public ResourceReport deserialize(JsonElement json, Type typeOfT,
                                           JsonDeserializationContext context) throws JsonParseException {
    JsonObject jsonObj = json.getAsJsonObject();
    String appMasterId = jsonObj.get("appMasterId").getAsString();
    TwillRunResources masterResources = context.deserialize(
      jsonObj.get("appMasterResources"), TwillRunResources.class);
    Map<String, Collection<TwillRunResources>> resources = context.deserialize(
      jsonObj.get("runnableResources"), new TypeToken<Map<String, Collection<TwillRunResources>>>() { }.getType());

    return new DefaultResourceReport(appMasterId, masterResources, resources);
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

    };
  }

  private RunningContainers initRunningContainers(ContainerId appMasterContainerId,
                                                  String appMasterHost) throws Exception {
    TwillRunResources appMasterResources = new DefaultTwillRunResources(
      0,
      appMasterContainerId.toString(),
      Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_VIRTUAL_CORES)),
      Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_MEMORY_MB)),
      appMasterHost);
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

      RunId runId = getRunId(runnableName, instanceId);
      TwillContainerController controller = launcher.start(runId, instanceId,
                                                           TwillContainerMain.class, "$HADOOP_CONF_DIR");
      containers.put(runnableName, containerInfo.getId(), controller);

      TwillRunResources resources = new DefaultTwillRunResources(instanceId,
                                                                 containerInfo.getId(),
                                                                 containerInfo.getVirtualCores(),
                                                                 containerInfo.getMemoryMB(),
                                                                 containerInfo.getHost().getHostName());
      resourceReport.addRunResources(runnableName, resources);
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

    };
  }

  private RunningContainers initRunningContainers(ContainerId appMasterContainerId,
                                                  String appMasterHost) throws Exception {
    TwillRunResources appMasterResources = new DefaultTwillRunResources(
      0,
      appMasterContainerId.toString(),
      Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_VIRTUAL_CORES)),
      Integer.parseInt(System.getenv(EnvKeys.YARN_CONTAINER_MEMORY_MB)),
      appMasterHost);
View Full Code Here

Examples of org.apache.twill.api.TwillRunResources

      RunId runId = getRunId(runnableName, instanceId);
      TwillContainerController controller = launcher.start(runId, instanceId,
                                                           TwillContainerMain.class, "$HADOOP_CONF_DIR");
      containers.put(runnableName, containerInfo.getId(), controller);

      TwillRunResources resources = new DefaultTwillRunResources(instanceId,
                                                                 containerInfo.getId(),
                                                                 containerInfo.getVirtualCores(),
                                                                 containerInfo.getMemoryMB(),
                                                                 containerInfo.getHost().getHostName());
      resourceReport.addRunResources(runnableName, resources);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.