Skip to content

YARN-11415: Proof --> DO NOT COMMIT YET #5454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.hadoop.conf;

import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.test.GenericTestUtils;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
Expand All @@ -38,6 +39,7 @@

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
Expand Down Expand Up @@ -191,14 +193,15 @@ public abstract class TestConfigurationFieldsBase {
if (fields == null)
return null;

HashMap<String,String> retVal = new HashMap<>();
HashMap<String, String> retVal = new HashMap<>();

// Setup regexp for valid properties
String propRegex = "^[A-Za-z][A-Za-z0-9_-]+(\\.[A-Za-z%s0-9_-]+)+$";
Pattern p = Pattern.compile(propRegex);

// Iterate through class member variables
String value;
Set<String> fieldsNotPassedRegex = new HashSet<>();
for (Field f : fields) {
LOG_CONFIG.debug("Field: {}", f);
// Filter out anything that isn't "public static final"
Expand Down Expand Up @@ -251,13 +254,14 @@ public abstract class TestConfigurationFieldsBase {
Matcher m = p.matcher(value);
if (!m.find()) {
LOG_CONFIG.debug(" Passes Regex: false");
fieldsNotPassedRegex.add(f.getName());
continue;
}
LOG_CONFIG.debug(" Passes Regex: true");

// Save member variable/value as hash
if (!retVal.containsKey(value)) {
retVal.put(value,f.getName());
retVal.put(value, f.getName());
} else {
LOG_CONFIG.debug("ERROR: Already found key for property " + value);
}
Expand Down Expand Up @@ -414,6 +418,7 @@ private static Set<String> compareConfigurationToXmlFields(
*/
@Before
public void setupTestConfigurationFields() throws Exception {
GenericTestUtils.setLogLevel(LOG_CONFIG, Level.DEBUG);
initializeMemberVariables();

// Error if subclass hasn't set class members
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ private static void addDeprecatedKeys() {
/////////////////////////////
// Resource types configs
////////////////////////////

public static final String MISSING_PROP_IN_YARN_DEF = "yarn.missingprop.in.yarndefault";

public static final String RESOURCE_TYPES =
YarnConfiguration.YARN_PREFIX + "resource-types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2477,6 +2477,12 @@
<value></value>
</property>

<!-- <property>-->
<!-- <description>dummy doc</description>-->
<!-- <name>yarn.nodemanager.missingpropinclass</name>-->
<!-- <value></value>-->
<!-- </property>-->

<property>
<description>No. of ms to wait between sending a SIGTERM and SIGKILL to a container</description>
<name>yarn.nodemanager.sleep-delay-before-sigkill.ms</name>
Expand Down