org.apache.hadoop.yarn.api.ApplicationClientProtocol.updateReservation()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(92)

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

ApplicationClientProtocol.updateReservation介绍

[英]The interface used by clients to update an existing Reservation. This is referred to as a re-negotiation process, in which a user that has previously submitted a Reservation.

The allocation is attempted by virtually substituting all previous allocations related to this Reservation with new ones, that satisfy the new ReservationUpdateRequest. Upon success the previous allocation is substituted by the new one, and on failure (i.e., if the system cannot find a valid allocation for the updated request), the previous allocation remains valid. The ReservationId is not changed, and applications currently running within this reservation will automatically receive the resources based on the new allocation.
[中]客户端用于更新现有保留的接口。这被称为重新协商过程,在此过程中,先前已提交预订的用户。
通过使用满足新的ReservationUpdateRequest的新分配几乎替换与此保留相关的所有以前的分配来尝试分配。成功时,以前的分配将被新的分配替换,失败时(即,如果系统无法找到更新请求的有效分配),以前的分配仍然有效。保留ID不会更改,当前在此保留内运行的应用程序将根据新分配自动接收资源。

代码示例

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

@Override
public ReservationUpdateResponse updateReservation(
  ReservationUpdateRequest request) throws YarnException, IOException {
 return rmClient.updateReservation(request);
}

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

@Override
public ReservationUpdateResponse updateReservation(
  ReservationUpdateRequest request) throws YarnException, IOException {
 return rmClient.updateReservation(request);
}

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

@Override
public ReservationUpdateResponse updateReservation(
  ReservationUpdateRequest request) throws YarnException, IOException {
 return rmClient.updateReservation(request);
}

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

@Override
public ReservationUpdateResponse updateReservation(
  ReservationUpdateRequest request) throws YarnException, IOException {
 return rmClient.updateReservation(request);
}

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

@Override
public ReservationUpdateResponse updateReservation(
  ReservationUpdateRequest request) throws YarnException, IOException {
 return clientRMProxy.updateReservation(request);
}

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

@Override
public ReservationUpdateResponseProto updateReservation(RpcController controller,
  ReservationUpdateRequestProto requestProto) throws ServiceException {
 ReservationUpdateRequestPBImpl request =
   new ReservationUpdateRequestPBImpl(requestProto);
 try {
  ReservationUpdateResponse response = real.updateReservation(request);
  return ((ReservationUpdateResponsePBImpl) response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

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

@Override
public ReservationUpdateResponseProto updateReservation(RpcController controller,
  ReservationUpdateRequestProto requestProto) throws ServiceException {
 ReservationUpdateRequestPBImpl request =
   new ReservationUpdateRequestPBImpl(requestProto);
 try {
  ReservationUpdateResponse response = real.updateReservation(request);
  return ((ReservationUpdateResponsePBImpl) response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

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

@Override
public ReservationUpdateResponseProto updateReservation(RpcController controller,
  ReservationUpdateRequestProto requestProto) throws ServiceException {
 ReservationUpdateRequestPBImpl request =
   new ReservationUpdateRequestPBImpl(requestProto);
 try {
  ReservationUpdateResponse response = real.updateReservation(request);
  return ((ReservationUpdateResponsePBImpl) response).getProto();
 } catch (YarnException e) {
  throw new ServiceException(e);
 } catch (IOException e) {
  throw new ServiceException(e);
 }
}

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

public void updateReservationState(ReservationUpdateRequest request)
  throws IOException, YarnException {
 ApplicationClientProtocol client = getClientRMService();
 client.updateReservation(request);
 drainEventsImplicitly();
}

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

private void verifyUpdateReservationSuccess(String updater,
    String originalSubmitter, String queueName) throws Exception {
 ReservationId reservationId = createReservation(originalSubmitter);
 submitReservation(originalSubmitter, queueName, reservationId);
 final ReservationUpdateRequest updateRequest =
     ReservationUpdateRequest.newInstance(
         makeSimpleReservationDefinition(), reservationId);
 ApplicationClientProtocol ownerClient = getRMClientForUser(updater);
 ownerClient.updateReservation(updateRequest);
 deleteReservation(updater, reservationId);
}

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

private void verifyUpdateReservationFailure(String updater,
    String originalSubmitter, String queueName) throws Exception {
 ReservationId reservationId = createReservation(originalSubmitter);
 submitReservation(originalSubmitter, queueName, reservationId);
 final ReservationUpdateRequest updateRequest =
     ReservationUpdateRequest.newInstance(
         makeSimpleReservationDefinition(), reservationId);
 ApplicationClientProtocol unauthorizedClient = getRMClientForUser(updater);
 try {
  unauthorizedClient.updateReservation(updateRequest);
  Assert.fail("Reservation updating by the enemy should fail.");
 } catch (YarnException e) {
  handleAdministerException(e, updater, queueName, ReservationACL
      .ADMINISTER_RESERVATIONS.name());
 }
 deleteReservation(originalSubmitter, reservationId);
}

相关文章

微信公众号

最新文章

更多

ApplicationClientProtocol类方法