Java 类org.apache.hadoop.yarn.api.records.ContainerResourceDecrease 实例源码

项目:hadoop    文件:AllocateResponse.java   
@Public
@Stable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response = newInstance(responseId, completedContainers,
      allocatedContainers, updatedNodes, availResources, command,
      numClusterNodes, preempt, nmTokens);
  response.setIncreasedContainers(increasedContainers);
  response.setDecreasedContainers(decreasedContainers);
  return response;
}
项目:hadoop    文件:AllocateResponse.java   
@Private
@Unstable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens, Token amRMToken,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response =
      newInstance(responseId, completedContainers, allocatedContainers,
        updatedNodes, availResources, command, numClusterNodes, preempt,
        nmTokens, increasedContainers, decreasedContainers);
  response.setAMRMToken(amRMToken);
  return response;
}
项目:hadoop    文件:TestLocalContainerAllocator.java   
@Override
public AllocateResponse allocate(AllocateRequest request)
    throws YarnException, IOException {
  Assert.assertEquals("response ID mismatch",
      responseId, request.getResponseId());
  ++responseId;
  org.apache.hadoop.yarn.api.records.Token yarnToken = null;
  if (amToken != null) {
    yarnToken = org.apache.hadoop.yarn.api.records.Token.newInstance(
        amToken.getIdentifier(), amToken.getKind().toString(),
        amToken.getPassword(), amToken.getService().toString());
  }
  return AllocateResponse.newInstance(responseId,
      Collections.<ContainerStatus>emptyList(),
      Collections.<Container>emptyList(),
      Collections.<NodeReport>emptyList(),
      Resources.none(), null, 1, null,
      Collections.<NMToken>emptyList(),
      yarnToken,
      Collections.<ContainerResourceIncrease>emptyList(),
      Collections.<ContainerResourceDecrease>emptyList());
}
项目:big-c    文件:AllocateResponse.java   
@Public
@Stable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response = newInstance(responseId, completedContainers,
      allocatedContainers, updatedNodes, availResources, command,
      numClusterNodes, preempt, nmTokens);
  response.setIncreasedContainers(increasedContainers);
  response.setDecreasedContainers(decreasedContainers);
  return response;
}
项目:big-c    文件:AllocateResponse.java   
@Private
@Unstable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens, Token amRMToken,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response =
      newInstance(responseId, completedContainers, allocatedContainers,
        updatedNodes, availResources, command, numClusterNodes, preempt,
        nmTokens, increasedContainers, decreasedContainers);
  response.setAMRMToken(amRMToken);
  return response;
}
项目:big-c    文件:TestLocalContainerAllocator.java   
@Override
public AllocateResponse allocate(AllocateRequest request)
    throws YarnException, IOException {
  Assert.assertEquals("response ID mismatch",
      responseId, request.getResponseId());
  ++responseId;
  org.apache.hadoop.yarn.api.records.Token yarnToken = null;
  if (amToken != null) {
    yarnToken = org.apache.hadoop.yarn.api.records.Token.newInstance(
        amToken.getIdentifier(), amToken.getKind().toString(),
        amToken.getPassword(), amToken.getService().toString());
  }
  return AllocateResponse.newInstance(responseId,
      Collections.<ContainerStatus>emptyList(),
      Collections.<Container>emptyList(),
      Collections.<NodeReport>emptyList(),
      Resources.none(), null, 1, null,
      Collections.<NMToken>emptyList(),
      yarnToken,
      Collections.<ContainerResourceIncrease>emptyList(),
      Collections.<ContainerResourceDecrease>emptyList());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponse.java   
@Public
@Stable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response = newInstance(responseId, completedContainers,
      allocatedContainers, updatedNodes, availResources, command,
      numClusterNodes, preempt, nmTokens);
  response.setIncreasedContainers(increasedContainers);
  response.setDecreasedContainers(decreasedContainers);
  return response;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponse.java   
@Private
@Unstable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens, Token amRMToken,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response =
      newInstance(responseId, completedContainers, allocatedContainers,
        updatedNodes, availResources, command, numClusterNodes, preempt,
        nmTokens, increasedContainers, decreasedContainers);
  response.setAMRMToken(amRMToken);
  return response;
}
项目:hadoop-on-lustre2    文件:AllocateResponse.java   
@Public
@Stable
public static AllocateResponse newInstance(int responseId,
    List<ContainerStatus> completedContainers,
    List<Container> allocatedContainers, List<NodeReport> updatedNodes,
    Resource availResources, AMCommand command, int numClusterNodes,
    PreemptionMessage preempt, List<NMToken> nmTokens,
    List<ContainerResourceIncrease> increasedContainers,
    List<ContainerResourceDecrease> decreasedContainers) {
  AllocateResponse response = newInstance(responseId, completedContainers,
      allocatedContainers, updatedNodes, availResources, command,
      numClusterNodes, preempt, nmTokens);
  response.setIncreasedContainers(increasedContainers);
  response.setDecreasedContainers(decreasedContainers);
  return response;
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
@Override
public synchronized void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers) {
  if (decreasedContainers == null) {
    return;
  }
  initLocalDecreasedContainerList();
  this.decreasedContainers.addAll(decreasedContainers);
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized void initLocalDecreasedContainerList() {
  if (this.decreasedContainers != null) {
    return;
  }
  AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceDecreaseProto> list = p.getDecreasedContainersList();
  decreasedContainers = new ArrayList<ContainerResourceDecrease>();

  for (ContainerResourceDecreaseProto c : list) {
    decreasedContainers.add(convertFromProtoFormat(c));
  }
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized Iterable<ContainerResourceDecreaseProto>
    getChangeProtoIterable(
        final List<ContainerResourceDecrease> newContainersList) {
  maybeInitBuilder();
  return new Iterable<ContainerResourceDecreaseProto>() {
    @Override
    public synchronized Iterator<ContainerResourceDecreaseProto> iterator() {
      return new Iterator<ContainerResourceDecreaseProto>() {

        Iterator<ContainerResourceDecrease> iter = newContainersList
            .iterator();

        @Override
        public synchronized boolean hasNext() {
          return iter.hasNext();
        }

        @Override
        public synchronized ContainerResourceDecreaseProto next() {
          return convertToProtoFormat(iter.next());
        }

        @Override
        public synchronized void remove() {
          throw new UnsupportedOperationException();
        }
      };

    }
  };
}
项目:big-c    文件:AllocateResponsePBImpl.java   
@Override
public synchronized void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers) {
  if (decreasedContainers == null) {
    return;
  }
  initLocalDecreasedContainerList();
  this.decreasedContainers.addAll(decreasedContainers);
}
项目:big-c    文件:AllocateResponsePBImpl.java   
private synchronized void initLocalDecreasedContainerList() {
  if (this.decreasedContainers != null) {
    return;
  }
  AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceDecreaseProto> list = p.getDecreasedContainersList();
  decreasedContainers = new ArrayList<ContainerResourceDecrease>();

  for (ContainerResourceDecreaseProto c : list) {
    decreasedContainers.add(convertFromProtoFormat(c));
  }
}
项目:big-c    文件:AllocateResponsePBImpl.java   
private synchronized Iterable<ContainerResourceDecreaseProto>
    getChangeProtoIterable(
        final List<ContainerResourceDecrease> newContainersList) {
  maybeInitBuilder();
  return new Iterable<ContainerResourceDecreaseProto>() {
    @Override
    public synchronized Iterator<ContainerResourceDecreaseProto> iterator() {
      return new Iterator<ContainerResourceDecreaseProto>() {

        Iterator<ContainerResourceDecrease> iter = newContainersList
            .iterator();

        @Override
        public synchronized boolean hasNext() {
          return iter.hasNext();
        }

        @Override
        public synchronized ContainerResourceDecreaseProto next() {
          return convertToProtoFormat(iter.next());
        }

        @Override
        public synchronized void remove() {
          throw new UnsupportedOperationException();
        }
      };

    }
  };
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
@Override
public synchronized void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers) {
  if (decreasedContainers == null) {
    return;
  }
  initLocalDecreasedContainerList();
  this.decreasedContainers.addAll(decreasedContainers);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
private synchronized void initLocalDecreasedContainerList() {
  if (this.decreasedContainers != null) {
    return;
  }
  AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceDecreaseProto> list = p.getDecreasedContainersList();
  decreasedContainers = new ArrayList<ContainerResourceDecrease>();

  for (ContainerResourceDecreaseProto c : list) {
    decreasedContainers.add(convertFromProtoFormat(c));
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
private synchronized Iterable<ContainerResourceDecreaseProto>
    getChangeProtoIterable(
        final List<ContainerResourceDecrease> newContainersList) {
  maybeInitBuilder();
  return new Iterable<ContainerResourceDecreaseProto>() {
    @Override
    public synchronized Iterator<ContainerResourceDecreaseProto> iterator() {
      return new Iterator<ContainerResourceDecreaseProto>() {

        Iterator<ContainerResourceDecrease> iter = newContainersList
            .iterator();

        @Override
        public synchronized boolean hasNext() {
          return iter.hasNext();
        }

        @Override
        public synchronized ContainerResourceDecreaseProto next() {
          return convertToProtoFormat(iter.next());
        }

        @Override
        public synchronized void remove() {
          throw new UnsupportedOperationException();
        }
      };

    }
  };
}
项目:hadoop-on-lustre2    文件:AllocateResponsePBImpl.java   
@Override
public synchronized void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers) {
  if (decreasedContainers == null) {
    return;
  }
  initLocalDecreasedContainerList();
  this.decreasedContainers.addAll(decreasedContainers);
}
项目:hadoop-on-lustre2    文件:AllocateResponsePBImpl.java   
private synchronized void initLocalDecreasedContainerList() {
  if (this.decreasedContainers != null) {
    return;
  }
  AllocateResponseProtoOrBuilder p = viaProto ? proto : builder;
  List<ContainerResourceDecreaseProto> list = p.getDecreasedContainersList();
  decreasedContainers = new ArrayList<ContainerResourceDecrease>();

  for (ContainerResourceDecreaseProto c : list) {
    decreasedContainers.add(convertFromProtoFormat(c));
  }
}
项目:hadoop-on-lustre2    文件:AllocateResponsePBImpl.java   
private synchronized Iterable<ContainerResourceDecreaseProto>
    getChangeProtoIterable(
        final List<ContainerResourceDecrease> newContainersList) {
  maybeInitBuilder();
  return new Iterable<ContainerResourceDecreaseProto>() {
    @Override
    public synchronized Iterator<ContainerResourceDecreaseProto> iterator() {
      return new Iterator<ContainerResourceDecreaseProto>() {

        Iterator<ContainerResourceDecrease> iter = newContainersList
            .iterator();

        @Override
        public synchronized boolean hasNext() {
          return iter.hasNext();
        }

        @Override
        public synchronized ContainerResourceDecreaseProto next() {
          return convertToProtoFormat(iter.next());
        }

        @Override
        public synchronized void remove() {
          throw new UnsupportedOperationException();
        }
      };

    }
  };
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
@Override
public synchronized List<ContainerResourceDecrease> getDecreasedContainers() {
  initLocalDecreasedContainerList();
  return decreasedContainers;
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecrease convertFromProtoFormat(
    ContainerResourceDecreaseProto p) {
  return new ContainerResourceDecreasePBImpl(p);
}
项目:hadoop    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecreaseProto convertToProtoFormat(
    ContainerResourceDecrease t) {
  return ((ContainerResourceDecreasePBImpl) t).getProto();
}
项目:hadoop    文件:AllocateResponse.java   
/**
 * Get the list of newly decreased containers by <code>NodeManager</code>
 */
@Public
@Stable
public abstract List<ContainerResourceDecrease> getDecreasedContainers();
项目:hadoop    文件:AllocateResponse.java   
/**
 * Set the list of newly decreased containers by <code>NodeManager</code>
 */
@Private
@Unstable
public abstract void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers);
项目:big-c    文件:AllocateResponsePBImpl.java   
@Override
public synchronized List<ContainerResourceDecrease> getDecreasedContainers() {
  initLocalDecreasedContainerList();
  return decreasedContainers;
}
项目:big-c    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecrease convertFromProtoFormat(
    ContainerResourceDecreaseProto p) {
  return new ContainerResourceDecreasePBImpl(p);
}
项目:big-c    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecreaseProto convertToProtoFormat(
    ContainerResourceDecrease t) {
  return ((ContainerResourceDecreasePBImpl) t).getProto();
}
项目:big-c    文件:AllocateResponse.java   
/**
 * Get the list of newly decreased containers by <code>NodeManager</code>
 */
@Public
@Stable
public abstract List<ContainerResourceDecrease> getDecreasedContainers();
项目:big-c    文件:AllocateResponse.java   
/**
 * Set the list of newly decreased containers by <code>NodeManager</code>
 */
@Private
@Unstable
public abstract void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers);
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
@Override
public synchronized List<ContainerResourceDecrease> getDecreasedContainers() {
  initLocalDecreasedContainerList();
  return decreasedContainers;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecrease convertFromProtoFormat(
    ContainerResourceDecreaseProto p) {
  return new ContainerResourceDecreasePBImpl(p);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecreaseProto convertToProtoFormat(
    ContainerResourceDecrease t) {
  return ((ContainerResourceDecreasePBImpl) t).getProto();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponse.java   
/**
 * Get the list of newly decreased containers by <code>NodeManager</code>
 */
@Public
@Stable
public abstract List<ContainerResourceDecrease> getDecreasedContainers();
项目:hadoop-2.6.0-cdh5.4.3    文件:AllocateResponse.java   
/**
 * Set the list of newly decreased containers by <code>NodeManager</code>
 */
@Private
@Unstable
public abstract void setDecreasedContainers(
    List<ContainerResourceDecrease> decreasedContainers);
项目:hops    文件:AllocateResponsePBImpl.java   
@Override
public List<ContainerResourceDecrease> getDecreasedContainers() {
  return null;
}
项目:hadoop-on-lustre2    文件:AllocateResponsePBImpl.java   
@Override
public synchronized List<ContainerResourceDecrease> getDecreasedContainers() {
  initLocalDecreasedContainerList();
  return decreasedContainers;
}
项目:hadoop-on-lustre2    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecrease convertFromProtoFormat(
    ContainerResourceDecreaseProto p) {
  return new ContainerResourceDecreasePBImpl(p);
}
项目:hadoop-on-lustre2    文件:AllocateResponsePBImpl.java   
private synchronized ContainerResourceDecreaseProto convertToProtoFormat(
    ContainerResourceDecrease t) {
  return ((ContainerResourceDecreasePBImpl) t).getProto();
}