26.27. Class ResultTable

Namespace: ArmoniK.Core.Adapters.Memory
Assembly: ArmoniK.Core.Adapters.Memory.dll

public class ResultTable : IResultTable, IInitializable, IHealthCheckProvider

26.27.1. Inheritance

objectResultTable

26.27.2. Implements

IResultTable, IInitializable, IHealthCheckProvider

26.27.3. Inherited Members

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

26.27.4. Extension Methods

ResultTableExtensions.AbortSessionResults(IResultTable, string, CancellationToken), ResultTableExtensions.AbortTaskResults(IResultTable, string, string, CancellationToken), ResultTableExtensions.BulkUpdateResults(IResultTable, IEnumerable<(string resultId, UpdateDefinition<Result> updates)>, CancellationToken), ResultTableExtensions.CompleteManyResults(IResultTable, ICollection<(string resultId, long size, byte[] opaqueId)>, string, CancellationToken), ResultTableExtensions.CompleteResult(IResultTable, string, string, long, byte[], CancellationToken), ResultTableExtensions.GetDependents(IResultTable, string, string, CancellationToken), ResultTableExtensions.GetResultStatus(IResultTable, IEnumerable<string>, string, CancellationToken), ResultTableExtensions.GetResults(IResultTable, string, IEnumerable<string>, CancellationToken), ResultTableExtensions.MarkAsDeleted(IResultTable, string, CancellationToken), ResultTableExtensions.SetResult(IResultTable, string, string, string, long, byte[], CancellationToken)

26.27.5. Properties

26.27.5.1. Logger

Logger used to produce logs for this class

public ILogger Logger { get; }

26.27.5.1.1. Property Value

ILogger

26.27.6. Methods

26.27.6.1. AddTaskDependencies(IDictionary<string, ICollection<string>>, CancellationToken)

Add the tasks Ids to the list of reverse dependencies of the given results

public Task AddTaskDependencies(IDictionary<string, ICollection<string>> dependencies, CancellationToken cancellationToken = default)

26.27.6.1.1. Parameters

dependencies IDictionary<string, ICollection<string>>

Dictionary of the dependant tasks for each result

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.1.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.2. ChangeResultOwnership(string, IEnumerable<ChangeResultOwnershipRequest>, CancellationToken)

Change ownership (in batch) of the results in the given request

public Task ChangeResultOwnership(string oldTaskId, IEnumerable<IResultTable.ChangeResultOwnershipRequest> requests, CancellationToken cancellationToken)

26.27.6.2.1. Parameters

oldTaskId string

Task Id of the previous owner

requests IEnumerable<IResultTable.ChangeResultOwnershipRequest>

Change ownership requests that will be executed

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.2.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.3. Check(HealthCheckTag)

Checks the status of a class for the given health check type.

public Task<HealthCheckResult> Check(HealthCheckTag tag)

26.27.6.3.1. Parameters

tag HealthCheckTag

Health check for which the class has to answer.

26.27.6.3.2. Returns

Task<HealthCheckResult>

The result of the check containing the status of the class for the health check type.

26.27.6.4. Create(ICollection<Result>, CancellationToken)

Inserts the given results in the database

public Task Create(ICollection<Result> results, CancellationToken cancellationToken = default)

26.27.6.4.1. Parameters

results ICollection<Result>

Results that will be inserted into the database

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.4.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.5. DeleteResult(string, CancellationToken)

Delete the results from the database

public Task DeleteResult(string key, CancellationToken cancellationToken = default)

26.27.6.5.1. Parameters

key string

id of the result to be deleted

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.5.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.6. DeleteResults(string, CancellationToken)

Delete all the results from a session

public Task DeleteResults(string sessionId, CancellationToken cancellationToken = default)

26.27.6.6.1. Parameters

sessionId string

id of the session containing the result

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.6.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.7. DeleteResults(ICollection<string>, CancellationToken)

Delete all the results from a collection

public Task DeleteResults(ICollection<string> results, CancellationToken cancellationToken = default)

26.27.6.7.1. Parameters

results ICollection<string>

ids of the results to be deleted

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.7.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.8. GetResults<T>(Expression<Func<Result, bool>>, Expression<Func<Result, T>>, CancellationToken)

Get the results from a filter and convert it in the given type

public IAsyncEnumerable<T> GetResults<T>(Expression<Func<Result, bool>> filter, Expression<Func<Result, T>> convertor, CancellationToken cancellationToken = default)

26.27.6.8.1. Parameters

filter Expression<Func<Result, bool>>

Filter to select results

convertor Expression<Func<Result, T>>

Expression to convert result into another type

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.8.2. Returns

IAsyncEnumerable<T>

Collection of results metadata from the database

26.27.6.8.3. Type Parameters

T

26.27.6.9. Init(CancellationToken)

Executes an initialization process for the class

public Task Init(CancellationToken cancellationToken)

26.27.6.9.1. Parameters

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.9.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.10. ListResultsAsync(Expression<Func<Result, bool>>, Expression<Func<Result, object?>>, bool, int, int, CancellationToken)

List all results matching the given request

public Task<(IEnumerable<Result> results, int totalCount)> ListResultsAsync(Expression<Func<Result, bool>> filter, Expression<Func<Result, object?>> orderField, bool ascOrder, int page, int pageSize, CancellationToken cancellationToken = default)

26.27.6.10.1. Parameters

filter Expression<Func<Result, bool>>

Filter to select results

orderField Expression<Func<Result, object?>>

Select the field that will be used to order the results

ascOrder bool

Is the order ascending

page int

The page of results to retrieve

pageSize int

The number of results pages

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.10.2. Returns

Task<(IEnumerable<Result> results, int totalCount)>

Collection of results metadata that matched the filter and total number of results without paging

26.27.6.10.3. Remarks

If pageSize is 0, this function can be used to count the number of results satisfying the condition specified by filter

26.27.6.11. SetTaskOwnership(ICollection<(string resultId, string taskId)>, CancellationToken)

Set Task that should produce the result

public Task SetTaskOwnership(ICollection<(string resultId, string taskId)> requests, CancellationToken cancellationToken = default)

26.27.6.11.1. Parameters

requests ICollection<(string resultId, string taskId)>

Results to update with the associated task id

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.11.2. Returns

Task

Task representing the asynchronous execution of the method

26.27.6.12. UpdateManyResults(Expression<Func<Result, bool>>, UpdateDefinition<Result>, CancellationToken)

Update the results matching the filter with the given new values

public Task<long> UpdateManyResults(Expression<Func<Result, bool>> filter, UpdateDefinition<Result> updates, CancellationToken cancellationToken = default)

26.27.6.12.1. Parameters

filter Expression<Func<Result, bool>>

Filter to select the results to update

updates UpdateDefinition<Result>

Collection of fields to update and their new value

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.12.2. Returns

Task<long>

The number of results matched

26.27.6.13. UpdateOneResult(string, UpdateDefinition<Result>, CancellationToken)

Update one result with the given new values

public Task<Result> UpdateOneResult(string resultId, UpdateDefinition<Result> updates, CancellationToken cancellationToken = default)

26.27.6.13.1. Parameters

resultId string

Id of the result to be updated

updates UpdateDefinition<Result>

Collection of fields to update and their new value

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.27.6.13.2. Returns

Task<Result>

The result metadata before the update