[ 
https://issues.apache.org/jira/browse/HDFS-9282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972179#comment-14972179
 ] 

Lei (Eddy) Xu commented on HDFS-9282:
-------------------------------------

Thanks a lot for the patch, [~twu]

* Could you fix the whitespace warning, which is related.

{code}
   /**
     * Get the default number of data directories for underlying storage per
     * DataNode. Used by MiniDFSCluster to initialize cluster.
{code}

We can remove {{Used by MniDFSCluster...}}.

* {{FsDatasetTestUtils#getNumOfDataDirs()}} should also be named as 
{{getDefaultNumOfDataDirs()}} to make it consistent with the Factory.

* Lets write the following code in separated lines. 
{code}
public int getNumOfDataDirs() { return this.defaultNumOfDataDirs; }
{code}

* {{public static final int defaultNumOfDataDirs = 2;}} should be 
{{DEFAULT_NUM_OF_DATA_DIRS}}, and could you add some comments for it?

* The {{FsVolumeReferences}} from the following code should be closed to 
release reference counts after usage.
{code}
DF df = new DF(new File(
        dataset.getFsVolumeReferences().get(0).getBasePath()),
        dataset.datanode.getConf());
{code}

Also for {{assert (dataset.getFsVolumeReferences().size() != 0);}}. Btw, can we 
use {{Preconditions.checkState}} to do the checks here?

> Make data directory count and storage raw capacity related tests 
> FsDataset-agnostic
> -----------------------------------------------------------------------------------
>
>                 Key: HDFS-9282
>                 URL: https://issues.apache.org/jira/browse/HDFS-9282
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: HDFS, test
>    Affects Versions: 2.7.1
>            Reporter: Tony Wu
>            Assignee: Tony Wu
>            Priority: Minor
>         Attachments: HDFS-9282.001.patch
>
>
> DFSMiniCluster and several tests have hard coded assumption of the underlying 
> storage having 2 data directories (volumes). As HDFS-9188 pointed out, with 
> new FsDataset implementations, these hard coded assumption about number of 
> data directories and raw capacities of storage may change as well.
> We need to extend FsDatasetTestUtils to provide:
> * Number of data directories of underlying storage per DataNode
> * Raw storage capacity of underlying storage per DataNode.
> * Have MiniDFSCluster automatically pick up the correct values.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to