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

Todd Lipcon commented on HDFS-2941:
-----------------------------------

Looks pretty good. A few more small comments:
- I'd rather see the HADOOP_FSIMAGE_HEADER header be added in all cases -- not 
just when it's the latest -- just for consistency.
- Given that, I think the code in TransferFsImage will make a little more 
sense. Right now, the "localPaths" variable is either a file (when not getting 
latest) or a directory (when getting latest) which seems inconsistent. If you 
send the header in all cases, then the code can change to something like:
{code}
String fsImageName = connection.getHeaderField(HADOOP_FSIMAGE_HEADER);
// If the local paths refer to directories, use the server-provided header
// as the filename within that directory
List<File> newLocalPaths = new ArrayList<File>();
for (File localPath : localPaths) {
  if (localPath.isDirectory()) {
    if (fsImageName == null) {
      throw new IOException("No filename header provided by server");
    }
    newLocalPaths.add(new File(localPath, fsImageName));
  } else {
    newLocalPaths.add(localPath);
  }
}
localPaths = newLocalPaths;
{code}

                
> Add an administrative command to download a copy of the fsimage from the NN
> ---------------------------------------------------------------------------
>
>                 Key: HDFS-2941
>                 URL: https://issues.apache.org/jira/browse/HDFS-2941
>             Project: Hadoop HDFS
>          Issue Type: New Feature
>          Components: hdfs client, name-node
>    Affects Versions: 0.24.0
>            Reporter: Aaron T. Myers
>            Assignee: Aaron T. Myers
>         Attachments: HDFS-2941.patch, HDFS-2941.patch
>
>
> It would be nice to be able to download a copy of the fsimage from the NN, 
> e.g. for backup purposes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to