当前位置: 首页>>代码示例>>Java>>正文


Java StopContainersResponse类代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse的典型用法代码示例。如果您正苦于以下问题:Java StopContainersResponse类的具体用法?Java StopContainersResponse怎么用?Java StopContainersResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StopContainersResponse类属于org.apache.hadoop.yarn.api.protocolrecords包,在下文中一共展示了StopContainersResponse类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stopContainer

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
private void stopContainer(YarnRPC rpc, Token nmToken,
    List<ContainerId> containerId, ApplicationAttemptId appAttemptId,
    NodeId nodeId) throws Exception {
  StopContainersRequest request =
      StopContainersRequest.newInstance(containerId);
  ContainerManagementProtocol proxy = null;
  try {
    proxy =
        getContainerManagementProtocolProxy(rpc, nmToken, nodeId,
            appAttemptId.toString());
    StopContainersResponse response = proxy.stopContainers(request);
    if (response.getFailedRequests() != null &&
        response.getFailedRequests().containsKey(containerId)) {
      parseAndThrowException(response.getFailedRequests().get(containerId)
          .deSerialize());
    }
  } catch (Exception e) {
    if (proxy != null) {
      rpc.stopProxy(proxy, conf);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:TestContainerManagerSecurity.java

示例2: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
/**
 * Stop a list of containers running on this NodeManager.
 */
@Override
public StopContainersResponse stopContainers(StopContainersRequest requests)
    throws YarnException, IOException {

  List<ContainerId> succeededRequests = new ArrayList<ContainerId>();
  Map<ContainerId, SerializedException> failedRequests =
      new HashMap<ContainerId, SerializedException>();
  UserGroupInformation remoteUgi = getRemoteUgi();
  NMTokenIdentifier identifier = selectNMTokenIdentifier(remoteUgi);
  for (ContainerId id : requests.getContainerIds()) {
    try {
      stopContainerInternal(identifier, id);
      succeededRequests.add(id);
    } catch (YarnException e) {
      failedRequests.put(id, SerializedException.newInstance(e));
    }
  }
  return StopContainersResponse
    .newInstance(succeededRequests, failedRequests);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:ContainerManagerImpl.java

示例3: stopContainerInternal

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
private void stopContainerInternal(ContainerId containerId, NodeId nodeId)
    throws IOException, YarnException {
  ContainerManagementProtocolProxyData proxy = null;
  List<ContainerId> containerIds = new ArrayList<ContainerId>();
  containerIds.add(containerId);
  try {
    proxy = cmProxy.getProxy(nodeId.toString(), containerId);
    StopContainersResponse response =
        proxy.getContainerManagementProtocol().stopContainers(
          StopContainersRequest.newInstance(containerIds));
    if (response.getFailedRequests() != null
        && response.getFailedRequests().containsKey(containerId)) {
      Throwable t = response.getFailedRequests().get(containerId)
        .deSerialize();
      parseAndThrowException(t);
    }
  } finally {
    if (proxy != null) {
      cmProxy.mayBeCloseProxy(proxy);
    }
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:NMClientImpl.java

示例4: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
/**
 * Stop a list of containers running on this NodeManager.
 */
@Override
public StopContainersResponse stopContainers(StopContainersRequest requests)
    throws YarnException, IOException {

  List<ContainerId> succeededRequests = new ArrayList<ContainerId>();
  Map<ContainerId, SerializedException> failedRequests =
      new HashMap<ContainerId, SerializedException>();
  UserGroupInformation remoteUgi = getRemoteUgi();
  NMTokenIdentifier identifier = selectNMTokenIdentifier(remoteUgi);
  if (identifier == null) {
    throw RPCUtil.getRemoteException(INVALID_NMTOKEN_MSG);
  }
  for (ContainerId id : requests.getContainerIds()) {
    try {
      stopContainerInternal(identifier, id);
      succeededRequests.add(id);
    } catch (YarnException e) {
      failedRequests.put(id, SerializedException.newInstance(e));
    }
  }
  return StopContainersResponse
    .newInstance(succeededRequests, failedRequests);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:27,代码来源:ContainerManagerImpl.java

示例5: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse stopContainers(StopContainersRequest requests)
    throws YarnException, IOException {
  StopContainersRequestProto requestProto =
      ((StopContainersRequestPBImpl) requests).getProto();
  try {
    return new StopContainersResponsePBImpl(proxy.stopContainers(null,
      requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:ContainerManagementProtocolPBClientImpl.java

示例6: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse stopContainers(StopContainersRequest request) 
throws YarnException {
  Exception e = new Exception(EXCEPTION_MSG, 
      new Exception(EXCEPTION_CAUSE));
  throw new YarnException(e);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestRPC.java

示例7: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse
    stopContainers(StopContainersRequest requests) throws YarnException,
        IOException {
  Exception e = new Exception("Dummy function", new Exception(
      "Dummy function cause"));
  throw new YarnException(e);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:TestContainerLaunchRPC.java

示例8: cleanup

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
private void cleanup() throws IOException, YarnException {
  connect();
  ContainerId containerId = masterContainer.getId();
  List<ContainerId> containerIds = new ArrayList<ContainerId>();
  containerIds.add(containerId);
  StopContainersRequest stopRequest =
      StopContainersRequest.newInstance(containerIds);
  StopContainersResponse response =
      containerMgrProxy.stopContainers(stopRequest);
  if (response.getFailedRequests() != null
      && response.getFailedRequests().containsKey(containerId)) {
    Throwable t = response.getFailedRequests().get(containerId).deSerialize();
    parseAndThrowException(t);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:16,代码来源:AMLauncher.java

示例9: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse stopContainers(StopContainersRequest request)
    throws YarnException {
  LOG.info("Container cleaned up by MyContainerManager");
  cleanedup = true;
  return null;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestApplicationMasterLauncher.java

示例10: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse stopContainers(StopContainersRequest request)
    throws IOException {
  Exception e = new Exception("Dummy function", new Exception(
      "Dummy function cause"));
  throw new IOException(e);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:TestContainerLauncher.java

示例11: stopContainers

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse stopContainers(StopContainersRequest request)
    throws YarnException, IOException {
  ContainersResponse containersResponse = containerManager
      .stopContainers(request.getContainerIds());
  return StopContainersResponse.newInstance(
      containersResponse.getSucceededContainers(),
      containersResponse.getFailedContainers());
}
 
开发者ID:intel-hpdd,项目名称:scheduling-connector-for-hadoop,代码行数:10,代码来源:HPCContainerManagementProtocolImpl.java

示例12: Exception

import org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse; //导入依赖的package包/类
@Override
public StopContainersResponse
stopContainers(StopContainersRequest requests) throws YarnException,
    IOException {
  Exception e = new Exception("Dummy function", new Exception(
      "Dummy function cause"));
  throw new YarnException(e);
}
 
开发者ID:aliyun-beta,项目名称:aliyun-oss-hadoop-fs,代码行数:9,代码来源:TestContainerResourceIncreaseRPC.java


注:本文中的org.apache.hadoop.yarn.api.protocolrecords.StopContainersResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。