TODO: avoid write if the transaction is empty.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
record_header_fullness.inline_stats.filled_bytes += record_size.get_raw_mdlength();
record_header_fullness.inline_stats.total_bytes += record_size.get_mdlength();
+ // FIXME: prevent submitting empty records
+ if (record.is_empty()) {
+ ERRORT("record is empty!", t);
+ }
+
return record;
}
const record_size_t& rsize,
extent_len_t _block_size)
{
+ // FIXME: prevent submitting empty records
+ // assert(!rsize.is_empty());
assert(_block_size > 0);
assert(rsize.dlength % _block_size == 0);
assert(block_size == 0 || block_size == _block_size);
extent_len_t plain_mdlength = 0; // mdlength without the record header
extent_len_t dlength = 0;
+ bool is_empty() const {
+ return plain_mdlength == 0 &&
+ dlength == 0;
+ }
+
void account_extent(extent_len_t extent_len);
void account(const extent_t& extent) {
}
}
+ bool is_empty() const {
+ return extents.size() == 0 &&
+ deltas.size() == 0;
+ }
+
// the size of extents and delta buffers
std::size_t get_raw_data_size() const {
auto delta_size = std::accumulate(