You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Tianyin Xu (JIRA)" <ji...@apache.org> on 2016/11/01 05:11:58 UTC
[jira] [Created] (HADOOP-13777) Trim configuration values in
`rumen`
Tianyin Xu created HADOOP-13777:
-----------------------------------
Summary: Trim configuration values in `rumen`
Key: HADOOP-13777
URL: https://issues.apache.org/jira/browse/HADOOP-13777
Project: Hadoop Common
Issue Type: Bug
Components: tools
Affects Versions: 3.0.0-alpha1
Reporter: Tianyin Xu
Priority: Minor
The current implementation of {{ClassName.java}} in {{rumen}} does not follow the practice of trimming configuration values. This leads to silent and hard-to-diagnosis errors if users set values containing space or newline---basically classes supposed to need anonymization will not do.
See the previous commits as reference (just list a few):
HADOOP-6578. Configuration should trim whitespace around a lot of value types
HADOOP-6534. Trim whitespace from directory lists initializing
Patch is available against trunk
HDFS-9708. FSNamesystem.initAuditLoggers() doesn't trim classnames
HDFS-2799. Trim fs.checkpoint.dir values.
YARN-3395. FairScheduler: Trim whitespaces when using username for queuename.
YARN-2869. CapacityScheduler should trim sub queue names when parse configuration.
Patch is available against trunk (tested):
{code:title=ClassName.java|borderStyle=solid}
@@ -43,15 +43,13 @@ protected String getPrefix() {
@Override
protected boolean needsAnonymization(Configuration conf) {
- String[] preserves = conf.getStrings(CLASSNAME_PRESERVE_CONFIG);
- if (preserves != null) {
- // do a simple starts with check
- for (String p : preserves) {
- if (className.startsWith(p)) {
- return false;
- }
+ String[] preserves = conf.getTrimmedStrings(CLASSNAME_PRESERVE_CONFIG);
+ // do a simple starts with check
+ for (String p : preserves) {
+ if (className.startsWith(p)) {
+ return false;
}
}
return true;
}
{code}
(the NULL check is no longer needed because {{getTrimmedStrings}} returns an empty array if nothing is set)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org