MCPcopy Create free account
hub / github.com/Tencent/Tendis / writeComplexDataToServer

Function writeComplexDataToServer

src/tendisplus/utils/test_util.cpp:710–757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

708}
709
710AllKeys writeComplexDataToServer(const std::shared_ptr<ServerEntry>& server,
711 uint32_t count,
712 uint32_t maxEleCnt,
713 const char* key_suffix,
714 bool flushEnable) {
715 auto ctx1 = std::make_shared<asio::io_context>();
716 auto sess1 = makeSession(server, ctx1);
717 WorkLoad work(server, sess1);
718 work.init();
719
720 AllKeys all_keys;
721 LOG(INFO) << "Start write data to server";
722 std::string s("");
723 if (key_suffix != nullptr) {
724 s = std::string(key_suffix);
725 }
726 auto kv_keys = work.writeWork(RecordType::RT_KV, count, 0, true, s);
727 all_keys.emplace_back(kv_keys);
728
729 auto list_keys =
730 work.writeWork(RecordType::RT_LIST_META, count, maxEleCnt, true, s);
731 all_keys.emplace_back(list_keys);
732
733 // work.flush was used in repl_test, we just keep same
734 if (flushEnable) {
735 // wait binlog dump to disk
736 std::this_thread::sleep_for(std::chrono::seconds(2));
737
738 // #ifdef _WIN32
739 work.flush();
740 // #endif
741 }
742
743 auto hash_keys =
744 work.writeWork(RecordType::RT_HASH_META, count, maxEleCnt, true, s);
745 all_keys.emplace_back(hash_keys);
746
747 auto set_keys =
748 work.writeWork(RecordType::RT_SET_META, count, maxEleCnt, true, s);
749 all_keys.emplace_back(set_keys);
750
751 auto zset_keys =
752 work.writeWork(RecordType::RT_ZSET_META, count, maxEleCnt, true, s);
753 all_keys.emplace_back(zset_keys);
754 LOG(INFO) << "End write data to server";
755
756 return all_keys;
757}
758
759AllKeys writeComplexDataWithTTLToServer(
760 const std::shared_ptr<ServerEntry>& server,

Callers 6

repl_test.cppFile · 0.85
TEST_PFunction · 0.85
TESTFunction · 0.85
restore_test.cppFile · 0.85
TESTFunction · 0.85

Calls 4

makeSessionFunction · 0.85
writeWorkMethod · 0.80
initMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected