public class Nfs3Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Nfs3Utils() |
| Modifier and Type | Method and Description |
|---|---|
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.security.IdMappingServiceProvider iug) |
static int |
getAccessRights(int mode,
int type) |
static int |
getAccessRightsForUserGroup(int uid,
int gid,
int[] auxGids,
org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr) |
static long |
getDirSize(int childNum)
HDFS directory size is always zero.
|
static long |
getElapsedTime(long startTimeNano) |
static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes |
getFileAttr(org.apache.hadoop.hdfs.DFSClient client,
String fileIdPath,
org.apache.hadoop.security.IdMappingServiceProvider 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 int |
getNamenodeId(org.apache.hadoop.conf.Configuration conf) |
static int |
getNamenodeId(org.apache.hadoop.conf.Configuration conf,
URI namenodeURI) |
static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes |
getNfs3FileAttrFromFileStatus(org.apache.hadoop.hdfs.protocol.HdfsFileStatus fs,
org.apache.hadoop.security.IdMappingServiceProvider iug) |
static URI |
getResolvedURI(org.apache.hadoop.fs.FileSystem fs,
String exportPath) |
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) |
public static final String INODEID_PATH_PREFIX
public static final String READ_RPC_START
public static final String READ_RPC_END
public static final String WRITE_RPC_START
public static final String WRITE_RPC_END
public static String getFileIdPath(org.apache.hadoop.nfs.nfs3.FileHandle handle)
public static String getFileIdPath(long fileId)
public static org.apache.hadoop.hdfs.protocol.HdfsFileStatus getFileStatus(org.apache.hadoop.hdfs.DFSClient client,
String fileIdPath)
throws IOException
IOExceptionpublic static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes getNfs3FileAttrFromFileStatus(org.apache.hadoop.hdfs.protocol.HdfsFileStatus fs,
org.apache.hadoop.security.IdMappingServiceProvider iug)
public static org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes getFileAttr(org.apache.hadoop.hdfs.DFSClient client,
String fileIdPath,
org.apache.hadoop.security.IdMappingServiceProvider iug)
throws IOException
IOExceptionpublic static long getDirSize(int childNum)
childNum - number of children of the directorypublic static org.apache.hadoop.nfs.nfs3.response.WccAttr getWccAttr(org.apache.hadoop.hdfs.DFSClient client,
String fileIdPath)
throws IOException
IOExceptionpublic static org.apache.hadoop.nfs.nfs3.response.WccAttr getWccAttr(org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr)
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.security.IdMappingServiceProvider iug)
throws IOException
IOExceptionpublic static void writeChannel(org.jboss.netty.channel.Channel channel,
org.apache.hadoop.oncrpc.XDR out,
int xid)
channel - channel to which the buffer needs to be writtenout - xdr object to be written to the channelxid - transaction identifierpublic static void writeChannelCommit(org.jboss.netty.channel.Channel channel,
org.apache.hadoop.oncrpc.XDR out,
int xid)
public static int getAccessRights(int mode,
int type)
public static int getAccessRightsForUserGroup(int uid,
int gid,
int[] auxGids,
org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes attr)
public static long bytesToLong(byte[] data)
public static byte[] longToByte(long v)
public static long getElapsedTime(long startTimeNano)
public static int getNamenodeId(org.apache.hadoop.conf.Configuration conf)
public static int getNamenodeId(org.apache.hadoop.conf.Configuration conf,
URI namenodeURI)
public static URI getResolvedURI(org.apache.hadoop.fs.FileSystem fs, String exportPath) throws IOException
IOExceptionCopyright © 2008–2020 Apache Software Foundation. All rights reserved.