using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ZeroLevel.Services.PartitionStorage.Interfaces;
namespace ZeroLevel.Services.PartitionStorage
{
///
/// Partition store interface
///
/// Key type
/// Value type
/// The type of compressed array of values for the key
/// Metadata for creating or searching for a partition
public interface IStore
{
///
/// Returns an object to create a partition
///
IStorePartitionBuilder CreateBuilder(TMeta info);
///
/// Returns an object to overwrite data in an existing partition
///
IStorePartitionMergeBuilder CreateMergeAccessor(TMeta info, Func> decompressor);
///
/// Creates an object to access the data in the partition
///
IStorePartitionAccessor CreateAccessor(TMeta info);
///
/// Performs a search for data in the repository
///
IAsyncEnumerable> Search(StoreSearchRequest searchRequest);
///
/// bypass all key value by meta
///
IAsyncEnumerable> Bypass(TMeta meta);
///
/// bypass all keys by meta
///
IAsyncEnumerable BypassKeys(TMeta meta);
///
/// true - if key exists
///
Task Exists(TMeta meta, TKey key);
///
/// Deleting a partition
///
void RemovePartition(TMeta info);
///
/// Remove all cached data accessors
///
void DropCache();
}
}