Core.AppendAsync(String, String, String, SyncFlag, Int64, Byte[], Int32, Int32, AdlsClient, RequestOptions, OperationResponse, CancellationToken) Method

Definition

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
System.String

Path of the file

leaseId
System.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
System.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
System.Int64

Offset in the file at which data will be appended

dataBytes
System.Byte[]

Array of bytes to write to the file

offset
System.Int32

Offset in the byte array

length
System.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
System.Threading.CancellationToken

CancellationToken to cancel the request

Returns

System.Threading.Tasks.Task

Applies to