Package org.springframework.yarn.am.allocate

Examples of org.springframework.yarn.am.allocate.ContainerAllocateData


  public SatisfyStateDataResource() {
  }

  public SatisfyStateDataResource(SatisfyStateData satisfyState) {
    allocateData = new ContainerAllocateDataResource();
    ContainerAllocateData data = satisfyState.getAllocateData();
    allocateData.setAny(data.getAny());
    allocateData.setHosts(data.getHosts());
    allocateData.setRacks(data.getRacks());
    removeData = new ArrayList<GridMemberResource>();
    for (GridMember member : satisfyState.getRemoveData()) {
      removeData.add(new GridMemberResource(member.getId().toString()));
    }
  }
View Full Code Here


  public void addStepSplits(StepExecution masterStepExecution, String remoteStepName,
      Set<StepExecution> stepExecutions, Map<StepExecution, ContainerRequestHint> resourceRequests) {

    // from request data we get hints where container should be run.
    // find a well distributed union of hosts.
    ContainerAllocateData containerAllocateData = new ContainerAllocateData();
    int countNeeded = 0;
    HashSet<String> hostUnion = new HashSet<String>();
    for (Entry<StepExecution, ContainerRequestHint> entry : resourceRequests.entrySet()) {
      StepExecution se = entry.getKey();
      ContainerRequestHint crd = entry.getValue();

      requestData.put(se, crd);
      remoteStepNames.put(se, remoteStepName);

      countNeeded++;
      for (String host : crd.getHosts()) {
        hostUnion.add(host);
      }
    }

    while (countNeeded > 0) {
      Iterator<String> iterator = hostUnion.iterator();
      while (countNeeded > 0 && iterator.hasNext()) {
        String host = iterator.next();
        containerAllocateData.addHosts(host, 1);
        countNeeded--;
      }
    }

    if (log.isDebugEnabled()) {
View Full Code Here

  protected void handleSatisfyStateData(ContainerCluster cluster, SatisfyStateData satisfyData) {
    if (satisfyData.getAllocateData() != null) {
      // who set the allocator settings matching id from allocate data???
      // if not configures, fall back to defaults???
      ContainerAllocateData allocateData = satisfyData.getAllocateData();
      // should not set id here!!!
      allocateData.setId(clusterIdToRef.get(cluster.getId()));
      getAllocator().allocateContainers(allocateData);
    }
    for (GridMember member : satisfyData.getRemoveData()) {
      log.info("Queued container to be killed: " + member.getContainer().getId());
      killContainer(member.getContainer());
View Full Code Here

  private List<GridMember> remove;

  private ContainerAllocateData allocateData;

  public SatisfyStateData() {
    this(new ArrayList<GridMember>(), new ContainerAllocateData());
  }
View Full Code Here

  public SatisfyStateData() {
    this(new ArrayList<GridMember>(), new ContainerAllocateData());
  }

  public SatisfyStateData(List<GridMember> remove) {
    this(remove, new ContainerAllocateData());
  }
View Full Code Here

TOP

Related Classes of org.springframework.yarn.am.allocate.ContainerAllocateData

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.