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

Jing Zhao commented on HDFS-5067:
---------------------------------

The patch looks good to me. Some minor comments:
1. Changes in OpenFileCtx and WriteManager focus on LOG level. We can do it 
separately or after HDFS-4971.
2. In Nfs3FileAttributes's constructor,
{code}
//isDir ? NfsFileType.NFSDIR.toValue() : NfsFileType.NFSREG.toValue();
{code}
can be removed.
3. 
{code}
String fileIdPath = Nfs3Utils.getFileIdPath(handle);
HdfsFileStatus fstat = dfsClient.getFileLinkInfo(fileIdPath);
if (fstat == null) {
  LOG.info("Can't get path for fileId:" + handle.getFileId());
  return new READLINK3Response(Nfs3Status.NFS3ERR_STALE);
}
{code}
This part actually has been covered by 
{code}
Nfs3FileAttributes postOpAttr = Nfs3Utils.getFileAttr(dfsClient,
    Nfs3Utils.getFileIdPath(handle), iug);
{code}

We only need to check if the result is null for the later, and handle the 
FileNotFoundException for the "dfsClient.getLinkTarget(fileIdPath)" call. In 
this way, we may save one RPC call here.

4. It would be helpful if we can add some simple javadoc for SYMLINK3Request.

5. 
{code}
assert (MAX_READ_TRANSFER_SIZE >= target.getBytes().length);
{code}
Here we may want to return an error response?

                
> Support symlink operations
> --------------------------
>
>                 Key: HDFS-5067
>                 URL: https://issues.apache.org/jira/browse/HDFS-5067
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: nfs
>    Affects Versions: 3.0.0
>            Reporter: Brandon Li
>            Assignee: Brandon Li
>         Attachments: HDFS-5067.3.patch, HDFS-5067.patch
>
>
> Given the symlink issues(e.g., HDFS-4765) are getting fixed. NFS can support 
> the symlinke related requests, which includes NFSv3 calls SYMLINK and 
> READLINK.
> With symlink support, NFS client can create symlinks with the target inside 
> HDFS, and also can create symlinks inside HDFS with the target inside or 
> outside HDFS namespace. 

--
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

Reply via email to