|
@@ -47,8 +47,6 @@ import org.apache.commons.cli.GnuParser;
|
|
import org.apache.commons.cli.HelpFormatter;
|
|
import org.apache.commons.cli.HelpFormatter;
|
|
import org.apache.commons.cli.Options;
|
|
import org.apache.commons.cli.Options;
|
|
import org.apache.commons.cli.ParseException;
|
|
import org.apache.commons.cli.ParseException;
|
|
-import org.apache.commons.logging.Log;
|
|
|
|
-import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
import org.apache.hadoop.classification.InterfaceAudience.Private;
|
|
import org.apache.hadoop.classification.InterfaceAudience.Private;
|
|
import org.apache.hadoop.classification.InterfaceStability;
|
|
import org.apache.hadoop.classification.InterfaceStability;
|
|
@@ -113,6 +111,8 @@ import org.apache.log4j.LogManager;
|
|
|
|
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
import com.sun.jersey.api.client.ClientHandlerException;
|
|
import com.sun.jersey.api.client.ClientHandlerException;
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
|
|
/**
|
|
/**
|
|
* An ApplicationMaster for executing shell commands on a set of launched
|
|
* An ApplicationMaster for executing shell commands on a set of launched
|
|
@@ -179,7 +179,8 @@ import com.sun.jersey.api.client.ClientHandlerException;
|
|
@InterfaceStability.Unstable
|
|
@InterfaceStability.Unstable
|
|
public class ApplicationMaster {
|
|
public class ApplicationMaster {
|
|
|
|
|
|
- private static final Log LOG = LogFactory.getLog(ApplicationMaster.class);
|
|
|
|
|
|
+ private static final Logger LOG = LoggerFactory
|
|
|
|
+ .getLogger(ApplicationMaster.class);
|
|
|
|
|
|
@VisibleForTesting
|
|
@VisibleForTesting
|
|
@Private
|
|
@Private
|
|
@@ -349,7 +350,7 @@ public class ApplicationMaster {
|
|
appMaster.run();
|
|
appMaster.run();
|
|
result = appMaster.finish();
|
|
result = appMaster.finish();
|
|
} catch (Throwable t) {
|
|
} catch (Throwable t) {
|
|
- LOG.fatal("Error running ApplicationMaster", t);
|
|
|
|
|
|
+ LOG.error("Error running ApplicationMaster", t);
|
|
LogManager.shutdown();
|
|
LogManager.shutdown();
|
|
ExitUtil.terminate(1, t);
|
|
ExitUtil.terminate(1, t);
|
|
}
|
|
}
|
|
@@ -388,7 +389,7 @@ public class ApplicationMaster {
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} finally {
|
|
} finally {
|
|
- IOUtils.cleanup(LOG, buf);
|
|
|
|
|
|
+ IOUtils.cleanupWithLogger(LOG, buf);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -630,7 +631,7 @@ public class ApplicationMaster {
|
|
LOG.info("Executing with tokens:");
|
|
LOG.info("Executing with tokens:");
|
|
while (iter.hasNext()) {
|
|
while (iter.hasNext()) {
|
|
Token<?> token = iter.next();
|
|
Token<?> token = iter.next();
|
|
- LOG.info(token);
|
|
|
|
|
|
+ LOG.info(token.toString());
|
|
if (token.getKind().equals(AMRMTokenIdentifier.KIND_NAME)) {
|
|
if (token.getKind().equals(AMRMTokenIdentifier.KIND_NAME)) {
|
|
iter.remove();
|
|
iter.remove();
|
|
}
|
|
}
|