Core.AppendAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Append data to file. This is an asynchronous operation.
Not threadsafe when AppendAsync is called for same path from different threads.
public static System.Threading.Tasks.Task AppendAsync (string path, string leaseId, string sessionId, Microsoft.Azure.DataLake.Store.SyncFlag flag, long offsetFile, byte[] dataBytes, int offset, int length, Microsoft.Azure.DataLake.Store.AdlsClient client, Microsoft.Azure.DataLake.Store.RequestOptions req, Microsoft.Azure.DataLake.Store.OperationResponse resp, System.Threading.CancellationToken cancelToken = default);
static member AppendAsync : string * string * string * Microsoft.Azure.DataLake.Store.SyncFlag * int64 * byte[] * int * int * Microsoft.Azure.DataLake.Store.AdlsClient * Microsoft.Azure.DataLake.Store.RequestOptions * Microsoft.Azure.DataLake.Store.OperationResponse * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function AppendAsync (path As String, leaseId As String, sessionId As String, flag As SyncFlag, offsetFile As Long, dataBytes As Byte(), offset As Integer, length As Integer, client As AdlsClient, req As RequestOptions, resp As OperationResponse, Optional cancelToken As CancellationToken = Nothing) As Task
Parameters
- path
- String
Path of the file
- leaseId
- String
String containing the lease ID, when a client obtains a lease on a file no other client can make edits to the file
- sessionId
- String
UUID that is used to obtain the file handler (stream) easily at server
- flag
- SyncFlag
Pass SyncFlag.DATA when writing bytes of data Pass SyncFlag.METADATA when metadata of the file like length, modified instant needs to be updated to be consistent with the actual data of file. After passing SyncFlag.METADATA GetFileStatus and ListStatus returns consistent data. Pass SyncFlag.CLOSE when no more data needs to be appended, file metadata is updated, lease is released and the stream is closed
- offsetFile
- Int64
Offset in the file at which data will be appended
- dataBytes
- Byte[]
Array of bytes to write to the file
- offset
- Int32
Offset in the byte array
- length
- Int32
Number of bytes to write from the offset
- client
- AdlsClient
ADLS Client
- req
- RequestOptions
Options to change behavior of the Http request
- resp
- OperationResponse
Stores the response/ouput of the Http request
- cancelToken
- CancellationToken
CancellationToken to cancel the request
Returns
Applies to
Azure SDK for .NET