You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Harsh J (JIRA)" <ji...@apache.org> on 2012/09/23 19:13:08 UTC
[jira] [Commented] (HADOOP-8437) getLocalPathForWrite is not
throwing any expection for invalid paths
[ https://issues.apache.org/jira/browse/HADOOP-8437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461455#comment-13461455 ]
Harsh J commented on HADOOP-8437:
---------------------------------
Hi Brahma,
Couple of comments:
{code}
+ if (0 == dirs.size()) {
{code}
I feel this check can happen slightly more earlier as the hunk itself seems to suggest that dirs is being utilized before we come to this new check.
{code}
+ throw new IOException("No dirs to select.Total dirs size is 0");
{code}
Please space the two sentences (general rule: Always a space after a punctuation mark, never before.)
{code}
+ for (int i = 0; i < 256; i++) {
+ invalidPath.append("A");
+ }
{code}
Seems excessive to do this. Just declare a constant string? :-)
{code}
fail("not throwing the exception");
{code}
Lets describe failure strings better since it is a specific test we're carrying out/expecting a failure from: "An exception should have been thrown when an invalid directory is used."
Thanks!
> getLocalPathForWrite is not throwing any expection for invalid paths
> --------------------------------------------------------------------
>
> Key: HADOOP-8437
> URL: https://issues.apache.org/jira/browse/HADOOP-8437
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 2.0.0-alpha
> Reporter: Brahma Reddy Battula
> Assignee: Brahma Reddy Battula
> Attachments: HADOOP-8437.patch
>
>
> call dirAllocator.getLocalPathForWrite ( "/InvalidPath", conf );
> Here it will not thrown any exception but earlier version it used throw.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira