abstractdog commented on code in PR #301: URL: https://github.com/apache/tez/pull/301#discussion_r1254045304
########## tez-dag/src/test/java/org/apache/tez/dag/app/launcher/TestContainerLauncherManager.java: ########## @@ -514,26 +549,41 @@ public void stopContainer(ContainerStopRequest stopRequest) { } } - private static final String DAG_NAME = "dagName"; - private static final int DAG_INDEX = 1; - public static class ContainerLauncherForTest extends ContainerLauncher { + public static class FailureReporterContainerLauncher extends ContainerLauncher { - public ContainerLauncherForTest( - ContainerLauncherContext containerLauncherContext) { + public FailureReporterContainerLauncher(ContainerLauncherContext containerLauncherContext) { super(containerLauncherContext); } @Override - public void launchContainer(ContainerLaunchRequest launchRequest) throws - ServicePluginException { + public void launchContainer(ContainerLaunchRequest launchRequest) throws ServicePluginException { getContext().reportError(ServicePluginErrorDefaults.INCONSISTENT_STATE, "ReportedFatalError", null); } @Override public void stopContainer(ContainerStopRequest stopRequest) throws ServicePluginException { - getContext() - .reportError(ServicePluginErrorDefaults.SERVICE_UNAVAILABLE, "ReportError", new DagInfoImplForTest(DAG_INDEX, DAG_NAME)); + getContext().reportError(ServicePluginErrorDefaults.SERVICE_UNAVAILABLE, "ReportError", + new DagInfoImplForTest(DAG_INDEX, DAG_NAME)); } } + /** + * This container launcher simply implements ContainerLauncher methods with the proper context callbacks. + */ + public static class ContainerLauncherForTest extends ContainerLauncher { Review Comment: originally: ContainerLauncherForTest was a mock launcher for reporting errors, I simply renamed it to FailureReporterContainerLauncher, and turned ContainerLauncherForTest to a NO-OP0-ish container launcher with simply callbacks ########## tez-dag/src/test/java/org/apache/tez/dag/app/launcher/TestContainerLauncherManager.java: ########## @@ -514,26 +549,41 @@ public void stopContainer(ContainerStopRequest stopRequest) { } } - private static final String DAG_NAME = "dagName"; - private static final int DAG_INDEX = 1; - public static class ContainerLauncherForTest extends ContainerLauncher { + public static class FailureReporterContainerLauncher extends ContainerLauncher { - public ContainerLauncherForTest( - ContainerLauncherContext containerLauncherContext) { + public FailureReporterContainerLauncher(ContainerLauncherContext containerLauncherContext) { super(containerLauncherContext); } @Override - public void launchContainer(ContainerLaunchRequest launchRequest) throws - ServicePluginException { + public void launchContainer(ContainerLaunchRequest launchRequest) throws ServicePluginException { getContext().reportError(ServicePluginErrorDefaults.INCONSISTENT_STATE, "ReportedFatalError", null); } @Override public void stopContainer(ContainerStopRequest stopRequest) throws ServicePluginException { - getContext() - .reportError(ServicePluginErrorDefaults.SERVICE_UNAVAILABLE, "ReportError", new DagInfoImplForTest(DAG_INDEX, DAG_NAME)); + getContext().reportError(ServicePluginErrorDefaults.SERVICE_UNAVAILABLE, "ReportError", + new DagInfoImplForTest(DAG_INDEX, DAG_NAME)); } } + /** + * This container launcher simply implements ContainerLauncher methods with the proper context callbacks. + */ + public static class ContainerLauncherForTest extends ContainerLauncher { Review Comment: originally: ContainerLauncherForTest was a mock launcher for reporting errors, I simply renamed it to FailureReporterContainerLauncher, and turned ContainerLauncherForTest to a NO-OP-ish container launcher with simply callbacks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@tez.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org