This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new a2da3406d48 branch-3.1: [chore](cloud) Move txn kv related files to
meta-store/ #52638 (#52957)
a2da3406d48 is described below
commit a2da3406d487d60a0a57095fad8160cdc2564d2f
Author: walter <[email protected]>
AuthorDate: Wed Jul 9 10:42:20 2025 +0800
branch-3.1: [chore](cloud) Move txn kv related files to meta-store/ #52638
(#52957)
cherry pick from #52638
---
cloud/CMakeLists.txt | 2 +
cloud/src/common/encryption_util.cpp | 6 +-
cloud/src/common/metric.cpp | 4 +-
cloud/src/common/metric.h | 2 +-
cloud/src/common/util.cpp | 140 +-----------------
cloud/src/common/util.h | 68 +--------
cloud/src/main.cpp | 4 +-
cloud/src/meta-service/CMakeLists.txt | 4 -
cloud/src/meta-service/http_encode_key.cpp | 9 +-
cloud/src/meta-service/injection_point_http.cpp | 6 +-
cloud/src/meta-service/meta_server.cpp | 6 +-
cloud/src/meta-service/meta_server.h | 2 +-
cloud/src/meta-service/meta_service.cpp | 10 +-
cloud/src/meta-service/meta_service.h | 2 +-
cloud/src/meta-service/meta_service_helper.h | 6 +-
cloud/src/meta-service/meta_service_http.cpp | 6 +-
cloud/src/meta-service/meta_service_job.cpp | 7 +-
cloud/src/meta-service/meta_service_partition.cpp | 4 +-
cloud/src/meta-service/meta_service_resource.cpp | 6 +-
cloud/src/meta-service/meta_service_schema.cpp | 7 +-
.../src/meta-service/meta_service_tablet_stats.cpp | 6 +-
cloud/src/meta-service/meta_service_txn.cpp | 6 +-
cloud/src/meta-service/txn_lazy_committer.cpp | 2 +-
cloud/src/meta-service/txn_lazy_committer.h | 2 +-
cloud/src/meta-store/CMakeLists.txt | 13 ++
cloud/src/meta-store/blob_message.cpp | 161 +++++++++++++++++++++
.../{common/util.h => meta-store/blob_message.h} | 51 +------
cloud/src/{meta-service => meta-store}/codec.cpp | 0
cloud/src/{meta-service => meta-store}/codec.h | 0
cloud/src/{meta-service => meta-store}/keys.cpp | 4 +-
cloud/src/{meta-service => meta-store}/keys.h | 0
.../{meta-service => meta-store}/mem_txn_kv.cpp | 2 +-
.../src/{meta-service => meta-store}/mem_txn_kv.h | 2 +-
cloud/src/{meta-service => meta-store}/txn_kv.cpp | 2 +-
cloud/src/{meta-service => meta-store}/txn_kv.h | 0
.../{meta-service => meta-store}/txn_kv_error.h | 0
cloud/src/recycler/checker.cpp | 6 +-
cloud/src/recycler/meta_checker.cpp | 4 +-
cloud/src/recycler/recycler.cpp | 7 +-
cloud/src/recycler/recycler_service.cpp | 4 +-
cloud/src/recycler/recycler_service.h | 2 +-
cloud/src/recycler/util.cpp | 6 +-
cloud/src/resource-manager/resource_manager.cpp | 4 +-
cloud/src/resource-manager/resource_manager.h | 4 +-
cloud/test/codec_test.cpp | 2 +-
cloud/test/doris_txn_test.cpp | 2 +-
cloud/test/encryption_test.cpp | 8 +-
cloud/test/fdb_injection_test.cpp | 2 +-
cloud/test/http_encode_key_test.cpp | 4 +-
cloud/test/keys_test.cpp | 2 +-
cloud/test/mem_txn_kv_test.cpp | 6 +-
cloud/test/meta_server_test.cpp | 8 +-
cloud/test/meta_service_http_test.cpp | 8 +-
cloud/test/meta_service_job_test.cpp | 6 +-
cloud/test/meta_service_tablet_stats_test.cpp | 4 +-
cloud/test/meta_service_test.cpp | 6 +-
cloud/test/metric_test.cpp | 6 +-
cloud/test/mock_resource_manager.h | 4 +-
cloud/test/rate_limiter_test.cpp | 6 +-
cloud/test/recycler_test.cpp | 8 +-
cloud/test/resource_test.cpp | 6 +-
cloud/test/rpc_kv_bvar_test.cpp | 8 +-
cloud/test/schema_kv_test.cpp | 6 +-
cloud/test/txn_kv_test.cpp | 13 +-
cloud/test/txn_lazy_commit_test.cpp | 6 +-
65 files changed, 321 insertions(+), 389 deletions(-)
diff --git a/cloud/CMakeLists.txt b/cloud/CMakeLists.txt
index 627e6f283b9..59f77c4927e 100644
--- a/cloud/CMakeLists.txt
+++ b/cloud/CMakeLists.txt
@@ -327,6 +327,7 @@ set(DORIS_LINK_LIBS ${DORIS_LINK_LIBS}
CloudGen
Common
MetaService
+ MetaStore
ResourceManager
Recycler
RateLimiter
@@ -481,6 +482,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
-lfdb_c -L${THIRDPARTY_DIR
add_subdirectory(${SRC_DIR}/common)
add_subdirectory(${SRC_DIR}/gen-cpp)
add_subdirectory(${SRC_DIR}/meta-service)
+add_subdirectory(${SRC_DIR}/meta-store)
add_subdirectory(${SRC_DIR}/recycler)
add_subdirectory(${SRC_DIR}/rate-limiter)
add_subdirectory(${SRC_DIR}/resource-manager)
diff --git a/cloud/src/common/encryption_util.cpp
b/cloud/src/common/encryption_util.cpp
index 84cbfc13054..2d8b842bcd3 100644
--- a/cloud/src/common/encryption_util.cpp
+++ b/cloud/src/common/encryption_util.cpp
@@ -38,9 +38,9 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
namespace config {
diff --git a/cloud/src/common/metric.cpp b/cloud/src/common/metric.cpp
index 2425ae0e48b..a9b91c6c853 100644
--- a/cloud/src/common/metric.cpp
+++ b/cloud/src/common/metric.cpp
@@ -28,8 +28,8 @@
#include <vector>
#include "common/bvars.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
diff --git a/cloud/src/common/metric.h b/cloud/src/common/metric.h
index 33429a276c6..ad918482daa 100644
--- a/cloud/src/common/metric.h
+++ b/cloud/src/common/metric.h
@@ -25,7 +25,7 @@
#include <thread>
#include "common/logging.h"
-#include "meta-service/txn_kv.h"
+#include "meta-store/txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/common/util.cpp b/cloud/src/common/util.cpp
index 377f83674ce..84363741db3 100644
--- a/cloud/src/common/util.cpp
+++ b/cloud/src/common/util.cpp
@@ -24,10 +24,11 @@
// FIXME: we should not rely other modules that may rely on this common module
#include "common/logging.h"
-#include "meta-service/keys.h"
-#include "meta-service/codec.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "common/config.h"
+#include "meta-store/keys.h"
+#include "meta-store/codec.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include <iomanip>
#include <sstream>
@@ -224,117 +225,6 @@ std::string proto_to_json(const
::google::protobuf::Message& msg, bool add_white
return json;
}
-std::vector<std::string_view> split_string(const std::string_view& str, int n)
{
- std::vector<std::string_view> substrings;
-
- for (size_t i = 0; i < str.size(); i += n) {
- substrings.push_back(str.substr(i, n));
- }
-
- return substrings;
-}
-
-bool ValueBuf::to_pb(google::protobuf::Message* pb) const {
- butil::IOBuf merge;
- for (auto&& it : iters) {
- it->reset();
- while (it->has_next()) {
- auto [k, v] = it->next();
- merge.append_user_data((void*)v.data(), v.size(), +[](void*) {});
- }
- }
- butil::IOBufAsZeroCopyInputStream merge_stream(merge);
- return pb->ParseFromZeroCopyStream(&merge_stream);
-}
-
-std::string ValueBuf::value() const {
- butil::IOBuf merge;
- for (auto&& it : iters) {
- it->reset();
- while (it->has_next()) {
- auto [k, v] = it->next();
- merge.append_user_data((void*)v.data(), v.size(), +[](void*) {});
- }
- }
- return merge.to_string();
-}
-
-std::vector<std::string> ValueBuf::keys() const {
- std::vector<std::string> ret;
- for (auto&& it : iters) {
- it->reset();
- while (it->has_next()) {
- auto [k, _] = it->next();
- ret.push_back({k.data(), k.size()});
- }
- }
- return ret;
-}
-
-void ValueBuf::remove(Transaction* txn) const {
- for (auto&& it : iters) {
- it->reset();
- while (it->has_next()) {
- txn->remove(it->next().first);
- }
- }
-}
-
-TxnErrorCode ValueBuf::get(Transaction* txn, std::string_view key, bool
snapshot) {
- iters.clear();
- ver = -1;
-
- std::string begin_key {key};
- std::string end_key {key};
- encode_int64(INT64_MAX, &end_key);
- std::unique_ptr<RangeGetIterator> it;
- TxnErrorCode err = txn->get(begin_key, end_key, &it, snapshot);
- if (err != TxnErrorCode::TXN_OK) {
- return err;
- }
- if (!it->has_next()) {
- return TxnErrorCode::TXN_KEY_NOT_FOUND;
- }
- // Extract version
- auto [k, _] = it->next();
- if (k.size() == key.size()) { // Old version KV
- DCHECK(k == key) << hex(k) << ' ' << hex(key);
- DCHECK_EQ(it->size(), 1) << hex(k) << ' ' << hex(key);
- ver = 0;
- } else {
- k.remove_prefix(key.size());
- int64_t suffix;
- if (decode_int64(&k, &suffix) != 0) [[unlikely]] {
- LOG_WARNING("failed to decode key").tag("key", hex(k));
- return TxnErrorCode::TXN_UNIDENTIFIED_ERROR;
- }
- ver = suffix >> 56 & 0xff;
- }
- bool more = it->more();
- if (!more) {
- iters.push_back(std::move(it));
- return TxnErrorCode::TXN_OK;
- }
- begin_key = it->next_begin_key();
- iters.push_back(std::move(it));
- do {
- err = txn->get(begin_key, end_key, &it, snapshot);
- if (err != TxnErrorCode::TXN_OK) {
- return err;
- }
- more = it->more();
- if (more) {
- begin_key = it->next_begin_key();
- }
- iters.push_back(std::move(it));
- } while (more);
- return TxnErrorCode::TXN_OK;
-}
-
-TxnErrorCode blob_get(Transaction* txn, std::string_view key, ValueBuf* val,
bool snapshot) {
- return val->get(txn, key, snapshot);
-}
-
TxnErrorCode key_exists(Transaction* txn, std::string_view key, bool snapshot)
{
std::string end_key {key};
encode_int64(INT64_MAX, &end_key);
@@ -346,24 +236,4 @@ TxnErrorCode key_exists(Transaction* txn, std::string_view
key, bool snapshot) {
return it->has_next() ? TxnErrorCode::TXN_OK :
TxnErrorCode::TXN_KEY_NOT_FOUND;
}
-void blob_put(Transaction* txn, std::string_view key, const
google::protobuf::Message& pb,
- uint8_t ver, size_t split_size) {
- std::string value;
- bool ret = pb.SerializeToString(&value); // Always success
- DCHECK(ret) << hex(key) << ' ' << pb.ShortDebugString();
- blob_put(txn, key, value, ver, split_size);
-}
-
-void blob_put(Transaction* txn, std::string_view key, std::string_view value,
uint8_t ver,
- size_t split_size) {
- auto split_vec = split_string(value, split_size);
- int64_t suffix_base = ver;
- suffix_base <<= 56;
- for (size_t i = 0; i < split_vec.size(); ++i) {
- std::string k(key);
- encode_int64(suffix_base + i, &k);
- txn->put(k, split_vec[i]);
- }
-}
-
} // namespace doris::cloud
diff --git a/cloud/src/common/util.h b/cloud/src/common/util.h
index 838c683125a..2b7fa694a77 100644
--- a/cloud/src/common/util.h
+++ b/cloud/src/common/util.h
@@ -22,7 +22,7 @@
#include <string_view>
#include <vector>
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv_error.h"
namespace google::protobuf {
class Message;
@@ -66,49 +66,6 @@ std::string prettify_key(std::string_view key_hex, bool
unicode = false);
*/
std::string proto_to_json(const ::google::protobuf::Message& msg, bool
add_whitespace = false);
-/**
- * Supports splitting large values (>100KB) into multiple KVs, with a logical
value size of up to the fdb transaction limit (<10MB).
- * Supports multi version format parsing of values (which can be any byte
sequence format), and can recognize the version of values
- * that are forward compatible with older versions of values.
- * Key format:
- * {origin_key}{suffix: i64}
- * suffix (big-endian):
- * |Bytes 0 |Bytes 1-5 |Bytes 6-7 |
- * |-------------|-------------|-------------|
- * |version |dummy |sequence |
- */
-struct ValueBuf {
- // TODO(plat1ko): Support decompression
- [[nodiscard]] bool to_pb(google::protobuf::Message* pb) const;
- // TODO: More bool to_xxx(Xxx* xxx) const;
-
- // Remove all splitted KV in `iters_` via `txn`
- void remove(Transaction* txn) const;
-
- // Get a key, save raw splitted values of the key to `this`, value length
may be bigger than 100k
- // Return TXN_OK for success get a key, TXN_KEY_NOT_FOUND for key not
found, otherwise for error.
- TxnErrorCode get(Transaction* txn, std::string_view key, bool snapshot =
false);
-
- // return the merged value in ValueBuf
- std::string value() const;
-
- // return all keys in ValueBuf, if the value is not splitted, size of keys
is 1
- std::vector<std::string> keys() const;
-
- std::vector<std::unique_ptr<RangeGetIterator>> iters;
- int8_t ver {-1};
-};
-
-/**
- * Get a key, return key's value, value length may be bigger than 100k
- * @param txn fdb txn handler
- * @param key encode key
- * @param val return wrapped raw splitted values of the key
- * @param snapshot if true, `key` will not be included in txn conflict
detection this time
- * @return return TXN_OK for success get a key, TXN_KEY_NOT_FOUND for key not
found, otherwise for error.
- */
-TxnErrorCode blob_get(Transaction* txn, std::string_view key, ValueBuf* val,
bool snapshot = false);
-
/**
* Test whether key exists
* @param txn fdb txn handler
@@ -118,27 +75,4 @@ TxnErrorCode blob_get(Transaction* txn, std::string_view
key, ValueBuf* val, boo
*/
TxnErrorCode key_exists(Transaction* txn, std::string_view key, bool snapshot
= false);
-/**
- * Put a KV, it's value may be bigger than 100k
- * TODO(plat1ko): Support compression
- * @param txn fdb txn handler
- * @param key encode key
- * @param pb value to save
- * @param ver value version
- * @param split_size how many byte sized fragments are the value split into
- */
-void blob_put(Transaction* txn, std::string_view key, const
google::protobuf::Message& pb,
- uint8_t ver, size_t split_size = 90 * 1000);
-
-/**
- * Put a KV, it's value may be bigger than 100k
- * @param txn fdb txn handler
- * @param key encode key
- * @param value value to save
- * @param ver value version
- * @param split_size how many byte sized fragments are the value split into
- */
-void blob_put(Transaction* txn, std::string_view key, std::string_view value,
uint8_t ver,
- size_t split_size = 90 * 1000);
-
} // namespace doris::cloud
diff --git a/cloud/src/main.cpp b/cloud/src/main.cpp
index 0aad97aab4d..6d0c22f3204 100644
--- a/cloud/src/main.cpp
+++ b/cloud/src/main.cpp
@@ -36,9 +36,9 @@
#include "common/configbase.h"
#include "common/encryption_util.h"
#include "common/logging.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_server.h"
-#include "meta-service/txn_kv.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
#include "recycler/recycler.h"
using namespace doris::cloud;
diff --git a/cloud/src/meta-service/CMakeLists.txt
b/cloud/src/meta-service/CMakeLists.txt
index 6a2ea4b921e..37f3c8cb03f 100644
--- a/cloud/src/meta-service/CMakeLists.txt
+++ b/cloud/src/meta-service/CMakeLists.txt
@@ -19,11 +19,7 @@ add_library(MetaService
meta_service_tablet_stats.cpp
meta_service_partition.cpp
meta_service_txn.cpp
- txn_kv.cpp
- codec.cpp
- keys.cpp
doris_txn.cpp
- mem_txn_kv.cpp
http_encode_key.cpp
txn_lazy_committer.cpp
delete_bitmap_lock_white_list.cpp
diff --git a/cloud/src/meta-service/http_encode_key.cpp
b/cloud/src/meta-service/http_encode_key.cpp
index fcb2b81a6a8..cae6fb322f7 100644
--- a/cloud/src/meta-service/http_encode_key.cpp
+++ b/cloud/src/meta-service/http_encode_key.cpp
@@ -37,14 +37,15 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/codec.h"
#include "meta-service/doris_txn.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_http.h"
#include "meta-service/meta_service_schema.h"
#include "meta-service/meta_service_tablet_stats.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/blob_message.h"
+#include "meta-store/codec.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/injection_point_http.cpp
b/cloud/src/meta-service/injection_point_http.cpp
index 910b709ca89..20e35b07f8a 100644
--- a/cloud/src/meta-service/injection_point_http.cpp
+++ b/cloud/src/meta-service/injection_point_http.cpp
@@ -22,10 +22,10 @@
#include "common/config.h"
#include "common/logging.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "meta_service.h"
#include "meta_service_http.h"
diff --git a/cloud/src/meta-service/meta_server.cpp
b/cloud/src/meta-service/meta_server.cpp
index 4762c55d812..9677d70b8c0 100644
--- a/cloud/src/meta-service/meta_server.cpp
+++ b/cloud/src/meta-service/meta_server.cpp
@@ -33,12 +33,12 @@
#include "common/network_util.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "rate-limiter/rate_limiter.h"
#include "resource-manager/resource_manager.h"
-#include "txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/meta_server.h
b/cloud/src/meta-service/meta_server.h
index ee44e377cb3..556da773918 100644
--- a/cloud/src/meta-service/meta_server.h
+++ b/cloud/src/meta-service/meta_server.h
@@ -25,7 +25,7 @@
#include <mutex>
#include "common/metric.h"
-#include "txn_kv.h"
+#include "meta-store/txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/meta_service.cpp
b/cloud/src/meta-service/meta_service.cpp
index 72ced9b8d10..879fcb969b6 100644
--- a/cloud/src/meta-service/meta_service.cpp
+++ b/cloud/src/meta-service/meta_service.cpp
@@ -56,16 +56,16 @@
#include "common/string_util.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "keys.h"
-#include "meta-service/codec.h"
#include "meta-service/delete_bitmap_lock_white_list.h"
#include "meta-service/doris_txn.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
#include "meta-service/meta_service_schema.h"
#include "meta-service/meta_service_tablet_stats.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/blob_message.h"
+#include "meta-store/codec.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "rate-limiter/rate_limiter.h"
using namespace std::chrono;
diff --git a/cloud/src/meta-service/meta_service.h
b/cloud/src/meta-service/meta_service.h
index 1c054af6776..da453b5f466 100644
--- a/cloud/src/meta-service/meta_service.h
+++ b/cloud/src/meta-service/meta_service.h
@@ -31,8 +31,8 @@
#include "common/stats.h"
#include "cpp/sync_point.h"
#include "meta-service/delete_bitmap_lock_white_list.h"
-#include "meta-service/txn_kv.h"
#include "meta-service/txn_lazy_committer.h"
+#include "meta-store/txn_kv.h"
#include "rate-limiter/rate_limiter.h"
#include "resource-manager/resource_manager.h"
diff --git a/cloud/src/meta-service/meta_service_helper.h
b/cloud/src/meta-service/meta_service_helper.h
index 256816b68bb..7ecdf856659 100644
--- a/cloud/src/meta-service/meta_service_helper.h
+++ b/cloud/src/meta-service/meta_service_helper.h
@@ -34,9 +34,9 @@
#include "common/stopwatch.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "resource-manager/resource_manager.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/meta_service_http.cpp
b/cloud/src/meta-service/meta_service_http.cpp
index b9a738b919d..7cd2afe8860 100644
--- a/cloud/src/meta-service/meta_service_http.cpp
+++ b/cloud/src/meta-service/meta_service_http.cpp
@@ -48,9 +48,9 @@
#include "common/configbase.h"
#include "common/logging.h"
#include "common/string_util.h"
-#include "meta-service/keys.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "meta_service.h"
#include "rate-limiter/rate_limiter.h"
diff --git a/cloud/src/meta-service/meta_service_job.cpp
b/cloud/src/meta-service/meta_service_job.cpp
index 10dcfe1ed75..e7e162665a3 100644
--- a/cloud/src/meta-service/meta_service_job.cpp
+++ b/cloud/src/meta-service/meta_service_job.cpp
@@ -31,12 +31,11 @@
#include "common/stats.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "keys.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
#include "meta-service/meta_service_tablet_stats.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "meta_service.h"
// Empty string not is not processed
diff --git a/cloud/src/meta-service/meta_service_partition.cpp
b/cloud/src/meta-service/meta_service_partition.cpp
index 5afb24bfe93..da76829c053 100644
--- a/cloud/src/meta-service/meta_service_partition.cpp
+++ b/cloud/src/meta-service/meta_service_partition.cpp
@@ -22,9 +22,9 @@
#include "common/logging.h"
#include "common/stats.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv_error.h"
#include "meta_service.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/meta_service_resource.cpp
b/cloud/src/meta-service/meta_service_resource.cpp
index b69dfb32cee..c0aa39224fd 100644
--- a/cloud/src/meta-service/meta_service_resource.cpp
+++ b/cloud/src/meta-service/meta_service_resource.cpp
@@ -36,11 +36,11 @@
#include "common/stats.h"
#include "common/string_util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
using namespace std::chrono;
diff --git a/cloud/src/meta-service/meta_service_schema.cpp
b/cloud/src/meta-service/meta_service_schema.cpp
index 31c067faea4..bb82e049427 100644
--- a/cloud/src/meta-service/meta_service_schema.cpp
+++ b/cloud/src/meta-service/meta_service_schema.cpp
@@ -32,10 +32,11 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/blob_message.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
namespace config {
diff --git a/cloud/src/meta-service/meta_service_tablet_stats.cpp
b/cloud/src/meta-service/meta_service_tablet_stats.cpp
index da556b6c574..c8bb315f60e 100644
--- a/cloud/src/meta-service/meta_service_tablet_stats.cpp
+++ b/cloud/src/meta-service/meta_service_tablet_stats.cpp
@@ -28,11 +28,11 @@
#include "common/logging.h"
#include "common/util.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/meta_service_txn.cpp
b/cloud/src/meta-service/meta_service_txn.cpp
index a417ec84e4e..b1ec2889064 100644
--- a/cloud/src/meta-service/meta_service_txn.cpp
+++ b/cloud/src/meta-service/meta_service_txn.cpp
@@ -26,12 +26,12 @@
#include "common/stats.h"
#include "cpp/sync_point.h"
#include "meta-service/doris_txn.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service.h"
#include "meta-service/meta_service_helper.h"
#include "meta-service/meta_service_tablet_stats.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
using namespace std::chrono;
diff --git a/cloud/src/meta-service/txn_lazy_committer.cpp
b/cloud/src/meta-service/txn_lazy_committer.cpp
index 99aea5fed56..3ad57fb0b6a 100644
--- a/cloud/src/meta-service/txn_lazy_committer.cpp
+++ b/cloud/src/meta-service/txn_lazy_committer.cpp
@@ -23,9 +23,9 @@
#include "common/stats.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
#include "meta-service/meta_service_tablet_stats.h"
+#include "meta-store/keys.h"
using namespace std::chrono;
diff --git a/cloud/src/meta-service/txn_lazy_committer.h
b/cloud/src/meta-service/txn_lazy_committer.h
index dca618739ec..1bcfa317a5d 100644
--- a/cloud/src/meta-service/txn_lazy_committer.h
+++ b/cloud/src/meta-service/txn_lazy_committer.h
@@ -22,7 +22,7 @@
#include <atomic>
#include "common/simple_thread_pool.h"
-#include "meta-service/txn_kv.h"
+#include "meta-store/txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-store/CMakeLists.txt
b/cloud/src/meta-store/CMakeLists.txt
new file mode 100644
index 00000000000..07349f7921c
--- /dev/null
+++ b/cloud/src/meta-store/CMakeLists.txt
@@ -0,0 +1,13 @@
+# where to put generated libraries
+set(LIBRARY_OUTPUT_PATH "${BUILD_DIR}/src/meta-store")
+
+# where to put generated binaries
+set(EXECUTABLE_OUTPUT_PATH "${BUILD_DIR}/src/meta-store")
+
+add_library(MetaStore STATIC
+ blob_message.cpp
+ codec.cpp
+ keys.cpp
+ mem_txn_kv.cpp
+ txn_kv.cpp
+)
diff --git a/cloud/src/meta-store/blob_message.cpp
b/cloud/src/meta-store/blob_message.cpp
new file mode 100644
index 00000000000..edc2c2e96d5
--- /dev/null
+++ b/cloud/src/meta-store/blob_message.cpp
@@ -0,0 +1,161 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "blob_message.h"
+
+#include <butil/iobuf.h>
+#include <google/protobuf/message.h>
+
+#include "common/logging.h"
+#include "common/util.h"
+#include "meta-store/codec.h"
+#include "meta-store/txn_kv.h"
+
+namespace doris::cloud {
+
+static std::vector<std::string_view> split_string(const std::string_view& str,
int n) {
+ std::vector<std::string_view> substrings;
+
+ for (size_t i = 0; i < str.size(); i += n) {
+ substrings.push_back(str.substr(i, n));
+ }
+
+ return substrings;
+}
+
+bool ValueBuf::to_pb(google::protobuf::Message* pb) const {
+ butil::IOBuf merge;
+ for (auto&& it : iters) {
+ it->reset();
+ while (it->has_next()) {
+ auto [k, v] = it->next();
+ merge.append_user_data((void*)v.data(), v.size(), +[](void*) {});
+ }
+ }
+ butil::IOBufAsZeroCopyInputStream merge_stream(merge);
+ return pb->ParseFromZeroCopyStream(&merge_stream);
+}
+
+std::string ValueBuf::value() const {
+ butil::IOBuf merge;
+ for (auto&& it : iters) {
+ it->reset();
+ while (it->has_next()) {
+ auto [k, v] = it->next();
+ merge.append_user_data((void*)v.data(), v.size(), +[](void*) {});
+ }
+ }
+ return merge.to_string();
+}
+
+std::vector<std::string> ValueBuf::keys() const {
+ std::vector<std::string> ret;
+ for (auto&& it : iters) {
+ it->reset();
+ while (it->has_next()) {
+ auto [k, _] = it->next();
+ ret.emplace_back(k.data(), k.size());
+ }
+ }
+ return ret;
+}
+
+void ValueBuf::remove(Transaction* txn) const {
+ for (auto&& it : iters) {
+ it->reset();
+ while (it->has_next()) {
+ txn->remove(it->next().first);
+ }
+ }
+}
+
+TxnErrorCode ValueBuf::get(Transaction* txn, std::string_view key, bool
snapshot) {
+ iters.clear();
+ ver = -1;
+
+ std::string begin_key {key};
+ std::string end_key {key};
+ encode_int64(INT64_MAX, &end_key);
+ std::unique_ptr<RangeGetIterator> it;
+ TxnErrorCode err = txn->get(begin_key, end_key, &it, snapshot);
+ if (err != TxnErrorCode::TXN_OK) {
+ return err;
+ }
+ if (!it->has_next()) {
+ return TxnErrorCode::TXN_KEY_NOT_FOUND;
+ }
+ // Extract version
+ auto [k, _] = it->next();
+ if (k.size() == key.size()) { // Old version KV
+ DCHECK(k == key) << hex(k) << ' ' << hex(key);
+ DCHECK_EQ(it->size(), 1) << hex(k) << ' ' << hex(key);
+ ver = 0;
+ } else {
+ k.remove_prefix(key.size());
+ int64_t suffix;
+ if (decode_int64(&k, &suffix) != 0) [[unlikely]] {
+ LOG_WARNING("failed to decode key").tag("key", hex(k));
+ return TxnErrorCode::TXN_UNIDENTIFIED_ERROR;
+ }
+ ver = suffix >> 56 & 0xff;
+ }
+ bool more = it->more();
+ if (!more) {
+ iters.push_back(std::move(it));
+ return TxnErrorCode::TXN_OK;
+ }
+ begin_key = it->next_begin_key();
+ iters.push_back(std::move(it));
+ do {
+ err = txn->get(begin_key, end_key, &it, snapshot);
+ if (err != TxnErrorCode::TXN_OK) {
+ return err;
+ }
+ more = it->more();
+ if (more) {
+ begin_key = it->next_begin_key();
+ }
+ iters.push_back(std::move(it));
+ } while (more);
+ return TxnErrorCode::TXN_OK;
+}
+
+TxnErrorCode blob_get(Transaction* txn, std::string_view key, ValueBuf* val,
bool snapshot) {
+ return val->get(txn, key, snapshot);
+}
+
+void blob_put(Transaction* txn, std::string_view key, const
google::protobuf::Message& pb,
+ uint8_t ver, size_t split_size) {
+ std::string value;
+ bool ret = pb.SerializeToString(&value); // Always success
+ DCHECK(ret) << hex(key) << ' ' << pb.ShortDebugString();
+ blob_put(txn, key, value, ver, split_size);
+}
+
+void blob_put(Transaction* txn, std::string_view key, std::string_view value,
uint8_t ver,
+ size_t split_size) {
+ auto split_vec = split_string(value, split_size);
+ int64_t suffix_base = ver;
+ suffix_base <<= 56;
+ for (size_t i = 0; i < split_vec.size(); ++i) {
+ std::string k(key);
+ encode_int64(suffix_base + i, &k);
+ txn->put(k, split_vec[i]);
+ }
+}
+
+} // namespace doris::cloud
diff --git a/cloud/src/common/util.h b/cloud/src/meta-store/blob_message.h
similarity index 60%
copy from cloud/src/common/util.h
copy to cloud/src/meta-store/blob_message.h
index 838c683125a..4bba034bf0e 100644
--- a/cloud/src/common/util.h
+++ b/cloud/src/meta-store/blob_message.h
@@ -17,54 +17,16 @@
#pragma once
-#include <memory>
-#include <string>
#include <string_view>
-#include <vector>
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace google::protobuf {
class Message;
}
namespace doris::cloud {
-class TxnKv;
-class Transaction;
-class RangeGetIterator;
-
-std::string hex(std::string_view str);
-
-std::string unhex(std::string_view str);
-
-/**
- * Prettifies the given key, the first byte must be key space tag, say 0x01,
and
- * the remaining part must be the output of codec function family.
- *
- * The result is like following:
- *
- *
/-------------------------------------------------------------------------------------------------------
0. key space: 1
- * |
/-----------------------------------------------------------------------------------------------------
1. txn
- * | |
/-----------------------------------------------------------------------------------------
2. instance_id_deadbeef
- * | | |
/------------------------------------------- 3. txn_label
- * | | | |
/------------------- 4. 10003
- * | | | |
| /- 5. insert_3fd5ad12d0054a9b-8c776d3218c6adb7
- * | | | |
| |
- * v v v v
v v
- *
011074786e000110696e7374616e63655f69645f646561646265656600011074786e5f696e646578000112000000000000271310696e736572745f336664356164313264303035346139622d386337373664333231386336616462370001
- *
- * @param key_hex encoded key hex string
- * @param unicode whether to use unicode (UTF8) to draw line, default false.
- * @return the pretty format, empty result if error occurs
- */
-std::string prettify_key(std::string_view key_hex, bool unicode = false);
-
-/**
- * Converts proto message to json string
- *
- * @return empty string if conversion failed
- */
-std::string proto_to_json(const ::google::protobuf::Message& msg, bool
add_whitespace = false);
/**
* Supports splitting large values (>100KB) into multiple KVs, with a logical
value size of up to the fdb transaction limit (<10MB).
@@ -109,15 +71,6 @@ struct ValueBuf {
*/
TxnErrorCode blob_get(Transaction* txn, std::string_view key, ValueBuf* val,
bool snapshot = false);
-/**
- * Test whether key exists
- * @param txn fdb txn handler
- * @param key encode key
- * @param snapshot if true, `key` will not be included in txn conflict
detection this time
- * @return TXN_OK for key existed, TXN_KEY_NOT_FOUND for key not found,
otherwise for kv error
- */
-TxnErrorCode key_exists(Transaction* txn, std::string_view key, bool snapshot
= false);
-
/**
* Put a KV, it's value may be bigger than 100k
* TODO(plat1ko): Support compression
diff --git a/cloud/src/meta-service/codec.cpp b/cloud/src/meta-store/codec.cpp
similarity index 100%
rename from cloud/src/meta-service/codec.cpp
rename to cloud/src/meta-store/codec.cpp
diff --git a/cloud/src/meta-service/codec.h b/cloud/src/meta-store/codec.h
similarity index 100%
rename from cloud/src/meta-service/codec.h
rename to cloud/src/meta-store/codec.h
diff --git a/cloud/src/meta-service/keys.cpp b/cloud/src/meta-store/keys.cpp
similarity index 99%
rename from cloud/src/meta-service/keys.cpp
rename to cloud/src/meta-store/keys.cpp
index d4e14bacbe5..bcf9a38091c 100644
--- a/cloud/src/meta-service/keys.cpp
+++ b/cloud/src/meta-store/keys.cpp
@@ -15,9 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-#include "keys.h"
+#include "meta-store/keys.h"
-#include "codec.h"
+#include "meta-store/codec.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/keys.h b/cloud/src/meta-store/keys.h
similarity index 100%
rename from cloud/src/meta-service/keys.h
rename to cloud/src/meta-store/keys.h
diff --git a/cloud/src/meta-service/mem_txn_kv.cpp
b/cloud/src/meta-store/mem_txn_kv.cpp
similarity index 99%
rename from cloud/src/meta-service/mem_txn_kv.cpp
rename to cloud/src/meta-store/mem_txn_kv.cpp
index ebd62fc12a9..e4d5be2cc65 100644
--- a/cloud/src/meta-service/mem_txn_kv.cpp
+++ b/cloud/src/meta-store/mem_txn_kv.cpp
@@ -28,7 +28,7 @@
#include <string>
#include "cpp/sync_point.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv_error.h"
#include "txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/mem_txn_kv.h
b/cloud/src/meta-store/mem_txn_kv.h
similarity index 99%
rename from cloud/src/meta-service/mem_txn_kv.h
rename to cloud/src/meta-store/mem_txn_kv.h
index 1046adcee1c..d794dc85398 100644
--- a/cloud/src/meta-service/mem_txn_kv.h
+++ b/cloud/src/meta-store/mem_txn_kv.h
@@ -30,8 +30,8 @@
#include <unordered_map>
#include <vector>
-#include "meta-service/txn_kv_error.h"
#include "txn_kv.h"
+#include "txn_kv_error.h"
namespace doris::cloud {
diff --git a/cloud/src/meta-service/txn_kv.cpp b/cloud/src/meta-store/txn_kv.cpp
similarity index 99%
rename from cloud/src/meta-service/txn_kv.cpp
rename to cloud/src/meta-store/txn_kv.cpp
index 56e5440c8fe..76f3c724958 100644
--- a/cloud/src/meta-service/txn_kv.cpp
+++ b/cloud/src/meta-store/txn_kv.cpp
@@ -39,7 +39,7 @@
#include "common/stopwatch.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv_error.h"
//
=============================================================================
// FoundationDB implementation of TxnKv
diff --git a/cloud/src/meta-service/txn_kv.h b/cloud/src/meta-store/txn_kv.h
similarity index 100%
rename from cloud/src/meta-service/txn_kv.h
rename to cloud/src/meta-store/txn_kv.h
diff --git a/cloud/src/meta-service/txn_kv_error.h
b/cloud/src/meta-store/txn_kv_error.h
similarity index 100%
rename from cloud/src/meta-service/txn_kv_error.h
rename to cloud/src/meta-store/txn_kv_error.h
diff --git a/cloud/src/recycler/checker.cpp b/cloud/src/recycler/checker.cpp
index 5b09b581ee6..62df898815b 100644
--- a/cloud/src/recycler/checker.cpp
+++ b/cloud/src/recycler/checker.cpp
@@ -43,9 +43,9 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "recycler/hdfs_accessor.h"
#include "recycler/s3_accessor.h"
#include "recycler/storage_vault_accessor.h"
diff --git a/cloud/src/recycler/meta_checker.cpp
b/cloud/src/recycler/meta_checker.cpp
index 3718c2f2099..a299c2839df 100644
--- a/cloud/src/recycler/meta_checker.cpp
+++ b/cloud/src/recycler/meta_checker.cpp
@@ -27,8 +27,8 @@
#include "common/logging.h"
#include "common/util.h"
-#include "meta-service/keys.h"
-#include "meta-service/txn_kv.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/recycler/recycler.cpp b/cloud/src/recycler/recycler.cpp
index 7282ee4fad5..f8a116c7fa1 100644
--- a/cloud/src/recycler/recycler.cpp
+++ b/cloud/src/recycler/recycler.cpp
@@ -42,8 +42,9 @@
#include "meta-service/meta_service.h"
#include "meta-service/meta_service_helper.h"
#include "meta-service/meta_service_schema.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/blob_message.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "recycler/checker.h"
#include "recycler/hdfs_accessor.h"
#include "recycler/s3_accessor.h"
@@ -58,7 +59,7 @@
#include "common/simple_thread_pool.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
+#include "meta-store/keys.h"
#include "recycler/recycler_service.h"
#include "recycler/sync_executor.h"
#include "recycler/util.h"
diff --git a/cloud/src/recycler/recycler_service.cpp
b/cloud/src/recycler/recycler_service.cpp
index c77357c764e..b812fbd27ee 100644
--- a/cloud/src/recycler/recycler_service.cpp
+++ b/cloud/src/recycler/recycler_service.cpp
@@ -28,8 +28,8 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/s3_rate_limiter.h"
-#include "meta-service/keys.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv_error.h"
#include "recycler/checker.h"
#include "recycler/meta_checker.h"
#include "recycler/recycler.h"
diff --git a/cloud/src/recycler/recycler_service.h
b/cloud/src/recycler/recycler_service.h
index 5ece69c86ba..67eb9d21333 100644
--- a/cloud/src/recycler/recycler_service.h
+++ b/cloud/src/recycler/recycler_service.h
@@ -19,8 +19,8 @@
#include <gen_cpp/cloud.pb.h>
-#include "meta-service/txn_kv.h"
#include "meta-service/txn_lazy_committer.h"
+#include "meta-store/txn_kv.h"
namespace doris::cloud {
diff --git a/cloud/src/recycler/util.cpp b/cloud/src/recycler/util.cpp
index 6797782d5d6..3666b6836e6 100644
--- a/cloud/src/recycler/util.cpp
+++ b/cloud/src/recycler/util.cpp
@@ -22,10 +22,10 @@
#include <cstdint>
#include "common/util.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_schema.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
namespace config {
diff --git a/cloud/src/resource-manager/resource_manager.cpp
b/cloud/src/resource-manager/resource_manager.cpp
index 8fe05103cb2..0e4133d0198 100644
--- a/cloud/src/resource-manager/resource_manager.cpp
+++ b/cloud/src/resource-manager/resource_manager.cpp
@@ -26,9 +26,9 @@
#include "common/string_util.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
diff --git a/cloud/src/resource-manager/resource_manager.h
b/cloud/src/resource-manager/resource_manager.h
index 356f7236b26..6b6db409140 100644
--- a/cloud/src/resource-manager/resource_manager.h
+++ b/cloud/src/resource-manager/resource_manager.h
@@ -23,8 +23,8 @@
#include <shared_mutex>
#include <string>
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
diff --git a/cloud/test/codec_test.cpp b/cloud/test/codec_test.cpp
index 94c7a9912d7..dd9065d8a3d 100644
--- a/cloud/test/codec_test.cpp
+++ b/cloud/test/codec_test.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "meta-service/codec.h"
+#include "meta-store/codec.h"
#include <gtest/gtest.h>
diff --git a/cloud/test/doris_txn_test.cpp b/cloud/test/doris_txn_test.cpp
index ca2fde09d6c..af386763e50 100644
--- a/cloud/test/doris_txn_test.cpp
+++ b/cloud/test/doris_txn_test.cpp
@@ -24,7 +24,7 @@
#include "common/config.h"
#include "common/util.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
+#include "meta-store/txn_kv.h"
int main(int argc, char** argv) {
doris::cloud::config::init(nullptr, true);
diff --git a/cloud/test/encryption_test.cpp b/cloud/test/encryption_test.cpp
index 072e6a820cf..55f6ee1adce 100644
--- a/cloud/test/encryption_test.cpp
+++ b/cloud/test/encryption_test.cpp
@@ -24,10 +24,10 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
using namespace doris;
diff --git a/cloud/test/fdb_injection_test.cpp
b/cloud/test/fdb_injection_test.cpp
index 60226e7f952..2331dc41dd4 100644
--- a/cloud/test/fdb_injection_test.cpp
+++ b/cloud/test/fdb_injection_test.cpp
@@ -33,7 +33,7 @@
#include "common/logging.h"
#include "cpp/sync_point.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
+#include "meta-store/txn_kv.h"
using namespace doris;
diff --git a/cloud/test/http_encode_key_test.cpp
b/cloud/test/http_encode_key_test.cpp
index 58fdb3a4c97..4ceace3f6eb 100644
--- a/cloud/test/http_encode_key_test.cpp
+++ b/cloud/test/http_encode_key_test.cpp
@@ -22,9 +22,9 @@
#include "common/defer.h"
#include "common/logging.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service_http.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
using namespace doris::cloud;
diff --git a/cloud/test/keys_test.cpp b/cloud/test/keys_test.cpp
index 52d840e1f5c..b028160cf7f 100644
--- a/cloud/test/keys_test.cpp
+++ b/cloud/test/keys_test.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "meta-service/keys.h"
+#include "meta-store/keys.h"
#include <bthread/bthread.h>
#include <bthread/countdown_event.h>
diff --git a/cloud/test/mem_txn_kv_test.cpp b/cloud/test/mem_txn_kv_test.cpp
index 9db71ba96c8..d86fbfe135c 100644
--- a/cloud/test/mem_txn_kv_test.cpp
+++ b/cloud/test/mem_txn_kv_test.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "meta-service/mem_txn_kv.h"
+#include "meta-store/mem_txn_kv.h"
#include <gtest/gtest-death-test.h>
#include <gtest/gtest.h>
@@ -25,8 +25,8 @@
#include "common/config.h"
#include "common/util.h"
#include "meta-service/doris_txn.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
using namespace doris;
diff --git a/cloud/test/meta_server_test.cpp b/cloud/test/meta_server_test.cpp
index 8cff9223498..a6a44851f79 100644
--- a/cloud/test/meta_server_test.cpp
+++ b/cloud/test/meta_server_test.cpp
@@ -37,11 +37,11 @@
#include "common/logging.h"
#include "common/stats.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_resource_manager.h"
#include "rate-limiter/rate_limiter.h"
#include "resource-manager/resource_manager.h"
diff --git a/cloud/test/meta_service_http_test.cpp
b/cloud/test/meta_service_http_test.cpp
index ba20931985f..082a7e3d974 100644
--- a/cloud/test/meta_service_http_test.cpp
+++ b/cloud/test/meta_service_http_test.cpp
@@ -45,11 +45,11 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_resource_manager.h"
#include "resource-manager/resource_manager.h"
diff --git a/cloud/test/meta_service_job_test.cpp
b/cloud/test/meta_service_job_test.cpp
index b772d1c2211..9a170c93e9d 100644
--- a/cloud/test/meta_service_job_test.cpp
+++ b/cloud/test/meta_service_job_test.cpp
@@ -33,10 +33,10 @@
#include "common/defer.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
namespace doris::cloud {
extern std::unique_ptr<MetaServiceProxy> get_meta_service();
diff --git a/cloud/test/meta_service_tablet_stats_test.cpp
b/cloud/test/meta_service_tablet_stats_test.cpp
index 000d33602e5..804cf165439 100644
--- a/cloud/test/meta_service_tablet_stats_test.cpp
+++ b/cloud/test/meta_service_tablet_stats_test.cpp
@@ -20,8 +20,8 @@
#include <gen_cpp/cloud.pb.h>
#include <gtest/gtest.h>
-#include "meta-service/codec.h"
-#include "meta-service/keys.h"
+#include "meta-store/codec.h"
+#include "meta-store/keys.h"
namespace doris::cloud {
diff --git a/cloud/test/meta_service_test.cpp b/cloud/test/meta_service_test.cpp
index e49b3c0deb9..077fba08990 100644
--- a/cloud/test/meta_service_test.cpp
+++ b/cloud/test/meta_service_test.cpp
@@ -37,10 +37,10 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_resource_manager.h"
#include "rate-limiter/rate_limiter.h"
#include "resource-manager/resource_manager.h"
diff --git a/cloud/test/metric_test.cpp b/cloud/test/metric_test.cpp
index f46d512efff..31a2b7b3c58 100644
--- a/cloud/test/metric_test.cpp
+++ b/cloud/test/metric_test.cpp
@@ -26,9 +26,9 @@
#include "common/bvars.h"
#include "common/config.h"
-#include "meta-service/mem_txn_kv.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
diff --git a/cloud/test/mock_resource_manager.h
b/cloud/test/mock_resource_manager.h
index fb9954b0e4a..59d0365c8e6 100644
--- a/cloud/test/mock_resource_manager.h
+++ b/cloud/test/mock_resource_manager.h
@@ -17,8 +17,8 @@
#pragma once
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "resource-manager/resource_manager.h"
using namespace doris::cloud;
diff --git a/cloud/test/rate_limiter_test.cpp b/cloud/test/rate_limiter_test.cpp
index a406fbb4932..3f853cec507 100644
--- a/cloud/test/rate_limiter_test.cpp
+++ b/cloud/test/rate_limiter_test.cpp
@@ -27,10 +27,10 @@
#include "common/config.h"
#include "common/util.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_resource_manager.h"
#include "resource-manager/resource_manager.h"
diff --git a/cloud/test/recycler_test.cpp b/cloud/test/recycler_test.cpp
index e720cebad43..96a2f93dc2a 100644
--- a/cloud/test/recycler_test.cpp
+++ b/cloud/test/recycler_test.cpp
@@ -35,11 +35,11 @@
#include "common/simple_thread_pool.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_accessor.h"
#include "mock_resource_manager.h"
#include "rate-limiter/rate_limiter.h"
diff --git a/cloud/test/resource_test.cpp b/cloud/test/resource_test.cpp
index e2aa0951436..e473594c8a0 100644
--- a/cloud/test/resource_test.cpp
+++ b/cloud/test/resource_test.cpp
@@ -36,9 +36,9 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "rate-limiter/rate_limiter.h"
#include "resource-manager/resource_manager.h"
diff --git a/cloud/test/rpc_kv_bvar_test.cpp b/cloud/test/rpc_kv_bvar_test.cpp
index 6f6bf9d0d20..9ff4aac0c20 100644
--- a/cloud/test/rpc_kv_bvar_test.cpp
+++ b/cloud/test/rpc_kv_bvar_test.cpp
@@ -35,11 +35,11 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service_helper.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_resource_manager.h"
#include "rate-limiter/rate_limiter.h"
diff --git a/cloud/test/schema_kv_test.cpp b/cloud/test/schema_kv_test.cpp
index 1840598b40e..bab9739ff29 100644
--- a/cloud/test/schema_kv_test.cpp
+++ b/cloud/test/schema_kv_test.cpp
@@ -26,10 +26,10 @@
#include "common/config.h"
#include "common/defer.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
#include "meta-service/meta_service.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
static std::string instance_id = "schema_kv_test";
diff --git a/cloud/test/txn_kv_test.cpp b/cloud/test/txn_kv_test.cpp
index 78c8c18da42..b63773f38c4 100644
--- a/cloud/test/txn_kv_test.cpp
+++ b/cloud/test/txn_kv_test.cpp
@@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.
-#include "meta-service/txn_kv.h"
+#include "meta-store/txn_kv.h"
#include <bthread/bthread.h>
#include <fmt/format.h>
@@ -34,12 +34,13 @@
#include "common/stopwatch.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/codec.h"
#include "meta-service/doris_txn.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
-#include "meta-service/txn_kv.h"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/blob_message.h"
+#include "meta-store/codec.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv.h"
+#include "meta-store/txn_kv_error.h"
using namespace doris::cloud;
diff --git a/cloud/test/txn_lazy_commit_test.cpp
b/cloud/test/txn_lazy_commit_test.cpp
index 81a5c8a2d99..d2bf82435d8 100644
--- a/cloud/test/txn_lazy_commit_test.cpp
+++ b/cloud/test/txn_lazy_commit_test.cpp
@@ -37,12 +37,12 @@
#include "common/logging.h"
#include "common/util.h"
#include "cpp/sync_point.h"
-#include "meta-service/keys.h"
-#include "meta-service/mem_txn_kv.h"
#include "meta-service/meta_service.h"
#include "meta-service/meta_service_helper.h"
#include "meta-service/meta_service_txn.cpp"
-#include "meta-service/txn_kv_error.h"
+#include "meta-store/keys.h"
+#include "meta-store/mem_txn_kv.h"
+#include "meta-store/txn_kv_error.h"
#include "mock_resource_manager.h"
#include "rate-limiter/rate_limiter.h"
#include "recycler/recycler.h"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]