YARN-1672. YarnConfiguration is missing a default for yarn.nodemanager.log.retain-seconds (Naren Koneru via kasha)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1565867 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Karthik Kambatla 2014-02-08 01:56:10 +00:00
parent 67dc421f84
commit 49389403d6
4 changed files with 8 additions and 2 deletions

View File

@ -198,6 +198,9 @@ Release 2.4.0 - UNRELEASED
YARN-1661. Fixed DS ApplicationMaster to write the correct exit log. (Vinod YARN-1661. Fixed DS ApplicationMaster to write the correct exit log. (Vinod
Kumar Vavilapalli via zjshen) Kumar Vavilapalli via zjshen)
YARN-1672. YarnConfiguration is missing a default for
yarn.nodemanager.log.retain-seconds (Naren Koneru via kasha)
Release 2.3.0 - UNRELEASED Release 2.3.0 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -629,6 +629,7 @@ public class YarnConfiguration extends Configuration {
*/ */
public static final String NM_LOG_RETAIN_SECONDS = NM_PREFIX public static final String NM_LOG_RETAIN_SECONDS = NM_PREFIX
+ "log.retain-seconds"; + "log.retain-seconds";
public static final long DEFAULT_NM_LOG_RETAIN_SECONDS = 3 * 60 * 60;
/** /**
* Number of threads used in log cleanup. Only applicable if Log aggregation * Number of threads used in log cleanup. Only applicable if Log aggregation

View File

@ -73,7 +73,8 @@ public class NonAggregatingLogHandler extends AbstractService implements
protected void serviceInit(Configuration conf) throws Exception { protected void serviceInit(Configuration conf) throws Exception {
// Default 3 hours. // Default 3 hours.
this.deleteDelaySeconds = this.deleteDelaySeconds =
conf.getLong(YarnConfiguration.NM_LOG_RETAIN_SECONDS, 3 * 60 * 60); conf.getLong(YarnConfiguration.NM_LOG_RETAIN_SECONDS,
YarnConfiguration.DEFAULT_NM_LOG_RETAIN_SECONDS);
sched = createScheduledThreadPoolExecutor(conf); sched = createScheduledThreadPoolExecutor(conf);
super.serviceInit(conf); super.serviceInit(conf);
} }

View File

@ -145,7 +145,8 @@ public class TestNonAggregatingLogHandler {
conf.set(YarnConfiguration.NM_LOG_DIRS, localLogDirsString); conf.set(YarnConfiguration.NM_LOG_DIRS, localLogDirsString);
conf.setBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, false); conf.setBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, false);
conf.setLong(YarnConfiguration.NM_LOG_RETAIN_SECONDS, 10800l); conf.setLong(YarnConfiguration.NM_LOG_RETAIN_SECONDS,
YarnConfiguration.DEFAULT_NM_LOG_RETAIN_SECONDS);
DrainDispatcher dispatcher = createDispatcher(conf); DrainDispatcher dispatcher = createDispatcher(conf);
EventHandler<ApplicationEvent> appEventHandler = mock(EventHandler.class); EventHandler<ApplicationEvent> appEventHandler = mock(EventHandler.class);