org.apache.hadoop.hdfs.nfs.nfs3
Class Nfs3Utils

java.lang.Object
  extended by org.apache.hadoop.hdfs.nfs.nfs3.Nfs3Utils

public class Nfs3Utils
extends Object

Utility/helper methods related to NFS


Field Summary
static String INODEID_PATH_PREFIX
           
static String READ_RPC_END
           
static String READ_RPC_START
           
static String WRITE_RPC_END
           
static String WRITE_RPC_START
           
 
Constructor Summary
Nfs3Utils()
           
 
Method Summary
static long bytesToLong(byte[] data)
           
static org.apache.hadoop.nfs.nfs3.response.WccData createWccData(org.apache.hadoop.nfs.nfs3.response.WccAttr preOpAttr, org.apache.hadoop.hdfs.DFSClient dfsClient, String fileIdPath, org.apache.hadoop.nfs.nfs3.IdUserGroup iug)
           
static int getAccessRights(int mode, int type)
           
static int getAccessRightsForUserGroup(int uid, int gid, org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr)
           
static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes getFileAttr(org.apache.hadoop.hdfs.DFSClient client, String fileIdPath, org.apache.hadoop.nfs.nfs3.IdUserGroup iug)
           
static String getFileIdPath(org.apache.hadoop.nfs.nfs3.FileHandle handle)
           
static String getFileIdPath(long fileId)
           
static org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileStatus(org.apache.hadoop.hdfs.DFSClient client, String fileIdPath)
           
static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes getNfs3FileAttrFromFileStatus(org.apache.hadoop.hdfs.protocol.HdfsFileStatus fs, org.apache.hadoop.nfs.nfs3.IdUserGroup iug)
           
static org.apache.hadoop.nfs.nfs3.response.WccAttr getWccAttr(org.apache.hadoop.hdfs.DFSClient client, String fileIdPath)
           
static org.apache.hadoop.nfs.nfs3.response.WccAttr getWccAttr(org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr)
           
static byte[] longToByte(long v)
           
static void writeChannel(org.jboss.netty.channel.Channel channel, org.apache.hadoop.oncrpc.XDR out, int xid)
          Send a write response to the netty network socket channel
static void writeChannelCommit(org.jboss.netty.channel.Channel channel, org.apache.hadoop.oncrpc.XDR out, int xid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INODEID_PATH_PREFIX

public static final String INODEID_PATH_PREFIX
See Also:
Constant Field Values

READ_RPC_START

public static final String READ_RPC_START
See Also:
Constant Field Values

READ_RPC_END

public static final String READ_RPC_END
See Also:
Constant Field Values

WRITE_RPC_START

public static final String WRITE_RPC_START
See Also:
Constant Field Values

WRITE_RPC_END

public static final String WRITE_RPC_END
See Also:
Constant Field Values
Constructor Detail

Nfs3Utils

public Nfs3Utils()
Method Detail

getFileIdPath

public static String getFileIdPath(org.apache.hadoop.nfs.nfs3.FileHandle handle)

getFileIdPath

public static String getFileIdPath(long fileId)

getFileStatus

public static org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileStatus(org.apache.hadoop.hdfs.DFSClient client,
                                                                           String fileIdPath)
                                                                    throws IOException
Throws:
IOException

getNfs3FileAttrFromFileStatus

public static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes getNfs3FileAttrFromFileStatus(org.apache.hadoop.hdfs.protocol.HdfsFileStatus fs,
                                                                                          org.apache.hadoop.nfs.nfs3.IdUserGroup iug)

getFileAttr

public static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes getFileAttr(org.apache.hadoop.hdfs.DFSClient client,
                                                                        String fileIdPath,
                                                                        org.apache.hadoop.nfs.nfs3.IdUserGroup iug)
                                                                 throws IOException
Throws:
IOException

getWccAttr

public static org.apache.hadoop.nfs.nfs3.response.WccAttr getWccAttr(org.apache.hadoop.hdfs.DFSClient client,
                                                                     String fileIdPath)
                                                              throws IOException
Throws:
IOException

getWccAttr

public static org.apache.hadoop.nfs.nfs3.response.WccAttr getWccAttr(org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr)

createWccData

public static org.apache.hadoop.nfs.nfs3.response.WccData createWccData(org.apache.hadoop.nfs.nfs3.response.WccAttr preOpAttr,
                                                                        org.apache.hadoop.hdfs.DFSClient dfsClient,
                                                                        String fileIdPath,
                                                                        org.apache.hadoop.nfs.nfs3.IdUserGroup iug)
                                                                 throws IOException
Throws:
IOException

writeChannel

public static void writeChannel(org.jboss.netty.channel.Channel channel,
                                org.apache.hadoop.oncrpc.XDR out,
                                int xid)
Send a write response to the netty network socket channel


writeChannelCommit

public static void writeChannelCommit(org.jboss.netty.channel.Channel channel,
                                      org.apache.hadoop.oncrpc.XDR out,
                                      int xid)

getAccessRights

public static int getAccessRights(int mode,
                                  int type)

getAccessRightsForUserGroup

public static int getAccessRightsForUserGroup(int uid,
                                              int gid,
                                              org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr)

bytesToLong

public static long bytesToLong(byte[] data)

longToByte

public static byte[] longToByte(long v)


Copyright © 2014 Apache Software Foundation. All Rights Reserved.