本文整理汇总了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);
}
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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;
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例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);
}