26.104. Interface IObjectStorage

Namespace: ArmoniK.Core.Base
Assembly: ArmoniK.Core.Base.dll

Object Storage interface It is used to store data in ArmoniK

public interface IObjectStorage : IInitializable, IHealthCheckProvider

26.104.1. Implements

IInitializable, IHealthCheckProvider

26.104.2. Methods

26.104.2.1. AddOrUpdateAsync(ObjectData, IAsyncEnumerable<ReadOnlyMemory<byte>>, CancellationToken)

Add the given data in the storage at the given key Update data if it already exists

Task<(byte[] id, long size)> AddOrUpdateAsync(ObjectData data, IAsyncEnumerable<ReadOnlyMemory<byte>> valueChunks, CancellationToken cancellationToken = default)

26.104.2.1.1. Parameters

data ObjectData

Miscellaneous data related to the object

valueChunks IAsyncEnumerable<ReadOnlyMemory<byte>>

Chunks of data that will be stored in the Object Storage

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.104.2.1.2. Returns

Task<(byte[] id, long size)>

The opaque unique identifier representing the object and the size of the object that has been uploaded.

26.104.2.1.3. Remarks

Opaque ID will be used to refer to the object. The implementation of this interface should generate it.

26.104.2.1.4. Exceptions

ObjectDataNotFoundException

the key is not found

26.104.2.2. GetSizesAsync(IEnumerable<byte[]>, CancellationToken)

Check if the given keys are existing in the object storage

Task<IDictionary<byte[], long?>> GetSizesAsync(IEnumerable<byte[]> ids, CancellationToken cancellationToken = default)

26.104.2.2.1. Parameters

ids IEnumerable<byte[]>

Opaque unique identifiers representing the objects to check

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.104.2.2.2. Returns

Task<IDictionary<byte[], long?>>

A map giving the results size if it exits, null otherwise

26.104.2.3. GetValuesAsync(byte[], CancellationToken)

Get object in the Object Storage

IAsyncEnumerable<byte[]> GetValuesAsync(byte[] id, CancellationToken cancellationToken = default)

26.104.2.3.1. Parameters

id byte[]

Opaque unique identifier representing the object

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.104.2.3.2. Returns

IAsyncEnumerable<byte[]>

Byte arrays representing the object chunked

26.104.2.3.3. Exceptions

ObjectDataNotFoundException

the key is not found

26.104.2.4. TryDeleteAsync(IEnumerable<byte[]>, CancellationToken)

Delete data in the object storage

Task TryDeleteAsync(IEnumerable<byte[]> ids, CancellationToken cancellationToken = default)

26.104.2.4.1. Parameters

ids IEnumerable<byte[]>

Opaque unique identifiers representing the objects to delete

cancellationToken CancellationToken

Token used to cancel the execution of the method

26.104.2.4.2. Returns

Task

Task representing the asynchronous execution of the method

26.104.2.4.3. Exceptions

ObjectDataNotFoundException

the key is not found