Java 类org.apache.hadoop.yarn.api.protocolrecords.impl.pb.ReservationUpdateRequestPBImpl 实例源码

项目:hadoop    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoID() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation id. Please try again by specifying a reservation id."));
    LOG.info(message);
  }
}
项目:hadoop    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoDefinition() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation definition. Please try again by specifying a reservation definition."));
    LOG.info(message);
  }
}
项目:hadoop    文件:TestReservationInputValidator.java   
private ReservationUpdateRequest createSimpleReservationUpdateRequest(
    int numRequests, int numContainers, long arrival, long deadline,
    long duration) {
  // create a request with a single atomic ask
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  ReservationDefinition rDef = new ReservationDefinitionPBImpl();
  rDef.setArrival(arrival);
  rDef.setDeadline(deadline);
  if (numRequests > 0) {
    ReservationRequests reqs = new ReservationRequestsPBImpl();
    rDef.setReservationRequests(reqs);
    if (numContainers > 0) {
      ReservationRequest r =
          ReservationRequest.newInstance(Resource.newInstance(1024, 1, 1),
              numContainers, 1, duration);

      reqs.setReservationResources(Collections.singletonList(r));
      reqs.setInterpreter(ReservationRequestInterpreter.R_ALL);
    }
  }
  request.setReservationDefinition(rDef);
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  return request;
}
项目:aliyun-oss-hadoop-fs    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoID() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation id. Please try again by specifying a reservation id."));
    LOG.info(message);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoDefinition() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation definition. Please try again by specifying a reservation definition."));
    LOG.info(message);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestReservationInputValidator.java   
