[ https://issues.apache.org/jira/browse/HDFS-11417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15974372#comment-15974372 ]
Vinayakumar B commented on HDFS-11417: -------------------------------------- bq. This type casting can fail if the existing implementation in FsDatasetImpl.java has been changed More errors could come if another implementation is completely different and have different params than expected as below {code}+ for (Entry<String, Object> volume : volumeInfoMap.entrySet()) { + @SuppressWarnings("unchecked") + Map<String, Object> volumeInfo = (Map<String, Object>) volume.getValue(); + DatanodeVolumeInfo dnStorageInfo = new DatanodeVolumeInfo( + volume.getKey(), (Long) volumeInfo.get("usedSpace"), + (Long) volumeInfo.get("freeSpace"), + (Long) volumeInfo.get("reservedSpace"), + (Long) volumeInfo.get("reservedSpaceForReplicas"), + (Long) volumeInfo.get("numBlocks"), + (StorageType) volumeInfo.get("storageType")); + volumeInfoList.add(dnStorageInfo); + }{code} I feel current API signature is better, as {{getVolumeInfoMap()}} implementation could be completely different for different implementation. IMO, In current Jira, it would be sufficient to handle existing implementations (FSDataSetImpl, ExternalDatasetImpl (which returns null, so null check could be added)). If anything more required, could be handled in follow-up Jiras. > Add datanode admin command to get the storage info. > --------------------------------------------------- > > Key: HDFS-11417 > URL: https://issues.apache.org/jira/browse/HDFS-11417 > Project: Hadoop HDFS > Issue Type: New Feature > Affects Versions: 2.7.3 > Reporter: Surendra Singh Lilhore > Assignee: Surendra Singh Lilhore > Attachments: HDFS-11417.001.patch, HDFS-11417.002.patch, > HDFS-11417.003.patch, HDFS-11417.004.patch, HDFS-11417.005.patch > > > It is good to add one admin command for datanode to get the data directory > info like storage type, directory path, number of block, capacity, used > space. This will be help full in large cluster where DN has multiple data > directory configured. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org