const std::map<int, int> &available,
std::set<int> *minimum) = 0;
+ /**
+ * Return the minimum number of bytes that the plugin and technique
+ * support for partial writes. This is the minimum size of update
+ * to coding chunks that the particular technique supports.
+ *
+ * @return minimum number of bytes.
+ */
+ virtual size_t get_minimum_granularity() = 0;
+
/**
* Encode the content of **in** and store the result in
* **encoded**. All buffers pointed to by **encoded** have the
return round_up_to(stripe_width, alignment) / k;
}
+size_t ErasureCodeClay::get_minimum_granularity()
+{
+ return mds.erasure_code->get_minimum_granularity();
+}
+
int ErasureCodeClay::minimum_to_decode(const set<int> &want_to_read,
const set<int> &available,
map<int, vector<pair<int, int>>> *minimum)
unsigned int get_chunk_size(unsigned int stripe_width) const override;
+ size_t get_minimum_granularity() override;
+
int minimum_to_decode(const std::set<int> &want_to_read,
const std::set<int> &available,
std::map<int, std::vector<std::pair<int, int>>> *minimum) override;
unsigned get_alignment() const override;
+ size_t get_minimum_granularity() override
+ {
+ return 1;
+ }
+
void prepare() override;
private:
char **coding,
int blocksize) override;
unsigned get_alignment() const override;
+ size_t get_minimum_granularity() override
+ {
+ return 1;
+ }
void prepare() override;
private:
int parse(ceph::ErasureCodeProfile& profile, std::ostream *ss) override;
char **coding,
int blocksize) override;
unsigned get_alignment() const override;
+ size_t get_minimum_granularity() override
+ {
+ return 1;
+ }
void prepare() override;
private:
int parse(ceph::ErasureCodeProfile& profile, std::ostream *ss) override;
char **coding,
int blocksize) override;
unsigned get_alignment() const override;
+ size_t get_minimum_granularity() override
+ {
+ return w * packetsize;
+ }
void prepare_schedule(int *matrix);
private:
int parse(ceph::ErasureCodeProfile& profile, std::ostream *ss) override;
char **coding,
int blocksize) override;
unsigned get_alignment() const override;
+ size_t get_minimum_granularity() override
+ {
+ return w * packetsize;
+ }
virtual bool check_k(std::ostream *ss) const;
virtual bool check_w(std::ostream *ss) const;
virtual bool check_packetsize_set(std::ostream *ss) const;
return layers.front().erasure_code->get_chunk_size(stripe_width);
}
+size_t ErasureCodeLrc::get_minimum_granularity()
+{
+ return layers.front().erasure_code->get_minimum_granularity();
+}
+
void p(const set<int> &s) { cerr << s; } // for gdb
int ErasureCodeLrc::_minimum_to_decode(const set<int> &want_to_read,
unsigned int get_chunk_size(unsigned int stripe_width) const override;
+ size_t get_minimum_granularity() override;
+
int encode_chunks(const std::set<int> &want_to_encode,
std::map<int, ceph::buffer::list> *encoded) override;
char **coding,
int blocksize) override;
unsigned get_alignment() const override;
+ size_t get_minimum_granularity() override
+ {
+ return 1;
+ }
void prepare() override;
private:
int parse(const ceph::ErasureCodeProfile &profile) override;
return ( object_size / DATA_CHUNKS ) + 1;
}
+ size_t get_minimum_granularity() override {
+ return 1;
+ }
+
int encode(const std::set<int> &want_to_encode,
const bufferlist &in,
std::map<int, bufferlist> *encoded) override {
unsigned int get_chunk_size(unsigned int object_size) const override {
return chunk_size;
}
+ size_t get_minimum_granularity() override { return 1; }
int encode_chunks(const set<int> &want_to_encode,
map<int, bufferlist> *encoded) override {
encode_chunks_encoded = *encoded;