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 "Craig Macdonald (JIRA)" <ji...@apache.org> on 2008/09/26 03:35:44 UTC

[jira] Issue Comment Edited: (HADOOP-2366) Space in the value for dfs.data.dir can cause great problems

    [ https://issues.apache.org/jira/browse/HADOOP-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634728#action_12634728 ] 

craigm edited comment on HADOOP-2366 at 9/25/08 6:33 PM:
------------------------------------------------------------------

Why stop on trim left? 
IMHO you should assume that the whitespace is part of the delimitation, not of the pathname.

I'm not sure where the split happens to look at the code, but I suggest:
{code}
String parts[] = value.split("\\s*,\\s*");
{code}

And/Or pathnames with space could be placed in quotes which are trimmed off, however, double quote is also an acceptable file/diretory name on GNU/Linux.

      was (Author: craigm):
    Why stop on trim left? 
IMHO you should assume that the whitespace is part of the delimitation, not of the pathname.

I'm not sure where the split happens to look at the code, but I suggest:
String parts[] = value.split("\\s*,\\s*");

And/Or pathnames with space could be placed in quotes which are trimmed off, however, double quote is also an acceptable file/diretory name on GNU/Linux.
  
> Space in the value for dfs.data.dir can cause great problems
> ------------------------------------------------------------
>
>                 Key: HADOOP-2366
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2366
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.13.1
>            Reporter: Ted Dunning
>
> The following configuration causes problems:
> <property>
>   <name>dfs.data.dir</name>
>   <value>/mnt/hstore2/hdfs, /home/foo/dfs</value>  
>   <description>
>   Determines where on the local filesystem an DFS data node  should store its bl
> ocks.  If this is a comma-delimited  list of directories, then data will be stor
> ed in all named  directories, typically on different devices.  Directories that 
> do not exist are ignored.  
>   </description>
> </property>
> The problem is that the space after the comma causes the second directory for storage to be " /home/foo/dfs" which is in a directory named <SPACE> which contains a sub-dir named "home" in the hadoop datanodes default directory.  This will typically cause the user's home partition to fill, but will be very hard for the user to understand since a directory with a whitespace name is hard to understand.
> My proposed solution would be to trimLeft all path names from this and similar property after splitting on comma.  This still allows spaces in file and directory names but avoids this problem. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.