gpt4 book ai didi

org.apache.hadoop.yarn.ipc.YarnRPC.stopProxy()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 17:10:40 26 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.yarn.ipc.YarnRPC.stopProxy()方法的一些代码示例,展示了YarnRPC.stopProxy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YarnRPC.stopProxy()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.ipc.YarnRPC
类名称:YarnRPC
方法名:stopProxy

YarnRPC.stopProxy介绍

暂无

代码示例

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-client

private boolean tryCloseProxy(
  ContainerManagementProtocolProxyData proxy) {
 proxy.activeCallers--;
 if (proxy.scheduledForClose && proxy.activeCallers < 0) {
  LOG.info("Closing proxy : " + proxy.containerManagerBindAddr);
  cmProxy.remove(proxy.containerManagerBindAddr);
  try {
   rpc.stopProxy(proxy.getContainerManagementProtocol(), conf);
  } finally {
   this.notifyAll();
  }
  return true;
 }
 return false;
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-client

private boolean tryCloseProxy(
  ContainerManagementProtocolProxyData proxy) {
 proxy.activeCallers--;
 if (proxy.scheduledForClose && proxy.activeCallers < 0) {
  if (LOG.isDebugEnabled()) {
   LOG.debug("Closing proxy : " + proxy.containerManagerBindAddr);
  }
  cmProxy.remove(proxy.containerManagerBindAddr);
  try {
   rpc.stopProxy(proxy.getContainerManagementProtocol(), conf);
  } finally {
   this.notifyAll();
  }
  return true;
 }
 return false;
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-client

private boolean tryCloseProxy(
  ContainerManagementProtocolProxyData proxy) {
 proxy.activeCallers--;
 if (proxy.scheduledForClose && proxy.activeCallers < 0) {
  LOG.info("Closing proxy : " + proxy.containerManagerBindAddr);
  cmProxy.remove(proxy.containerManagerBindAddr);
  try {
   rpc.stopProxy(proxy.getContainerManagementProtocol(), conf);
  } finally {
   this.notifyAll();
  }
  return true;
 }
 return false;
}

代码示例来源:origin: io.hops/hadoop-yarn-client

private boolean tryCloseProxy(
  ContainerManagementProtocolProxyData proxy) {
 proxy.activeCallers--;
 if (proxy.scheduledForClose && proxy.activeCallers < 0) {
  if (LOG.isDebugEnabled()) {
   LOG.debug("Closing proxy : " + proxy.containerManagerBindAddr);
  }
  cmProxy.remove(proxy.containerManagerBindAddr);
  try {
   rpc.stopProxy(proxy.getContainerManagementProtocol(), conf);
  } finally {
   this.notifyAll();
  }
  return true;
 }
 return false;
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

private void startContainer(final YarnRPC rpc,
  org.apache.hadoop.yarn.api.records.Token nmToken,
  org.apache.hadoop.yarn.api.records.Token containerToken,
  NodeId nodeId, String user) throws Exception {
 ContainerLaunchContext context =
   Records.newRecord(ContainerLaunchContext.class);
 StartContainerRequest scRequest =
   StartContainerRequest.newInstance(context, containerToken);
 List<StartContainerRequest> list = new ArrayList<StartContainerRequest>();
 list.add(scRequest);
 StartContainersRequest allRequests =
   StartContainersRequest.newInstance(list);
 ContainerManagementProtocol proxy = null;
 try {
  proxy = getContainerManagementProtocolProxy(rpc, nmToken, nodeId, user);
  StartContainersResponse response = proxy.startContainers(allRequests);
  for(SerializedException ex : response.getFailedRequests().values()){
   parseAndThrowException(ex.deSerialize());
  }
 } finally {
  if (proxy != null) {
   rpc.stopProxy(proxy, conf);
  }
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

Assert.assertTrue(nodeToLabels.get(node2).containsAll(Arrays.asList("y")));
rpc.stopProxy(client, conf);
rm.close();

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

private void
  getContainerStatus(YarnRPC rpc,
    org.apache.hadoop.yarn.api.records.Token nmToken,
    ContainerId containerId,
    ApplicationAttemptId appAttemptId, NodeId nodeId,
    boolean isExceptionExpected) throws Exception {
 List<ContainerId> containerIds = new ArrayList<ContainerId>();
 containerIds.add(containerId);
 GetContainerStatusesRequest request =
   GetContainerStatusesRequest.newInstance(containerIds);
 ContainerManagementProtocol proxy = null;
 try {
  proxy =
    getContainerManagementProtocolProxy(rpc, nmToken, nodeId,
      appAttemptId.toString());
  GetContainerStatusesResponse statuses = proxy.getContainerStatuses(request);
  if (statuses.getFailedRequests() != null
    && statuses.getFailedRequests().containsKey(containerId)) {
   parseAndThrowException(statuses.getFailedRequests().get(containerId)
    .deSerialize());
  }
 } finally {
  if (proxy != null) {
   rpc.stopProxy(proxy, conf);
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

private void
  getContainerStatus(YarnRPC rpc,
    org.apache.hadoop.yarn.api.records.Token nmToken,
    ContainerId containerId,
    ApplicationAttemptId appAttemptId, NodeId nodeId,
    boolean isExceptionExpected) throws Exception {
 List<ContainerId> containerIds = new ArrayList<ContainerId>();
 containerIds.add(containerId);
 GetContainerStatusesRequest request =
   GetContainerStatusesRequest.newInstance(containerIds);
 ContainerManagementProtocol proxy = null;
 try {
  proxy =
    getContainerManagementProtocolProxy(rpc, nmToken, nodeId,
      appAttemptId.toString());
  GetContainerStatusesResponse statuses
    = proxy.getContainerStatuses(request);
  if (statuses.getFailedRequests() != null
    && statuses.getFailedRequests().containsKey(containerId)) {
   parseAndThrowException(statuses.getFailedRequests().get(containerId)
    .deSerialize());
  }
 } finally {
  if (proxy != null) {
   rpc.stopProxy(proxy, conf);
  }
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

private void startContainer(final YarnRPC rpc,
  org.apache.hadoop.yarn.api.records.Token nmToken,
  org.apache.hadoop.yarn.api.records.Token containerToken,
  NodeId nodeId, String user) throws Exception {
 ContainerLaunchContext context =
   Records.newRecord(ContainerLaunchContext.class);
 StartContainerRequest scRequest =
   StartContainerRequest.newInstance(context,containerToken);
 List<StartContainerRequest> list = new ArrayList<StartContainerRequest>();
 list.add(scRequest);
 StartContainersRequest allRequests =
   StartContainersRequest.newInstance(list);
 ContainerManagementProtocol proxy = null;
 try {
  proxy = getContainerManagementProtocolProxy(rpc, nmToken, nodeId, user);
  StartContainersResponse response = proxy.startContainers(allRequests);
  for(SerializedException ex : response.getFailedRequests().values()){
   parseAndThrowException(ex.deSerialize());
  }
 } finally {
  if (proxy != null) {
   rpc.stopProxy(proxy, conf);
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Assert.assertEquals(labelsToNodes.get(labelY.getName()), null);
rpc.stopProxy(client, conf);
rm.close();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Arrays.asList(NodeLabel.newInstance("x"))));
rpc.stopProxy(client, conf);
rm.stop();

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-tests

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);
  }
 }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testRMStartWithDecommissionedNode() throws Exception {
 String excludeFile = "excludeFile";
 createExcludeFile(excludeFile);
 YarnConfiguration conf = new YarnConfiguration();
 conf.set(YarnConfiguration.RM_NODES_EXCLUDE_FILE_PATH,
   excludeFile);
 MockRM rm = new MockRM(conf) {
  protected ClientRMService createClientRMService() {
   return new ClientRMService(this.rmContext, scheduler,
     this.rmAppManager, this.applicationACLsManager, this.queueACLsManager,
     this.getRMContext().getRMDelegationTokenSecretManager());
  };
 };
 rm.start();
 YarnRPC rpc = YarnRPC.create(conf);
 InetSocketAddress rmAddress = rm.getClientRMService().getBindAddress();
 LOG.info("Connecting to ResourceManager at " + rmAddress);
 ApplicationClientProtocol client =
   (ApplicationClientProtocol) rpc
     .getProxy(ApplicationClientProtocol.class, rmAddress, conf);
 // Make call
 GetClusterNodesRequest request =
   GetClusterNodesRequest.newInstance(EnumSet.allOf(NodeState.class));
 List<NodeReport> nodeReports = client.getClusterNodes(request).getNodeReports();
 Assert.assertEquals(1, nodeReports.size());
 rm.stop();
 rpc.stopProxy(client, conf);
 new File(excludeFile).delete();
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-tests

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);
  }
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

rpc.stopProxy(client, conf);
new File(excludeFile).delete();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Assert
  .assertTrue(attributes.contains(NodeAttributeInfo.newInstance(docker)));
rpc.stopProxy(client, conf);
rm.close();

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

rpc.stopProxy(client, conf);
rm.close();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

Assert.assertNull(nr.getNodeUpdateType());
rpc.stopProxy(client, conf);
rm.close();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

getResourceInformation("memory-mb").getValue());
rpc.stopProxy(client, conf);
rm.close();

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

rpc.stopProxy(client, conf);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com