当前位置: 首页>>代码示例>>Java>>正文


Java YarnException.getMessage方法代码示例

本文整理汇总了Java中org.apache.hadoop.yarn.exceptions.YarnException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java YarnException.getMessage方法的具体用法?Java YarnException.getMessage怎么用?Java YarnException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.yarn.exceptions.YarnException的用法示例。


在下文中一共展示了YarnException.getMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSubmitReservationDoesnotExist

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationDoesnotExist() {
  ReservationSubmissionRequest request =
      new ReservationSubmissionRequestPBImpl();
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .equals("The queue to submit is not specified. Please try again with a valid reservable queue."));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:TestReservationInputValidator.java

示例2: testSubmitReservationInvalidPlan

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationInvalidPlan() {
  ReservationSubmissionRequest request =
      createSimpleReservationSubmissionRequest(1, 1, 1, 5, 3);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .endsWith(" is not managed by reservation system. Please try again with a valid reservable queue."));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestReservationInputValidator.java

示例3: testSubmitReservationNoDefinition

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationNoDefinition() {
  ReservationSubmissionRequest request =
      new ReservationSubmissionRequestPBImpl();
  request.setQueue(PLAN_NAME);
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .equals("Missing reservation definition. Please try again by specifying a reservation definition."));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestReservationInputValidator.java

示例4: testSubmitReservationInvalidDeadline

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationInvalidDeadline() {
  ReservationSubmissionRequest request =
      createSimpleReservationSubmissionRequest(1, 1, 1, 0, 3);
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert.assertTrue(message
        .startsWith("The specified deadline: 0 is the past"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestReservationInputValidator.java

示例5: testSubmitReservationInvalidRR

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationInvalidRR() {
  ReservationSubmissionRequest request =
      createSimpleReservationSubmissionRequest(0, 0, 1, 5, 3);
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert.assertTrue(message
        .startsWith("No resources have been specified to reserve"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestReservationInputValidator.java

示例6: testSubmitReservationEmptyRR

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationEmptyRR() {
  ReservationSubmissionRequest request =
      createSimpleReservationSubmissionRequest(1, 0, 1, 5, 3);
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert.assertTrue(message
        .startsWith("No resources have been specified to reserve"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestReservationInputValidator.java

示例7: testSubmitReservationInvalidDuration

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testSubmitReservationInvalidDuration() {
  ReservationSubmissionRequest request =
      createSimpleReservationSubmissionRequest(1, 1, 1, 3, 4);
  Plan plan = null;
  try {
    plan =
        rrValidator.validateReservationSubmissionRequest(rSystem, request,
            ReservationSystemTestUtil.getNewReservationId());
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert.assertTrue(message.startsWith("The time difference"));
    Assert
        .assertTrue(message
            .contains("must  be greater or equal to the minimum resource duration"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:21,代码来源:TestReservationInputValidator.java

示例8: testUpdateReservationNoID

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestReservationInputValidator.java

示例9: testUpdateReservationDoesnotExist

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testUpdateReservationDoesnotExist() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(1, 1, 1, 5, 4);
  ReservationId rId = request.getReservationId();
  when(rSystem.getQueueForReservation(rId)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:TestReservationInputValidator.java

示例10: testUpdateReservationInvalidPlan

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testUpdateReservationInvalidPlan() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(1, 1, 1, 5, 4);
  when(rSystem.getPlan(PLAN_NAME)).thenReturn(null);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:19,代码来源:TestReservationInputValidator.java

示例11: testUpdateReservationNoDefinition

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@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);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestReservationInputValidator.java

示例12: testUpdateReservationInvalidDeadline

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testUpdateReservationInvalidDeadline() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(1, 1, 1, 0, 3);
  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("The specified deadline: 0 is the past"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestReservationInputValidator.java

示例13: testUpdateReservationInvalidRR

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testUpdateReservationInvalidRR() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(0, 0, 1, 5, 3);
  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("No resources have been specified to reserve"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestReservationInputValidator.java

示例14: testUpdateReservationEmptyRR

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testUpdateReservationEmptyRR() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(1, 0, 1, 5, 3);
  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("No resources have been specified to reserve"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:17,代码来源:TestReservationInputValidator.java

示例15: testUpdateReservationInvalidDuration

import org.apache.hadoop.yarn.exceptions.YarnException; //导入方法依赖的package包/类
@Test
public void testUpdateReservationInvalidDuration() {
  ReservationUpdateRequest request =
      createSimpleReservationUpdateRequest(1, 1, 1, 3, 4);
  Plan plan = null;
  try {
    plan = rrValidator.validateReservationUpdateRequest(rSystem, request);
    Assert.fail();
  } catch (YarnException e) {
    Assert.assertNull(plan);
    String message = e.getMessage();
    Assert
        .assertTrue(message
            .contains("must  be greater or equal to the minimum resource duration"));
    LOG.info(message);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:TestReservationInputValidator.java


注:本文中的org.apache.hadoop.yarn.exceptions.YarnException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。