|
@@ -20,6 +20,8 @@ package org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher;
|
|
|
|
|
|
import static org.apache.hadoop.fs.CreateFlag.CREATE;
|
|
import static org.apache.hadoop.fs.CreateFlag.CREATE;
|
|
import static org.apache.hadoop.fs.CreateFlag.OVERWRITE;
|
|
import static org.apache.hadoop.fs.CreateFlag.OVERWRITE;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import java.io.DataOutputStream;
|
|
import java.io.DataOutputStream;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -36,8 +38,6 @@ import java.util.Map.Entry;
|
|
import java.util.concurrent.Callable;
|
|
import java.util.concurrent.Callable;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
|
-import org.apache.commons.logging.Log;
|
|
|
|
-import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.conf.Configuration;
|
|
import org.apache.hadoop.fs.FSDataInputStream;
|
|
import org.apache.hadoop.fs.FSDataInputStream;
|
|
import org.apache.hadoop.fs.FileContext;
|
|
import org.apache.hadoop.fs.FileContext;
|
|
@@ -88,7 +88,8 @@ import com.google.common.annotations.VisibleForTesting;
|
|
|
|
|
|
public class ContainerLaunch implements Callable<Integer> {
|
|
public class ContainerLaunch implements Callable<Integer> {
|
|
|
|
|
|
- private static final Log LOG = LogFactory.getLog(ContainerLaunch.class);
|
|
|
|
|
|
+ private static final Logger LOG =
|
|
|
|
+ LoggerFactory.getLogger(ContainerLaunch.class);
|
|
|
|
|
|
public static final String CONTAINER_SCRIPT =
|
|
public static final String CONTAINER_SCRIPT =
|
|
Shell.appendScriptExtension("launch_container");
|
|
Shell.appendScriptExtension("launch_container");
|
|
@@ -276,7 +277,8 @@ public class ContainerLaunch implements Callable<Integer> {
|
|
creds.writeTokenStorageToStream(tokensOutStream);
|
|
creds.writeTokenStorageToStream(tokensOutStream);
|
|
// /////////// End of writing out container-tokens
|
|
// /////////// End of writing out container-tokens
|
|
} finally {
|
|
} finally {
|
|
- IOUtils.cleanup(LOG, containerScriptOutStream, tokensOutStream);
|
|
|
|
|
|
+ IOUtils.cleanupWithLogger(LOG, containerScriptOutStream,
|
|
|
|
+ tokensOutStream);
|
|
}
|
|
}
|
|
|
|
|
|
ret = launchContainer(new ContainerStartContext.Builder()
|
|
ret = launchContainer(new ContainerStartContext.Builder()
|
|
@@ -494,7 +496,7 @@ public class ContainerLaunch implements Callable<Integer> {
|
|
@SuppressWarnings("unchecked")
|
|
@SuppressWarnings("unchecked")
|
|
protected void handleContainerExitWithFailure(ContainerId containerID,
|
|
protected void handleContainerExitWithFailure(ContainerId containerID,
|
|
int ret, Path containerLogDir, StringBuilder diagnosticInfo) {
|
|
int ret, Path containerLogDir, StringBuilder diagnosticInfo) {
|
|
- LOG.warn(diagnosticInfo);
|
|
|
|
|
|
+ LOG.warn(diagnosticInfo.toString());
|
|
|
|
|
|
String errorFileNamePattern =
|
|
String errorFileNamePattern =
|
|
conf.get(YarnConfiguration.NM_CONTAINER_STDERR_PATTERN,
|
|
conf.get(YarnConfiguration.NM_CONTAINER_STDERR_PATTERN,
|
|
@@ -545,7 +547,7 @@ public class ContainerLaunch implements Callable<Integer> {
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
LOG.error("Failed to get tail of the container's error log file", e);
|
|
LOG.error("Failed to get tail of the container's error log file", e);
|
|
} finally {
|
|
} finally {
|
|
- IOUtils.cleanup(LOG, errorFileIS);
|
|
|
|
|
|
+ IOUtils.cleanupWithLogger(LOG, errorFileIS);
|
|
}
|
|
}
|
|
|
|
|
|
this.dispatcher.getEventHandler()
|
|
this.dispatcher.getEventHandler()
|