26.216. Class ResultLifeCycleHelper

Namespace: ArmoniK.Core.Common.Storage
Assembly: ArmoniK.Core.Common.dll

Helper to manage Results

public static class ResultLifeCycleHelper

26.216.1. Inheritance

objectResultLifeCycleHelper

26.216.2. Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

26.216.3. Methods

26.216.3.1. DeleteResultAsync(IResultTable, IObjectStorage, string, CancellationToken)

Delete the result

public static Task DeleteResultAsync(IResultTable resultTable, IObjectStorage objectStorage, string resultId, CancellationToken cancellationToken)

26.216.3.1.1. Parameters

resultTable IResultTable

Interface to manage result states

objectStorage IObjectStorage

Interface to manage objects

resultId string

ID of the result to delete

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.216.3.1.2. Returns

Task

26.216.3.2. PurgeResultsAsync(IResultTable, IObjectStorage, string, CancellationToken)

Delete all results for a given session

public static Task PurgeResultsAsync(IResultTable resultTable, IObjectStorage objectStorage, string sessionId, CancellationToken cancellationToken)

26.216.3.2.1. Parameters

resultTable IResultTable

Interface to manage result states

objectStorage IObjectStorage

Interface to manage objects

sessionId string

ID of the session to purge

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.216.3.2.2. Returns

Task

Task representing the asynchronous execution of the method

26.216.3.2.3. Remarks

This method will delete all results that are in the Completed, Created or Aborted state and their deletion is managed by ArmoniK. It will also delete the associated objects in the object storage.

26.216.3.3. TerminateTasksAndResults(ITaskTable, IResultTable, ICollection<string>?, ICollection<string>?, string?, TaskStatus, bool, CancellationToken)

Terminate all tasks and results that depend directly or indirectly of the specified tasks. Tasks are set to an error status (or deleted if requested), and their results are marked as aborted.

public static Task TerminateTasksAndResults(ITaskTable taskTable, IResultTable resultTable, ICollection<string>? taskIds = null, ICollection<string>? resultIds = null, string? reason = null, TaskStatus status = TaskStatus.Error, bool shouldDeleteTasks = false, CancellationToken cancellationToken = default)

26.216.3.3.1. Parameters

taskTable ITaskTable

Interface to manage task states

resultTable IResultTable

Interface to manage result states

taskIds ICollection<string>?

Root tasks that must be terminated

resultIds ICollection<string>?

Root results that must be terminated

reason string?

Termination message

status TaskStatus

Put terminated tasks into the given status

shouldDeleteTasks bool

Should delete tasks from database

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.216.3.3.2. Returns

Task

Task representing the asynchronous execution of the method