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

项目:hadoop    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationNoID() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(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 testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
项目:hadoop    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationInvalidPlan() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(reservationID);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not associated with any valid plan. Please try again with a valid reservation."));
    LOG.info(message);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationNoID() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(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 testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationInvalidPlan() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(reservationID);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not associated with any valid plan. Please try again with a valid reservation."));
    LOG.info(message);
  }
}
项目:big-c    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationNoID() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(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 testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
项目:big-c    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationInvalidPlan() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(reservationID);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not associated with any valid plan. Please try again with a valid reservation."));
    LOG.info(message);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationNoID() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(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 testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationInvalidPlan() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(reservationID);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not associated with any valid plan. Please try again with a valid reservation."));
    LOG.info(message);
  }
}
项目:hops    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationNoID() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(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 testDeleteReservationDoesnotExist() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId rId = ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(rId);
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message.equals(MessageFormat
            .format(
                "The specified reservation with ID: {0} is unknown. Please try again with a valid reservation.",
                rId)));
    LOG.info(message);
  }
}
项目:hops    文件:TestReservationInputValidator.java   
@Test
public void testDeleteReservationInvalidPlan() {
  ReservationDeleteRequest request = new ReservationDeleteRequestPBImpl();
  ReservationId reservationID =
      ReservationSystemTestUtil.getNewReservationId();
  request.setReservationId(reservationID);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationDeleteRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not associated with any valid plan. Please try again with a valid reservation."));
    LOG.info(message);
  }
}
项目:hadoop    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
    throws YarnException, IOException {
  ReservationDeleteRequestProto requestProto =
      ((ReservationDeleteRequestPBImpl) request).getProto();
  try {
    return new ReservationDeleteResponsePBImpl(proxy.deleteReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
    throws YarnException, IOException {
  ReservationDeleteRequestProto requestProto =
      ((ReservationDeleteRequestPBImpl) request).getProto();
  try {
    return new ReservationDeleteResponsePBImpl(proxy.deleteReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:big-c    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
    throws YarnException, IOException {
  ReservationDeleteRequestProto requestProto =
      ((ReservationDeleteRequestPBImpl) request).getProto();
  try {
    return new ReservationDeleteResponsePBImpl(proxy.deleteReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
    throws YarnException, IOException {
  ReservationDeleteRequestProto requestProto =
      ((ReservationDeleteRequestPBImpl) request).getProto();
  try {
    return new ReservationDeleteResponsePBImpl(proxy.deleteReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:hops    文件:ApplicationClientProtocolPBClientImpl.java   
@Override
public ReservationDeleteResponse deleteReservation(ReservationDeleteRequest request)
    throws YarnException, IOException {
  ReservationDeleteRequestProto requestProto =
      ((ReservationDeleteRequestPBImpl) request).getProto();
  try {
    return new ReservationDeleteResponsePBImpl(proxy.deleteReservation(null,
        requestProto));
  } catch (ServiceException e) {
    RPCUtil.unwrapAndThrowException(e);
    return null;
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestPBImplRecords.java   
@Test
public void testReservationDeleteRequestPBImpl() throws Exception {
  validatePBImplRecord(ReservationDeleteRequestPBImpl.class,
      ReservationDeleteRequestProto.class);
}
项目:hops    文件:TestPBImplRecords.java   
@Test
public void testReservationDeleteRequestPBImpl() throws Exception {
  validatePBImplRecord(ReservationDeleteRequestPBImpl.class,
      ReservationDeleteRequestProto.class);
}