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 "Alejandro Abdelnur (JIRA)" <ji...@apache.org> on 2008/10/15 08:41:44 UTC
[jira] Created: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
class names in Configuration are not resolved if the configuration value has a white space
-------------------------------------------------------------------------------------------
Key: HADOOP-4416
URL: https://issues.apache.org/jira/browse/HADOOP-4416
Project: Hadoop Core
Issue Type: Bug
Environment: all
Reporter: Alejandro Abdelnur
Fix For: 0.19.0
If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
For example:
{code}
<property>
<name>mapred.mapper.class</name>
<value>
com.foo.MyMapper
</value>
</property>
{code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Enis Soztutar updated HADOOP-4416:
----------------------------------
Fix Version/s: (was: 0.19.0)
Moving from 0.19 due to feature freeze.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642415#action_12642415 ]
Abhijit Bagri commented on HADOOP-4416:
---------------------------------------
If there is a consensus on HADOOP-4212, IMO that should be the way to do it. I am not sure the discussion there are going in that direction though.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri updated HADOOP-4416:
----------------------------------
Attachment: HADOOP-4416-v4.patch.txt
Thanks for the reviews. Incorporated all the suggestions.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Fix For: 0.20.0
>
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416-v4.patch.txt, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (HADOOP-4416) class names in
Configuration are not resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642420#action_12642420 ]
abagri edited comment on HADOOP-4416 at 10/24/08 2:05 AM:
-----------------------------------------------------------------
As per discussion on HADOOP-4212, I think a compatible changes list should apply for the following functions. Individual function trims will be needed
getInt()
getLong()
getFloat()
getBoolean()
getRange()
getClasses()
getClass()
I am not sure about getString() and getStringCollection(), Comments?
was (Author: abagri):
As per discussion on HADOOP-4212, I think a compatible changes list should apply for the following functions. Individual function trims will be needed
getInt()
getLong()
getHexDigits()
getFloat()
getBoolean()
getRange()
getClasses()
getClass()
I am not sure about getString() and getStringCollection(), Comments?
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Alejandro Abdelnur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639744#action_12639744 ]
Alejandro Abdelnur commented on HADOOP-4416:
--------------------------------------------
The {{Configuration.getClassByName()}} method should do a {{name.trim()}}
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Fix For: 0.19.0
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri updated HADOOP-4416:
----------------------------------
Attachment: HADOOP-4416.patch
Patch for this. Also added a test case for getClass() and getClasses()
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri updated HADOOP-4416:
----------------------------------
Attachment: HADOOP-4416-v2.patch
Here is patch which takes care of whitespace for following functions:
getInt
getLong
getFloat
getBoolean - also made the comparison case sensitive here.
getClass
getClasses
I realized that IntegerRange already does a trim for each value in the comma separated list. Modified a test case to account for that. Added test cases for others too.
Comments?
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642477#action_12642477 ]
Steve Loughran commented on HADOOP-4416:
----------------------------------------
Patch looks good. Reviewing the trim() method, I think it could be made simpler by explicitly returning null for a null argument
{code}
protected String trim(String source) {
return source==null ? null : source.trim();
}
{code}
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Alejandro Abdelnur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639817#action_12639817 ]
Alejandro Abdelnur commented on HADOOP-4416:
--------------------------------------------
This is not really an instance of HADOOP-4212. Personally I would agree that for configuration values you can safely trim them, but I can see people opposing to it.
For class names it is different, you don't want the spaces.
And it should be done in the {{getClassByName()}} method to properly handle the {{getClasses()}} method, this is important for values like:
{code}
<property>
<name>io.compression.codecs</name>
<value>org.apache.hadoop.io.compress.DefaultCodec,org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.BZip2Codec</value>
</property>
{code}
Where if you have several classes you may want to have an enter between commas for readability.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Fix For: 0.19.0
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri updated HADOOP-4416:
----------------------------------
Attachment: HADOOP-4416-v4.patch
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Fix For: 0.20.0
>
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416-v4.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri updated HADOOP-4416:
----------------------------------
Attachment: HADOOP-4416-v3.patch
Thanks, Steve for reviewing the patch. I updated the patch with your comments.
Making trim() protected makes sense.
Strictly speaking, doing toLowerCase does break semantics. I would say that if you have a conf.getBoolean("something-TRUE", false), it is more likely a bug. I am leaving this out of the scope of this jira. I will file a separate issue on that.
Added test cases for default handling.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Alejandro Abdelnur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alejandro Abdelnur updated HADOOP-4416:
---------------------------------------
Fix Version/s: 0.20.0
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Fix For: 0.20.0
>
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri reassigned HADOOP-4416:
-------------------------------------
Assignee: Abhijit Bagri
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Sreekanth Ramakrishnan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642403#action_12642403 ]
Sreekanth Ramakrishnan commented on HADOOP-4416:
------------------------------------------------
Sorry, for commenting this late. I think this issue is not just related to class names. It is present with all values which are being read. I think we should deal with this generically instead of fixing part by part. I had filed a JIRA related to this issue, you can also take a look at the discussion which has happened at that place. [HADOOP-4212|https://issues.apache.org/jira/browse/HADOOP-4212]
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639907#action_12639907 ]
Tsz Wo (Nicholas), SZE commented on HADOOP-4416:
------------------------------------------------
+1 for trimming in getClassByName() but this is not for 0.19.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Fix For: 0.19.0
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639795#action_12639795 ]
Steve Loughran commented on HADOOP-4416:
----------------------------------------
This is an instance of HADOOP-4212; a .trim() does seem appropriate here, assuming that HADOOP-4212 is going to remain open or wontfix.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Fix For: 0.19.0
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Nigel Daley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639869#action_12639869 ]
Nigel Daley commented on HADOOP-4416:
-------------------------------------
If this isn't a regression, then this isn't for 0.19.0.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Fix For: 0.19.0
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642436#action_12642436 ]
Steve Loughran commented on HADOOP-4416:
----------------------------------------
Looking at the patch,
1. You need tests of the default handling. The get operations are all calling .trim() before checking for the result being null; as a result they will probably NPE rather than return defaults
e.g, what happens on conf.getLong("undefined-key",23);
public long getLong(String name, long defaultValue) {
- String valueString = get(name);
+ String valueString = get(name).trim();
if (valueString == null)
return defaultValue;
2. I'd recommend the trim operation is made a (protected?) method in Configuration
protected String trim(String source) {
return source==null?source:source.trim();
}
One place to keep the logic, one test for null handling might suffice
3. the {{.toLowerCase()}} operation for getBoolean should be made locale neutral, by adding a locale parameter:
{{toLowerCase(Locale.EN_US)}}
4. Also, getBoolean shouldn't do any toLowerCase() operations on null values.
5. The changes to getBoolean() change the semantics of the operation. Currently
bool b=conf.getBoolean("something",false"); returns false if "something" is set to "TRUE" in the file. With the case change, it will evaluate to true. I don't know if this matters, but it isn't completely backwards compatible.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HADOOP-4416) class names in Configuration are not
resolved if the configuration value has a white space
Posted by "Abhijit Bagri (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Abhijit Bagri updated HADOOP-4416:
----------------------------------
Attachment: (was: HADOOP-4416-v4.patch.txt)
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Fix For: 0.20.0
>
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416-v4.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-4416) class names in Configuration are
not resolved if the configuration value has a white space
Posted by "Alejandro Abdelnur (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-4416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12642589#action_12642589 ]
Alejandro Abdelnur commented on HADOOP-4416:
--------------------------------------------
Looks good, adding to Steve's changes:
{code}
private String trim(String source) {
return (source==null) ? null : source.trim();
}
{code}
Also, remove the {import java.util.Locale} for {Configuration}.
> class names in Configuration are not resolved if the configuration value has a white space
> -------------------------------------------------------------------------------------------
>
> Key: HADOOP-4416
> URL: https://issues.apache.org/jira/browse/HADOOP-4416
> Project: Hadoop Core
> Issue Type: Bug
> Environment: all
> Reporter: Alejandro Abdelnur
> Assignee: Abhijit Bagri
> Attachments: HADOOP-4416-v2.patch, HADOOP-4416-v3.patch, HADOOP-4416.patch
>
>
> If an entry in the configuration used for a class contains spaces or enters before or after the {{getClass}} and {{getClasses}} methods fail to resolve the class.
> For example:
> {code}
> <property>
> <name>mapred.mapper.class</name>
> <value>
> com.foo.MyMapper
> </value>
> </property>
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.