Class NfsWriteRequest
java.lang.Object
com.emc.ecs.nfsclient.rpc.RpcRequest
com.emc.ecs.nfsclient.nfs.NfsRequestBase
com.emc.ecs.nfsclient.nfs.NfsWriteRequest
- All Implemented Interfaces:
NfsRequest
- Direct Known Subclasses:
Nfs3WriteRequest
The request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).
Procedure WRITE writes data to a file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe server must commit all of the data to stable storage and enough of the metadata to retrieve the data before returning.static final intThe server must commit the data written plus all file system metadata to stable storage before returning results.static final intThe server is free to commit any part of the data and the metadata to stable storage, including all or none, before returning a reply to the client.Fields inherited from class RpcRequest
CHARSET -
Constructor Summary
ConstructorsConstructorDescriptionNfsWriteRequest(byte[] fileHandle, long offset, List<ByteBuffer> payload, int syncType, Credential credential, int nfsVersion) Creates the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813). -
Method Summary
Modifier and TypeMethodDescriptionintgetSize()Returns the number of bytes of data to be written (calculated from thepayload).booleanisSync()Returnstrueif data is syncedfalseif it is not.voidmarshalling(Xdr xdr) Writes the RPC call header and authentication credentials to the XDR buffer.toString()Methods inherited from class NfsRequestBase
getErrorMessage, getFileHandle, getIpKey, startToStringMethods inherited from class RpcRequest
cloneFileHandle, isUsePrivilegedPort, setUsePrivilegedPort, trimFileName
-
Field Details
-
UNSTABLE
public static final int UNSTABLEThe server is free to commit any part of the data and the metadata to stable storage, including all or none, before returning a reply to the client.- See Also:
-
DATA_SYNC
public static final int DATA_SYNCThe server must commit all of the data to stable storage and enough of the metadata to retrieve the data before returning.- See Also:
-
FILE_SYNC
public static final int FILE_SYNCThe server must commit the data written plus all file system metadata to stable storage before returning results.- See Also:
-
-
Constructor Details
-
NfsWriteRequest
public NfsWriteRequest(byte[] fileHandle, long offset, List<ByteBuffer> payload, int syncType, Credential credential, int nfsVersion) throws FileNotFoundException Creates the request, as specified by RFC 1813 (https://tools.ietf.org/html/rfc1813).Procedure WRITE writes data to a file.
- Parameters:
fileHandle- The file handle for the file to which data is to be written. This must identify a file system object of type, NF3REG.offset- The position within the file at which the write is to begin. An offset of 0 means to write data starting at the beginning of the file.payload- The data to be written to the file.syncType- One of the values below.- UNSTABLE = 0 - Best effort, no promises.
- DATA_SYNC = 1 - Commit all data to stable storage, plus enough metadata for retrieval, before returning.
- FILE_SYNC = 2 - Commit all data and metadata to stable storage before returning.
credential- The credential used for RPC authentication.nfsVersion- The NFS version number- Throws:
FileNotFoundException
-
-
Method Details
-
marshalling
Writes the RPC call header and authentication credentials to the XDR buffer.- Specified by:
marshallingin interfaceNfsRequest- Overrides:
marshallingin classNfsRequestBase- Parameters:
xdr- the Xdr to be sent.
-
toString
-
getSize
public int getSize()Returns the number of bytes of data to be written (calculated from thepayload). Ifsizeis 0, the WRITE will succeed and return acountof 0, barring errors due to permissions checking. Thesizeof data must be less than or equal to the value of thewtmaxfield in the FSINFO reply structure for the file system that contains file. If greater, the server may write onlywtmaxbytes, resulting in a short write. -
isSync
public boolean isSync()Returnstrueif data is syncedfalseif it is not.
-