scality / quadiron

Fast Erasure Coding Library for Large Number of Data and Parities
BSD 3-Clause "New" or "Revised" License
28 stars 5 forks source link

Revisit the API #260

Closed vrancurel closed 5 years ago

vrancurel commented 5 years ago

Use a codec style API:

The lib shall split the buffers acc/to the parameters of the code (type of code, k, m, stride, word_size, etc)

vrancurel commented 5 years ago

@slaperche-scality can you make a suggestion of an API and we will iterate over it ?

vrancurel commented 5 years ago

API Proposal

void init(int k, int m);

void destroy();

int encode(char **data, char **parity, uint32_t block_size);

int decode(char **data, char **parity, int *missing_idxs, int block_size);

int fragsneeded(int *missing_idxs, int *fragments_to_exclude, int *fragments_needed);

int reconstruct(char **data, char **parity, int *missing_idxs, int destination_idx, int block_size);

Some remarks and questions @lamphamsy and @slaperche-scality