MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / EncodeRows

Function EncodeRows

src/codec/row_codec.h:446–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444 return Encode(data->data, data->size, buffer, offset);
445}
446static inline int32_t EncodeRows(const std::vector<::fedb::base::Slice>& rows,
447 uint32_t total_block_size, std::string* body) {
448 if (body == NULL) {
449 PDLOG(WARNING, "invalid output body");
450 return -1;
451 }
452
453 uint32_t total_size = rows.size() * 4 + total_block_size;
454 if (rows.size() > 0) {
455 body->resize(total_size);
456 }
457 uint32_t offset = 0;
458 char* rbuffer = reinterpret_cast<char*>(&((*body)[0]));
459 for (auto lit = rows.begin(); lit != rows.end(); ++lit) {
460 ::fedb::codec::Encode(lit->data(), lit->size(), rbuffer, offset);
461 offset += (4 + lit->size());
462 }
463 return total_size;
464}
465
466static inline int32_t EncodeRows(
467 const boost::container::deque<std::pair<uint64_t, ::fedb::base::Slice>>&

Callers 4

ScanIndexMethod · 0.85
RunHasTsFunction · 0.85
RunNoneTsFunction · 0.85
TEST_FFunction · 0.85

Calls 3

EncodeFunction · 0.85
dataMethod · 0.80
sizeMethod · 0.45

Tested by 3

RunHasTsFunction · 0.68
RunNoneTsFunction · 0.68
TEST_FFunction · 0.68