private ReservationUpdateRequest createSimpleReservationUpdateRequest(
    int numRequests, int numContainers, long arrival, long deadline,
    long duration) {
  // create a request with a single atomic ask
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  ReservationDefinition rDef = new ReservationDefinitionPBImpl();
  rDef.setArrival(arrival);
  rDef.setDeadline(deadline);
  if (numRequests > 0) {
    ReservationRequests reqs = new ReservationRequestsPBImpl();
    rDef.setReservationRequests(reqs);
    if (numContainers > 0) {
      ReservationRequest r =
          ReservationRequest.newInstance(Resource.newInstance(1024, 1),
              numContainers, 1, duration);

      reqs.setReservationResources(Collections.singletonList(r));
      reqs.setInterpreter(ReservationRequestInterpreter.R_ALL);
    }
  }
  request.setReservationDefinition(rDef);
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  return request;
}
项目:big-c    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoID() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation id. Please try again by specifying a reservation id."));
    LOG.info(message);
  }
}
项目:big-c    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoDefinition() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation definition. Please try again by specifying a reservation definition."));
    LOG.info(message);
  }
}
项目:big-c    文件:TestReservationInputValidator.java   
private ReservationUpdateRequest createSimpleReservationUpdateRequest(
    int numRequests, int numContainers, long arrival, long deadline,
    long duration) {
  // create a request with a single atomic ask
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  ReservationDefinition rDef = new ReservationDefinitionPBImpl();
  rDef.setArrival(arrival);
  rDef.setDeadline(deadline);
  if (numRequests > 0) {
    ReservationRequests reqs = new ReservationRequestsPBImpl();
    rDef.setReservationRequests(reqs);
    if (numContainers > 0) {
      ReservationRequest r =
          ReservationRequest.newInstance(Resource.newInstance(1024, 1),
              numContainers, 1, duration);

      reqs.setReservationResources(Collections.singletonList(r));
      reqs.setInterpreter(ReservationRequestInterpreter.R_ALL);
    }
  }
  request.setReservationDefinition(rDef);
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  return request;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoID() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation id. Please try again by specifying a reservation id."));
    LOG.info(message);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoDefinition() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation definition. Please try again by specifying a reservation definition."));
    LOG.info(message);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestReservationInputValidator.java   
private ReservationUpdateRequest createSimpleReservationUpdateRequest(
    int numRequests, int numContainers, long arrival, long deadline,
    long duration) {
  // create a request with a single atomic ask
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  ReservationDefinition rDef = new ReservationDefinitionPBImpl();
  rDef.setArrival(arrival);
  rDef.setDeadline(deadline);
  if (numRequests > 0) {
    ReservationRequests reqs = new ReservationRequestsPBImpl();
    rDef.setReservationRequests(reqs);
    if (numContainers > 0) {
      ReservationRequest r =
          ReservationRequest.newInstance(Resource.newInstance(1024, 1),
              numContainers, 1, duration);

      reqs.setReservationResources(Collections.singletonList(r));
      reqs.setInterpreter(ReservationRequestInterpreter.R_ALL);
    }
  }
  request.setReservationDefinition(rDef);
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  return request;
}
项目:hops    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoID() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation id. Please try again by specifying a reservation id."));
    LOG.info(message);
  }
}
项目:hops    文件:TestReservationInputValidator.java   
@Test
public void testUpdateReservationNoDefinition() {
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .startsWith("Missing reservation definition. Please try again by specifying a reservation definition."));
    LOG.info(message);
  }
}
项目:hops    文件:TestReservationInputValidator.java   
private ReservationUpdateRequest createSimpleReservationUpdateRequest(
    int numRequests, int numContainers, long arrival, long deadline,
    long duration) {
  // create a request with a single atomic ask
  ReservationUpdateRequest request = new ReservationUpdateRequestPBImpl();
  ReservationDefinition rDef = new ReservationDefinitionPBImpl();
  rDef.setArrival(arrival);
  rDef.setDeadline(deadline);
  if (numRequests > 0) {
    ReservationRequests reqs = new ReservationRequestsPBImpl();
    rDef.setReservationRequests(reqs);
    if (numContainers > 0) {
      ReservationRequest r =
          ReservationRequest.newInstance(Resource.newInstance(1024, 1),
              numContainers, 1, duration);

      reqs.setReservationResources(Collections.singletonList(r));
      reqs.setInterpreter(ReservationRequestInterpreter.R_ALL);
    }
  }
  request.setReservationDefinition(rDef);
  request.setReservationId(ReservationSystemTestUtil.getNewReservationId());
  return request;
}
项目:hadoop    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationUpdateResponse updateReservation(ReservationUpdateRequest request)
    throws YarnException, IOException {
  ReservationUpdateRequestProto requestProto =
      ((ReservationUpdateRequestPBImpl) request).getProto();
  try {
    return new ReservationUpdateResponsePBImpl(proxy.updateReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationUpdateResponse updateReservation(ReservationUpdateRequest request)
    throws YarnException, IOException {
  ReservationUpdateRequestProto requestProto =
      ((ReservationUpdateRequestPBImpl) request).getProto();
  try {
    return new ReservationUpdateResponsePBImpl(proxy.updateReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationUpdateResponse updateReservation(ReservationUpdateRequest request)
    throws YarnException, IOException {
  ReservationUpdateRequestProto requestProto =
      ((ReservationUpdateRequestPBImpl) request).getProto();
  try {
    return new ReservationUpdateResponsePBImpl(proxy.updateReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationUpdateResponse updateReservation(ReservationUpdateRequest request)
    throws YarnException, IOException {
  ReservationUpdateRequestProto requestProto =
      ((ReservationUpdateRequestPBImpl) request).getProto();
  try {
    return new ReservationUpdateResponsePBImpl(proxy.updateReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hops    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationUpdateResponse updateReservation(ReservationUpdateRequest request)
    throws YarnException, IOException {
  ReservationUpdateRequestProto requestProto =
      ((ReservationUpdateRequestPBImpl) request).getProto();
  try {
    return new ReservationUpdateResponsePBImpl(proxy.updateReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestPBImplRecords.java   
@Test
public void testReservationUpdateRequestPBImpl() throws Exception {
  validatePBImplRecord(ReservationUpdateRequestPBImpl.class,
      ReservationUpdateRequestProto.class);
}
项目:hops    文件:TestPBImplRecords.java   
@Test
public void testReservationUpdateRequestPBImpl() throws Exception {
  validatePBImplRecord(ReservationUpdateRequestPBImpl.class,
      ReservationUpdateRequestProto.class);
}