26.218. Class ResultTableExtensions

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

Provides extension methods for to manage and update the lifecycle and metadata of results in storage. Includes utilities for aborting, completing, updating, retrieving, and marking results, as well as managing dependencies and statuses.

public static class ResultTableExtensions

26.218.1. Inheritance

objectResultTableExtensions

26.218.2. Inherited Members

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

26.218.3. Methods

26.218.3.1. AbortSessionResults(IResultTable, string, CancellationToken)

Abort the results of the given session

public static Task AbortSessionResults(this IResultTable resultTable, string sessionId, CancellationToken cancellationToken = default)

26.218.3.1.1. Parameters

resultTable IResultTable

Interface to manage results

sessionId string

id of the session containing the results

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.1.2. Returns

Task

Task representing the asynchronous execution of the method

26.218.3.2. AbortTaskResults(IResultTable, string, string, CancellationToken)

Abort the results of the given task

public static Task AbortTaskResults(this IResultTable resultTable, string sessionId, string ownerTaskId, CancellationToken cancellationToken = default)

26.218.3.2.1. Parameters

resultTable IResultTable

Interface to manage results

sessionId string

id of the session containing the results

ownerTaskId string

id of the task from which abort the results

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.2.2. Returns

Task

Task representing the asynchronous execution of the method

26.218.3.3. BulkUpdateResults(IResultTable, IEnumerable<(string resultId, UpdateDefinition<Result> updates)>, CancellationToken)

Updates in bulk results

public static Task<long> BulkUpdateResults(this IResultTable resultTable, IEnumerable<(string resultId, UpdateDefinition<Result> updates)> bulkUpdates, CancellationToken cancellationToken)

26.218.3.3.1. Parameters

resultTable IResultTable

Interface to manage result lifecycle

bulkUpdates IEnumerable<(string resultId, UpdateDefinition<Result> updates)>

Enumeration of updates with the resultId they apply on

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.3.2. Returns

Task<long>

The number of result matched

26.218.3.4. CompleteManyResults(IResultTable, ICollection<(string resultId, long size, byte[] opaqueId)>, string, CancellationToken)

Complete many results in the database

public static Task<DateTime?> CompleteManyResults(this IResultTable resultTable, ICollection<(string resultId, long size, byte[] opaqueId)> results, string completedBy, CancellationToken cancellationToken = default)

26.218.3.4.1. Parameters

resultTable IResultTable

Interface to manage results

results ICollection<(string resultId, long size, byte[] opaqueId)>

Collection of results to complete, each with its id, size, and opaque identifier

completedBy string

Identifier of the task that completed the results

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.4.2. Returns

Task<DateTime?>

The completion’s date

26.218.3.4.3. Exceptions

ResultNotFoundException

when result to update is not found

26.218.3.5. CompleteResult(IResultTable, string, string, long, byte[], CancellationToken)

Complete result

public static Task<Result> CompleteResult(this IResultTable resultTable, string sessionId, string resultId, long size, byte[] opaqueId, CancellationToken cancellationToken = default)

26.218.3.5.1. Parameters

resultTable IResultTable

Interface to manage results

sessionId string

id of the session containing the results

resultId string

Id of the result to complete

size long

Size of the result to complete

opaqueId byte[]

Opaque unique identifier representing the object

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.5.2. Returns

Task<Result>

The new version of the result metadata

26.218.3.5.3. Exceptions

ResultNotFoundException

when result to update is not found

26.218.3.6. GetDependents(IResultTable, string, string, CancellationToken)

Get the list of task that depends on the result

public static Task<IEnumerable<string>> GetDependents(this IResultTable resultTable, string sessionId, string resultId, CancellationToken cancellationToken = default)

26.218.3.6.1. Parameters

resultTable IResultTable

Interface to manage results

sessionId string

Id of the session containing the result

resultId string

Id of the result

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.6.2. Returns

Task<IEnumerable<string>>

Ids of the task dependent on this result

26.218.3.7. GetResultStatus(IResultTable, IEnumerable<string>, string, CancellationToken)

Get the status of the given results

public static Task<IEnumerable<ResultIdStatus>> GetResultStatus(this IResultTable resultTable, IEnumerable<string> ids, string sessionId, CancellationToken cancellationToken = default)

26.218.3.7.1. Parameters

resultTable IResultTable

Interface to manage results

ids IEnumerable<string>

ids of the results

sessionId string

id of the session containing the results

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.7.2. Returns

Task<IEnumerable<ResultIdStatus>>

A map between the ids of the results found and their status

26.218.3.8. GetResults(IResultTable, string, IEnumerable<string>, CancellationToken)

Get the results from a collection of ids

public static IAsyncEnumerable<Result> GetResults(this IResultTable resultTable, string sessionId, IEnumerable<string> keys, CancellationToken cancellationToken = default)

26.218.3.8.1. Parameters

resultTable IResultTable

Interface to manage results

sessionId string

id of the session containing the result

keys IEnumerable<string>

Collection of id of the result to be retrieved

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.8.2. Returns

IAsyncEnumerable<Result>

Collection of results metadata from the database

26.218.3.9. MarkAsDeleted(IResultTable, string, CancellationToken)

Set the result status to

public static Task MarkAsDeleted(this IResultTable resultTable, string resultId, CancellationToken cancellationToken = default)

26.218.3.9.1. Parameters

resultTable IResultTable

Interface to manage results

resultId string

Id of the result to update

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.9.2. Returns

Task

Task representing the asynchronous execution of the method

26.218.3.10. SetResult(IResultTable, string, string, string, long, byte[], CancellationToken)

Update result

public static Task SetResult(this IResultTable resultTable, string sessionId, string ownerTaskId, string resultId, long size, byte[] opaqueId, CancellationToken cancellationToken = default)

26.218.3.10.1. Parameters

resultTable IResultTable

Interface to manage results

sessionId string

id of the session containing the results

ownerTaskId string

id of the task owning the result

resultId string

id of the result to be modified

size long

Size of the result to be modified

opaqueId byte[]

Opaque unique identifier representing the object containing the actual data

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.218.3.10.2. Returns

Task

Task representing the asynchronous execution of the method