17.197. Interface IPartitionTable
Namespace: ArmoniK.Core.Common.Storage
Assembly: ArmoniK.Core.Common.dll
Interface to manage partitions and their life cycle in the data base
public interface IPartitionTable : IInitializable, IHealthCheckProvider
17.197.1. Implements
IInitializable, IHealthCheckProvider
17.197.2. Methods
17.197.2.1. ArePartitionsExistingAsync(IEnumerable<string>, CancellationToken)
Check the availability of the given partitions in the data base
Task<bool> ArePartitionsExistingAsync(IEnumerable<string> partitionIds, CancellationToken cancellationToken = default)
17.197.2.1.1. Parameters
partitionIds IEnumerable<string>
Collection of partition ids
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.197.2.1.2. Returns
A bool representing whether all the partitions are available
17.197.2.2. CreatePartitionsAsync(IEnumerable<PartitionData>, CancellationToken)
Inserts a collection of partitions in the data base
Task CreatePartitionsAsync(IEnumerable<PartitionData> partitions, CancellationToken cancellationToken = default)
17.197.2.2.1. Parameters
partitions IEnumerable<PartitionData>
Collection of partitions to be inserted
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.197.2.2.2. Returns
Task representing the asynchronous execution of the method
17.197.2.3. DeletePartitionAsync(string, CancellationToken)
Remove a partition from the data base given its id
Task DeletePartitionAsync(string partitionId, CancellationToken cancellationToken = default)
17.197.2.3.1. Parameters
partitionId string
Id of the partition to be deleted
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.197.2.3.2. Returns
Task representing the asynchronous execution of the method
17.197.2.3.3. Exceptions
required partition is not found
17.197.2.4. FindPartitionsAsync<T>(Expression<Func<PartitionData, bool>>, Expression<Func<PartitionData, T>>, CancellationToken)
Find all partitions matching the given filter
IAsyncEnumerable<T> FindPartitionsAsync<T>(Expression<Func<PartitionData, bool>> filter, Expression<Func<PartitionData, T>> selector, CancellationToken cancellationToken = default)
17.197.2.4.1. Parameters
filter Expression<Func<PartitionData, bool>>
Filter to select partitions
selector Expression<Func<PartitionData, T>>
Expression to select part of the returned partition
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.197.2.4.2. Returns
List of partitions that match the filter
17.197.2.4.3. Type Parameters
T
17.197.2.5. GetPartitionWithAllocationAsync(CancellationToken)
Gets partitions that are pod allocated to it (PodMax > 0)
IAsyncEnumerable<PartitionData> GetPartitionWithAllocationAsync(CancellationToken cancellationToken = default)
17.197.2.5.1. Parameters
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.197.2.5.2. Returns
IAsyncEnumerable<PartitionData>
Collection of partitions respecting the request
17.197.2.6. ListPartitionsAsync(Expression<Func<PartitionData, bool>>, Expression<Func<PartitionData, object?>>, bool, int, int, CancellationToken)
List all partitions matching the given filter and ordering
Task<(IEnumerable<PartitionData> partitions, int totalCount)> ListPartitionsAsync(Expression<Func<PartitionData, bool>> filter, Expression<Func<PartitionData, object?>> orderField, bool ascOrder, int page, int pageSize, CancellationToken cancellationToken = default)
17.197.2.6.1. Parameters
filter Expression<Func<PartitionData, bool>>
Filter to select partitions
orderField Expression<Func<PartitionData, object?>>
Select the field that will be used to order the partitions
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
17.197.2.6.2. Returns
Task<(IEnumerable<PartitionData> partitions, int totalCount)>
Collection of partition metadata matching the request and total number of results without paging
17.197.2.6.3. Remarks
If pageSize is 0, this function can be used to count the number of partitions
satisfying the condition specified by filter
17.197.2.7. ReadPartitionAsync(string, CancellationToken)
Retrieves a partition from the data base
Task<PartitionData> ReadPartitionAsync(string partitionId, CancellationToken cancellationToken = default)
17.197.2.7.1. Parameters
partitionId string
Id of the partition to read
cancellationToken CancellationToken
Token used to cancel the execution of the method
17.197.2.7.2. Returns
Task metadata of the retrieved partition
17.197.2.7.3. Exceptions
required partition is not found