21.201. 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
21.201.1. Implements
IInitializable, IHealthCheckProvider
21.201.2. Properties
21.201.2.1. Secondary
Table targeting a secondary server for read operations
IPartitionTable Secondary { get; }
21.201.2.1.1. Property Value
21.201.3. Methods
21.201.3.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)
21.201.3.1.1. Parameters
partitionIds IEnumerable<string>
Collection of partition ids
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.201.3.1.2. Returns
A bool representing whether all the partitions are available
21.201.3.2. CreatePartitionsAsync(IEnumerable<PartitionData>, CancellationToken)
Inserts a collection of partitions in the data base
Task CreatePartitionsAsync(IEnumerable<PartitionData> partitions, CancellationToken cancellationToken = default)
21.201.3.2.1. Parameters
partitions IEnumerable<PartitionData>
Collection of partitions to be inserted
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.201.3.2.2. Returns
Task representing the asynchronous execution of the method
21.201.3.3. DeletePartitionAsync(string, CancellationToken)
Remove a partition from the data base given its id
Task DeletePartitionAsync(string partitionId, CancellationToken cancellationToken = default)
21.201.3.3.1. Parameters
partitionId string
Id of the partition to be deleted
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.201.3.3.2. Returns
Task representing the asynchronous execution of the method
21.201.3.3.3. Exceptions
required partition is not found
21.201.3.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)
21.201.3.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
21.201.3.4.2. Returns
List of partitions that match the filter
21.201.3.4.3. Type Parameters
T
21.201.3.5. GetPartitionWithAllocationAsync(CancellationToken)
Gets partitions that are pod allocated to it (PodMax > 0)
IAsyncEnumerable<PartitionData> GetPartitionWithAllocationAsync(CancellationToken cancellationToken = default)
21.201.3.5.1. Parameters
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.201.3.5.2. Returns
IAsyncEnumerable<PartitionData>
Collection of partitions respecting the request
21.201.3.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)
21.201.3.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
21.201.3.6.2. Returns
Task<(IEnumerable<PartitionData> partitions, int totalCount)>
Collection of partition metadata matching the request and total number of results without paging
21.201.3.6.3. Remarks
If pageSize is 0, this function can be used to count the number of partitions
satisfying the condition specified by filter
21.201.3.7. ReadPartitionAsync(string, CancellationToken)
Retrieves a partition from the data base
Task<PartitionData> ReadPartitionAsync(string partitionId, CancellationToken cancellationToken = default)
21.201.3.7.1. Parameters
partitionId string
Id of the partition to read
cancellationToken CancellationToken
Token used to cancel the execution of the method
21.201.3.7.2. Returns
Task metadata of the retrieved partition
21.201.3.7.3. Exceptions
required partition is not found