本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}