virtual ~ErasureCode() {}
+ virtual unsigned int get_coding_chunk_count() const {
+ return get_chunk_count() - get_data_chunk_count();
+ }
+
virtual int minimum_to_decode(const set<int> &want_to_read,
const set<int> &available_chunks,
set<int> *minimum);
*/
virtual unsigned int get_data_chunk_count() const = 0;
+ /**
+ * Return the number of coding chunks created by a call to the
+ * **encode** method. The coding chunks are used to recover from
+ * the loss of one or more chunks. If there is one coding chunk,
+ * it is possible to recover from the loss of exactly one
+ * chunk. If there are two coding chunks, it is possible to
+ * recover from the loss of at most two chunks, etc.
+ *
+ * @return the number of coding chunks created by encode()
+ */
+ virtual unsigned int get_coding_chunk_count() const = 0;
+
/**
* Return the size (in bytes) of a single chunk created by a call
* to the **decode** method. The returned size multiplied by
("all", "implies "
"--get_chunk_size 1024 "
"--get_data_chunk_count "
+ "--get_coding_chunk_count "
"--get_chunk_count ")
("get_chunk_size", po::value<unsigned int>(),
"display get_chunk_size(<object size>)")
("get_data_chunk_count", "display get_data_chunk_count()")
+ ("get_coding_chunk_count", "display get_coding_chunk_count()")
("get_chunk_count", "display get_chunk_count()")
("parameter,P", po::value<vector<string> >(),
"parameters")
if (vm.count("all") || vm.count("get_data_chunk_count"))
cout << "get_data_chunk_count\t"
<< erasure_code->get_data_chunk_count() << endl;
+ if (vm.count("all") || vm.count("get_coding_chunk_count"))
+ cout << "get_coding_chunk_count\t"
+ << erasure_code->get_coding_chunk_count() << endl;
if (vm.count("all") || vm.count("get_chunk_count"))
cout << "get_chunk_count\t"
<< erasure_code->get_chunk_count() << endl;
* --parameter m=2 \
* --get_chunk_size 1024 \
* --get_data_chunk_count \
+ * --get_coding_chunk_count \
* --get_chunk_count \
* "
* End: