YARN-6372. Add default value for NM disk validator (Contributed by Yufei Gu via Daniel Templeton)

This commit is contained in:
Daniel Templeton 2017-04-10 14:55:22 -07:00
parent a5e57df3c5
commit e9ac61cc0e
4 changed files with 8 additions and 4 deletions

View File

@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ha.ActiveStandbyElector;
import org.apache.hadoop.http.HttpConfig;
import org.apache.hadoop.net.NetUtils;
import org.apache.hadoop.util.BasicDiskValidator;
import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.yarn.api.ApplicationConstants;
@ -974,7 +975,7 @@ public class YarnConfiguration extends Configuration {
/** Disk Validator. */
public static final String DISK_VALIDATOR = NM_PREFIX + "disk-validator";
public static final String DEFAULT_DISK_VALIDATOR = "basic";
public static final String DEFAULT_DISK_VALIDATOR = BasicDiskValidator.NAME;
/**
* Maximum size of contain's diagnostics to keep for relaunching container

View File

@ -181,7 +181,8 @@ public class DirectoryCollection {
conf = new YarnConfiguration();
try {
diskValidator = DiskValidatorFactory.getInstance(
conf.get(YarnConfiguration.DISK_VALIDATOR));
conf.get(YarnConfiguration.DISK_VALIDATOR,
YarnConfiguration.DEFAULT_DISK_VALIDATOR));
LOG.info("Disk Validator: " + YarnConfiguration.DISK_VALIDATOR +
" is loaded.");
} catch (Exception e) {

View File

@ -127,7 +127,8 @@ public class ContainerLocalizer {
this.recordFactory = recordFactory;
this.conf = new YarnConfiguration();
this.diskValidator = DiskValidatorFactory.getInstance(
conf.get(YarnConfiguration.DISK_VALIDATOR));
conf.get(YarnConfiguration.DISK_VALIDATOR,
YarnConfiguration.DEFAULT_DISK_VALIDATOR));
LOG.info("Disk Validator: " + YarnConfiguration.DISK_VALIDATOR +
" is loaded.");
this.appCacheDirContextName = String.format(APPCACHE_CTXT_FMT, appId);

View File

@ -261,7 +261,8 @@ public class ResourceLocalizationService extends CompositeService
}
diskValidator = DiskValidatorFactory.getInstance(
conf.get(YarnConfiguration.DISK_VALIDATOR));
conf.get(YarnConfiguration.DISK_VALIDATOR,
YarnConfiguration.DEFAULT_DISK_VALIDATOR));
LOG.info("Disk Validator: " + YarnConfiguration.DISK_VALIDATOR +
" is loaded.");
cacheTargetSize =