Search in sources :

Example 36 with FileHandle

use of org.apache.hadoop.nfs.nfs3.FileHandle in project hadoop by apache.

the class WRITE3Request method deserialize.

public static WRITE3Request deserialize(XDR xdr) throws IOException {
    FileHandle handle = readHandle(xdr);
    long offset = xdr.readHyper();
    int count = xdr.readInt();
    WriteStableHow stableHow = WriteStableHow.fromValue(xdr.readInt());
    ByteBuffer data = ByteBuffer.wrap(xdr.readFixedOpaque(xdr.readInt()));
    return new WRITE3Request(handle, offset, count, stableHow, data);
}
Also used : FileHandle(org.apache.hadoop.nfs.nfs3.FileHandle) WriteStableHow(org.apache.hadoop.nfs.nfs3.Nfs3Constant.WriteStableHow) ByteBuffer(java.nio.ByteBuffer)

Example 37 with FileHandle

use of org.apache.hadoop.nfs.nfs3.FileHandle in project hadoop by apache.

the class CREATE3Request method deserialize.

public static CREATE3Request deserialize(XDR xdr) throws IOException {
    FileHandle handle = readHandle(xdr);
    String name = xdr.readString();
    int mode = xdr.readInt();
    SetAttr3 objAttr = new SetAttr3();
    long verf = 0;
    if ((mode == Nfs3Constant.CREATE_UNCHECKED) || (mode == Nfs3Constant.CREATE_GUARDED)) {
        objAttr.deserialize(xdr);
    } else if (mode == Nfs3Constant.CREATE_EXCLUSIVE) {
        verf = xdr.readHyper();
    } else {
        throw new IOException("Wrong create mode:" + mode);
    }
    return new CREATE3Request(handle, name, mode, objAttr, verf);
}
Also used : FileHandle(org.apache.hadoop.nfs.nfs3.FileHandle) IOException(java.io.IOException)

Example 38 with FileHandle

use of org.apache.hadoop.nfs.nfs3.FileHandle in project hadoop by apache.

the class LINK3Request method deserialize.

public static LINK3Request deserialize(XDR xdr) throws IOException {
    FileHandle handle = readHandle(xdr);
    FileHandle fromDirHandle = readHandle(xdr);
    String fromName = xdr.readString();
    return new LINK3Request(handle, fromDirHandle, fromName);
}
Also used : FileHandle(org.apache.hadoop.nfs.nfs3.FileHandle)

Example 39 with FileHandle

use of org.apache.hadoop.nfs.nfs3.FileHandle in project hadoop by apache.

the class LOOKUP3Request method deserialize.

public static LOOKUP3Request deserialize(XDR xdr) throws IOException {
    FileHandle handle = readHandle(xdr);
    String name = xdr.readString();
    return new LOOKUP3Request(handle, name);
}
Also used : FileHandle(org.apache.hadoop.nfs.nfs3.FileHandle)

Example 40 with FileHandle

use of org.apache.hadoop.nfs.nfs3.FileHandle in project hadoop by apache.

the class MKDIR3Request method deserialize.

public static MKDIR3Request deserialize(XDR xdr) throws IOException {
    FileHandle handle = readHandle(xdr);
    String name = xdr.readString();
    SetAttr3 objAttr = new SetAttr3();
    objAttr.deserialize(xdr);
    return new MKDIR3Request(handle, name, objAttr);
}
Also used : FileHandle(org.apache.hadoop.nfs.nfs3.FileHandle)

Aggregations

FileHandle (org.apache.hadoop.nfs.nfs3.FileHandle)79 HdfsFileStatus (org.apache.hadoop.hdfs.protocol.HdfsFileStatus)34 XDR (org.apache.hadoop.oncrpc.XDR)34 Nfs3FileAttributes (org.apache.hadoop.nfs.nfs3.Nfs3FileAttributes)31 Test (org.junit.Test)31 InetSocketAddress (java.net.InetSocketAddress)28 DFSClient (org.apache.hadoop.hdfs.DFSClient)26 IOException (java.io.IOException)24 VisibleForTesting (com.google.common.annotations.VisibleForTesting)19 WccData (org.apache.hadoop.nfs.nfs3.response.WccData)12 SetAttr3 (org.apache.hadoop.nfs.nfs3.request.SetAttr3)11 WRITE3Request (org.apache.hadoop.nfs.nfs3.request.WRITE3Request)8 NfsConfiguration (org.apache.hadoop.hdfs.nfs.conf.NfsConfiguration)7 HdfsDataOutputStream (org.apache.hadoop.hdfs.client.HdfsDataOutputStream)6 CREATE3Request (org.apache.hadoop.nfs.nfs3.request.CREATE3Request)6 READ3Request (org.apache.hadoop.nfs.nfs3.request.READ3Request)5 CREATE3Response (org.apache.hadoop.nfs.nfs3.response.CREATE3Response)5 READ3Response (org.apache.hadoop.nfs.nfs3.response.READ3Response)5 WRITE3Response (org.apache.hadoop.nfs.nfs3.response.WRITE3Response)5 VerifierNone (org.apache.hadoop.oncrpc.security.VerifierNone)5