Share via


TaskOutputStorage.SaveTrackedAsync Method

Definition

Overloads

SaveTrackedAsync(String)

Saves the specified file to persistent storage as a TaskLog, and tracks subsequent appends to the file and appends them to the persistent copy too.

SaveTrackedAsync(TaskOutputKind, String, String, TimeSpan)

Saves the specified file to persistent storage, and tracks subsequent appends to the file and appends them to the persistent copy too.

SaveTrackedAsync(String)

Source:
TaskOutputStorage.cs

Saves the specified file to persistent storage as a TaskLog, and tracks subsequent appends to the file and appends them to the persistent copy too.

public System.Threading.Tasks.Task<Microsoft.Azure.Batch.Conventions.Files.ITrackedSaveOperation> SaveTrackedAsync (string relativePath);
member this.SaveTrackedAsync : string -> System.Threading.Tasks.Task<Microsoft.Azure.Batch.Conventions.Files.ITrackedSaveOperation>
Public Function SaveTrackedAsync (relativePath As String) As Task(Of ITrackedSaveOperation)

Parameters

relativePath
String

The path of the file to save, relative to the current directory. If the file is in a subdirectory of the current directory, the relative path will be preserved in blob storage.

Returns

An ITrackedSaveOperation which will save a file to blob storage and will periodically flush file appends to the blob until disposed. When disposed, all remaining appends are flushed to blob storage, and further tracking of file appends is stopped.

Exceptions

The relativePath argument is null.

The relativePath argument is an absolute path, or is empty.

Remarks

Tracking supports only appends. That is, while a file is being tracked, any data added at the end is appended to the persistent storage. Changes to data that has already been uploaded will not be reflected to the persistent store. This method is therefore intended for use only with files such as (non-rotating) log files where data is only added at the end of the file. If the entire contents of a file can change, use SaveAsync(TaskOutputKind, String, CancellationToken) and call it periodically or after each change.

If the file is outside the current directory, traversals up the directory tree are removed. For example, a relativePath of "..\ProcessEnv.cmd" would be treated as "ProcessEnv.cmd" for the purposes of creating a blob name.

Applies to

SaveTrackedAsync(TaskOutputKind, String, String, TimeSpan)

Source:
TaskOutputStorage.cs

Saves the specified file to persistent storage, and tracks subsequent appends to the file and appends them to the persistent copy too.

public System.Threading.Tasks.Task<Microsoft.Azure.Batch.Conventions.Files.ITrackedSaveOperation> SaveTrackedAsync (Microsoft.Azure.Batch.Conventions.Files.TaskOutputKind kind, string sourcePath, string destinationRelativePath, TimeSpan flushInterval);
member this.SaveTrackedAsync : Microsoft.Azure.Batch.Conventions.Files.TaskOutputKind * string * string * TimeSpan -> System.Threading.Tasks.Task<Microsoft.Azure.Batch.Conventions.Files.ITrackedSaveOperation>
Public Function SaveTrackedAsync (kind As TaskOutputKind, sourcePath As String, destinationRelativePath As String, flushInterval As TimeSpan) As Task(Of ITrackedSaveOperation)

Parameters

kind
TaskOutputKind

A TaskOutputKind representing the category under which to store this file, for example TaskOutput or TaskLog.

sourcePath
String

The path of the file to save.

destinationRelativePath
String

The blob name under which to save the file. This may include a relative component, such as "pointclouds/pointcloud_0001.txt".

flushInterval
TimeSpan

The interval at which to flush appends to persistent storage.

Returns

An ITrackedSaveOperation which will save a file to blob storage and will periodically flush file appends to the blob until disposed. When disposed, all remaining appends are flushed to blob storage, and further tracking of file appends is stopped.

Exceptions

The kind, sourcePath, or destinationRelativePath argument is null.

The sourcePath or destinationRelativePath argument is empty.

Remarks

Tracking supports only appends. That is, while a file is being tracked, any data added at the end is appended to the persistent storage. Changes to data that has already been uploaded will not be reflected to the persistent store. This method is therefore intended for use only with files such as (non-rotating) log files where data is only added at the end of the file. If the entire contents of a file can change, use SaveAsync(TaskOutputKind, String, String, CancellationToken) and call it periodically or after each change.

Applies to