From b729210036d410e2052ac3e140c23190b08f2692 Mon Sep 17 00:00:00 2001 From: lobty Date: Fri, 16 Jun 2023 14:09:26 +0800 Subject: [PATCH] asset upload patch Signed-off-by: lobty --- .../common/include/cloud/cloud_db_types.h | 2 + .../include/cloud/cloud_store_types.h | 7 +- .../relational/relational_sync_able_storage.h | 4 +- .../include/cloud/cloud_storage_utils.h | 5 +- .../include/icloud_sync_storage_interface.h | 4 +- .../storage/include/storage_proxy.h | 4 +- .../storage/src/cloud/cloud_storage_utils.cpp | 64 +++++++++++++---- .../src/relational_sync_able_storage.cpp | 29 +++++++- ...single_ver_relational_storage_executor.cpp | 15 +++- ...e_single_ver_relational_storage_executor.h | 8 ++- ...ver_relational_storage_extend_executor.cpp | 70 ++++++++++++++++++- .../storage/src/storage_proxy.cpp | 13 +++- .../syncer/src/cloud/cloud_syncer.cpp | 4 +- ...relational_cloud_syncable_storage_test.cpp | 2 +- .../mock_icloud_sync_storage_interface.h | 3 +- 15 files changed, 199 insertions(+), 35 deletions(-) diff --git a/frameworks/libs/distributeddb/common/include/cloud/cloud_db_types.h b/frameworks/libs/distributeddb/common/include/cloud/cloud_db_types.h index 51fc651ccfb..7958787c2ce 100644 --- a/frameworks/libs/distributeddb/common/include/cloud/cloud_db_types.h +++ b/frameworks/libs/distributeddb/common/include/cloud/cloud_db_types.h @@ -24,6 +24,8 @@ struct CloudSyncBatch { std::vector record; std::vector extend; std::vector rowid; + std::vector timestamp; + std::vector assets; }; struct CloudSyncData { diff --git a/frameworks/libs/distributeddb/interfaces/include/cloud/cloud_store_types.h b/frameworks/libs/distributeddb/interfaces/include/cloud/cloud_store_types.h index 97781996453..b06ff6875b4 100644 --- a/frameworks/libs/distributeddb/interfaces/include/cloud/cloud_store_types.h +++ b/frameworks/libs/distributeddb/interfaces/include/cloud/cloud_store_types.h @@ -39,7 +39,7 @@ enum ClearMode { enum class AssetOpType { NO_CHANGE = 0, - INSERT, + INSERT = 3, DELETE, UPDATE }; @@ -47,7 +47,10 @@ enum class AssetOpType { enum class AssetStatus { NORMAL = 0, DOWNLOADING, - FAILURE + FAILURE, + INSERT = 3, // INSERT/DELETE/UPDATE are for client use + DELETE, + UPDATE }; struct Asset { diff --git a/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h b/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h index 86f6ee674c5..f1ff857747d 100644 --- a/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h +++ b/frameworks/libs/distributeddb/interfaces/src/relational/relational_sync_able_storage.h @@ -159,7 +159,9 @@ public: int CleanCloudData(ClearMode mode, const std::vector &tableNameList, std::vector &assets) override; - int FillCloudAsset(const std::string &tableName, VBucket &asset, bool isFullReplace) override; + int FillCloudAssetForDownload(const std::string &tableName, VBucket &asset, bool isFullReplace) override; + + int FillCloudAssetForUpload(const CloudSyncData &data) override; private: SQLiteSingleVerRelationalStorageExecutor *GetHandle(bool isWrite, int &errCode, diff --git a/frameworks/libs/distributeddb/storage/include/cloud/cloud_storage_utils.h b/frameworks/libs/distributeddb/storage/include/cloud/cloud_storage_utils.h index 9d61c05d7ba..3bb1227bb2a 100644 --- a/frameworks/libs/distributeddb/storage/include/cloud/cloud_storage_utils.h +++ b/frameworks/libs/distributeddb/storage/include/cloud/cloud_storage_utils.h @@ -45,10 +45,11 @@ public: static std::map GetCloudPrimaryKeyFieldMap(const TableSchema &tableSchema); static bool IsContainsPrimaryKey(const TableSchema &tableSchema); static std::vector GetCloudAsset(const TableSchema &tableSchema); - static void UpdateAssetByFlag(Asset &asset); - static void UpdateAssetsByFlag(Assets &assets); + static int RebuildFillAsset(Asset &asset); + static void RebuildFillAssets(Assets &assets); static int CheckAssetFromSchema(const TableSchema &tableSchema, VBucket &vBucket, std::vector &fields); + static int ObtainAssetFromVBucket(const VBucket &vBucket, VBucket &asset); template static int GetValueFromOneField(Type &cloudValue, T &outVal) diff --git a/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h b/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h index c0cf6e4a38a..e7cc3b43671 100644 --- a/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h +++ b/frameworks/libs/distributeddb/storage/include/icloud_sync_storage_interface.h @@ -85,7 +85,9 @@ public: virtual void TriggerObserverAction(const std::string &deviceName, ChangedData &&changedData, bool isChangedData) = 0; - virtual int FillCloudAsset(const std::string &tableName, VBucket &asset, bool isFullReplace) = 0; + virtual int FillCloudAssetForDownload(const std::string &tableName, VBucket &asset, bool isFullReplace) = 0; + + virtual int FillCloudAssetForUpload(const CloudSyncData &data) = 0; }; } diff --git a/frameworks/libs/distributeddb/storage/include/storage_proxy.h b/frameworks/libs/distributeddb/storage/include/storage_proxy.h index e32227afc7d..b87bf3ee895 100644 --- a/frameworks/libs/distributeddb/storage/include/storage_proxy.h +++ b/frameworks/libs/distributeddb/storage/include/storage_proxy.h @@ -79,7 +79,9 @@ public: int ReleaseContinueToken(ContinueToken &continueStmtToken); - int FillCloudAsset(const std::string &tableName, VBucket &asset, bool isFullReplace); + int FillCloudAssetForDownload(const std::string &tableName, VBucket &asset, bool isFullReplace); + + int FillCloudAssetForUpload(const CloudSyncData &data); protected: void Init(); diff --git a/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp b/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp index c85bd7b5470..3133eb241e1 100644 --- a/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp +++ b/frameworks/libs/distributeddb/storage/src/cloud/cloud_storage_utils.cpp @@ -153,15 +153,17 @@ int CloudStorageUtils::BindAsset(int index, const VBucket &vBucket, const Field if (!(IsFieldValid(field, errCode))) { goto ERROR; } - UpdateAssetByFlag(asset); - RuntimeContext::GetInstance()->AssetToBlob(asset, val); + errCode = RebuildFillAsset(asset); + if (errCode == E_OK) { + RuntimeContext::GetInstance()->AssetToBlob(asset, val); + } } else { Assets assets; errCode = GetValueFromVBucket(field.colName, vBucket, assets); if (!(IsFieldValid(field, errCode))) { goto ERROR; } - UpdateAssetsByFlag(assets); + RebuildFillAssets(assets); RuntimeContext::GetInstance()->AssetsToBlob(assets, val); } if (errCode == -E_NOT_FOUND) { @@ -292,24 +294,43 @@ std::map CloudStorageUtils::GetCloudPrimaryKeyFieldMap(const return pkMap; } -void CloudStorageUtils::UpdateAssetByFlag(Asset &asset) +int CloudStorageUtils::RebuildFillAsset(Asset &asset) { - if (static_cast(asset.flag) == AssetOpType::INSERT && - static_cast(asset.status) != AssetStatus::NORMAL) { - Asset insAsset; - insAsset.name = asset.name; - insAsset.status = asset.status; - insAsset.timestamp = asset.timestamp; - asset = insAsset; + AssetOpType flag = static_cast(asset.flag); + AssetStatus status = static_cast(asset.status); + switch (status) { + case AssetStatus::FAILURE: + case AssetStatus::DOWNLOADING: { + if (flag == AssetOpType::INSERT) { + Asset insAsset; + insAsset.name = asset.name; + insAsset.status = asset.status; + insAsset.timestamp = asset.timestamp; + asset = insAsset; + } + break; + } + case AssetStatus::INSERT: + case AssetStatus::UPDATE: { + asset.status = static_cast(AssetStatus::NORMAL); + break; + } + case AssetStatus::DELETE: { + return -E_NOT_FOUND; + } + default: + break; } + return E_OK; } -void CloudStorageUtils::UpdateAssetsByFlag(Assets &assets) +void CloudStorageUtils::RebuildFillAssets(Assets &assets) { for (auto asset = assets.begin(); asset != assets.end();) { - UpdateAssetByFlag(*asset); - if (static_cast(asset->flag) == AssetOpType::DELETE - && static_cast(asset->status) == AssetStatus::NORMAL) { + RebuildFillAsset(*asset); + AssetOpType flag = static_cast(asset->flag); + AssetStatus status = static_cast(asset->status); + if (flag == AssetOpType::DELETE && status == AssetStatus::NORMAL || status == AssetStatus::DELETE) { asset = assets.erase(asset); } else { asset++; @@ -353,4 +374,17 @@ bool CloudStorageUtils::IsContainsPrimaryKey(const TableSchema &tableSchema) } return false; } + +int CloudStorageUtils::ObtainAssetFromVBucket(const VBucket &vBucket, VBucket &asset) +{ + for (const auto &item: vBucket) { + if (item.second.index() == TYPE_INDEX) { + Asset data = std::get(item.second); + asset.insert_or_assign(item.first, data); + } else if (item.second.index() == TYPE_INDEX) { + Assets data = std::get(item.second); + asset.insert_or_assign(item.first, data); + } + } +} } diff --git a/frameworks/libs/distributeddb/storage/src/relational_sync_able_storage.cpp b/frameworks/libs/distributeddb/storage/src/relational_sync_able_storage.cpp index dfb9c1f4124..2dd04d64bb3 100644 --- a/frameworks/libs/distributeddb/storage/src/relational_sync_able_storage.cpp +++ b/frameworks/libs/distributeddb/storage/src/relational_sync_able_storage.cpp @@ -1124,7 +1124,7 @@ int RelationalSyncAbleStorage::GetCloudTableSchema(const TableName &tableName, T return schemaMgr_.GetCloudTableSchema(tableName, tableSchema); } -int RelationalSyncAbleStorage::FillCloudAsset(const std::string &tableName, VBucket &asset, bool isFullReplace) +int RelationalSyncAbleStorage::FillCloudAssetForDownload(const std::string &tableName, VBucket &asset, bool isFullReplace) { if (storageEngine_ == nullptr) { return -E_INVALID_DB; @@ -1156,5 +1156,32 @@ int RelationalSyncAbleStorage::FillCloudAsset(const std::string &tableName, VBuc ReleaseHandle(writeHandle); return errCode; } + +int RelationalSyncAbleStorage::FillCloudAssetForUpload(const CloudSyncData &data) +{ + if (storageEngine_ == nullptr) { + return -E_INVALID_DB; + } + int errCode = E_OK; + auto writeHandle = static_cast( + storageEngine_->FindExecutor(true, OperatePerm::NORMAL_PERM, errCode, 0)); + if (writeHandle == nullptr) { + return errCode; + } + errCode = writeHandle->StartTransaction(TransactType::IMMEDIATE); + if (errCode != E_OK) { + ReleaseHandle(writeHandle); + return errCode; + } + errCode = writeHandle->FillCloudAssetForUpload(data); + if (errCode != E_OK) { + writeHandle->Rollback(); + ReleaseHandle(writeHandle); + return errCode; + } + errCode = writeHandle->Commit(); + ReleaseHandle(writeHandle); + return errCode; +} } #endif \ No newline at end of file diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.cpp index caf6a9ea050..844bcd4d7f4 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.cpp @@ -33,6 +33,7 @@ namespace DistributedDB { namespace { static constexpr const char* ROWID = "ROWID"; +static constexpr const char* TIMESTAMP = "TIMESTAMP"; static constexpr const char* FLAG = "FLAG"; static constexpr const char* DATAKEY = "DATA_KEY"; static constexpr const char* DEVICE_FIELD = "DEVICE"; @@ -515,7 +516,9 @@ void GetCloudLog(sqlite3_stmt *logStatement, VBucket &logInfo, uint32_t &totalSi void GetCloudExtraLog(sqlite3_stmt *logStatement, VBucket &flags) { flags.insert_or_assign(ROWID, - static_cast(sqlite3_column_int64(logStatement, 0))); // 0 means hash_key index + static_cast(sqlite3_column_int64(logStatement, 0))); // 0 means data_key index + flags.insert_or_assign(TIMESTAMP, + static_cast(sqlite3_column_int64(logStatement, 3))); // 3 means timestamp index flags.insert_or_assign(FLAG, static_cast(sqlite3_column_int64(logStatement, 5))); // 5 means flag index } @@ -524,7 +527,8 @@ int IdentifyCloudType(CloudSyncData &cloudSyncData, VBucket &data, VBucket &log, { int64_t *rowid = std::get_if(&flags[ROWID]); int64_t *flag = std::get_if(&flags[FLAG]); - if (rowid == nullptr || flag == nullptr) { + int64_t *timeStamp = std::get_if(&flags[TIMESTAMP]); + if (rowid == nullptr || flag == nullptr || timeStamp == nullptr) { return -E_INVALID_DATA; } if ((static_cast(*flag) & DataItem::DELETE_FLAG) != 0) { @@ -539,6 +543,13 @@ int IdentifyCloudType(CloudSyncData &cloudSyncData, VBucket &data, VBucket &log, } else { if (!data.empty()) { cloudSyncData.updData.record.push_back(data); + VBucket asset; + CloudStorageUtils::ObtainAssetFromVBucket(data, asset); + if (!asset.empty()) { + cloudSyncData.updData.rowid.push_back(*rowid); + cloudSyncData.updData.timestamp.push_back(*timeStamp); + cloudSyncData.updData.assets.push_back(asset); + } } cloudSyncData.updData.extend.push_back(log); } diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.h b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.h index 13cb7fadb42..b969f976280 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.h +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_executor.h @@ -109,6 +109,8 @@ public: int DoCleanInner(ClearMode mode, const std::vector &tableNameList, const std::vector &tableSchemaList, std::vector &assets); + int FillCloudAssetForUpload(const CloudSyncData &data); + private: int DoCleanLogs(const std::vector &tableNameList); @@ -187,8 +189,10 @@ private: int GetQueryLogRowid(const std::string &tableName, const VBucket &vBucket, int64_t &rowId); - int GetFillAssetStatement(const std::string &tableName, const VBucket &vBucket, const std::vector &fields, - bool isFullReplace, sqlite3_stmt *&statement); + int GetFillDownloadAssetStatement(const std::string &tableName, const VBucket &vBucket, + const std::vector &fields, bool isFullReplace, sqlite3_stmt *&statement); + + int GetFillUploadAssetStatement(const std::string &tableName, const VBucket &vBucket, sqlite3_stmt *&statement); int CalculateHashKeyForOneField(const Field &field, const VBucket &vBucket, std::vector &hashValue); diff --git a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_extend_executor.cpp b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_extend_executor.cpp index 195a33632ce..76e9317a1eb 100644 --- a/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_extend_executor.cpp +++ b/frameworks/libs/distributeddb/storage/src/sqlite/sqlite_single_ver_relational_storage_extend_executor.cpp @@ -91,7 +91,7 @@ int SQLiteSingleVerRelationalStorageExecutor::GetQueryLogRowid(const std::string return errCode; } -int SQLiteSingleVerRelationalStorageExecutor::GetFillAssetStatement(const std::string &tableName, +int SQLiteSingleVerRelationalStorageExecutor::GetFillDownloadAssetStatement(const std::string &tableName, const VBucket &vBucket, const std::vector &fields, bool isFullReplace, sqlite3_stmt *&statement) { std::string sql = "UPDATE " + tableName + " SET "; @@ -141,7 +141,7 @@ int SQLiteSingleVerRelationalStorageExecutor::FillCloudAsset(const TableSchema & if (errCode != E_OK) { goto END; } - errCode = GetFillAssetStatement(tableSchema.name, vBucket, assetsField, isFullReplace, stmt); + errCode = GetFillDownloadAssetStatement(tableSchema.name, vBucket, assetsField, isFullReplace, stmt); if (errCode != E_OK) { goto END; } @@ -165,5 +165,71 @@ END: } return errCode; } + +int SQLiteSingleVerRelationalStorageExecutor::FillCloudAssetForUpload(const CloudSyncData &data) +{ + if (data.updData.assets.empty() || data.updData.rowid.empty() || data.updData.timestamp.empty()) { + return -E_INVALID_ARGS; + } + if (data.updData.assets.size() != data.updData.rowid.size() || + data.updData.assets.size() != data.updData.timestamp.size()) { + return -E_INVALID_ARGS; + } + sqlite3_stmt *stmt = nullptr; + int errCode = E_OK; + for (size_t i = 0; i < data.updData.assets.size(); ++i) { + errCode = GetFillUploadAssetStatement(data.tableName, data.updData.assets[i], stmt); + if (errCode != E_OK) { + return errCode; + } + int64_t rowid = data.updData.rowid[i]; + errCode = SQLiteUtils::BindInt64ToStatement(stmt, data.updData.assets[i].size() + 1, rowid); + if (errCode != E_OK) { + break; + } + int64_t timeStamp = data.updData.timestamp[i]; + errCode = SQLiteUtils::BindInt64ToStatement(stmt, data.updData.assets[i].size() + 2, timeStamp); // timeStamp + if (errCode != E_OK) { + break; + } + errCode = SQLiteUtils::StepWithRetry(stmt, false); + if (errCode == SQLiteUtils::MapSQLiteErrno(SQLITE_DONE)) { + errCode = E_OK; + SQLiteUtils::ResetStatement(stmt, false, errCode); + } else { + LOGE("Fill upload asset failed:%d", errCode); + break; + } + } + SQLiteUtils::ResetStatement(stmt, true, errCode); + return E_OK; +} + +int SQLiteSingleVerRelationalStorageExecutor::GetFillUploadAssetStatement(const std::string &tableName, + const VBucket &vBucket, sqlite3_stmt *&statement) +{ + std::string sql = "UPDATE " + DBCommon::GetLogTableName(tableName) + " SET "; + for (const auto &item: vBucket) { + sql += item.first + " = ?,"; + } + sql.pop_back(); + sql += " WHERE rowid = ? and timestamp = ?;"; + int errCode = SQLiteUtils::GetStatement(dbHandle_, sql, statement); + if (errCode != E_OK) { + return errCode; + } + int index = 1; + for (const auto &item: vBucket) { + Field field = { + .colName = item.first, .type = static_cast(item.second.index()) + }; + errCode = bindCloudFieldFuncMap_[item.second.index()](index++, vBucket, field, statement); + if (errCode != E_OK) { + SQLiteUtils::ResetStatement(statement, true, errCode); + return errCode; + } + } + return errCode; +} } // namespace DistributedDB #endif \ No newline at end of file diff --git a/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp b/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp index f9c01a16d80..4e5d7e4b7e1 100644 --- a/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp +++ b/frameworks/libs/distributeddb/storage/src/storage_proxy.cpp @@ -311,12 +311,21 @@ int StorageProxy::NotifyChangedData(const std::string deviceName, ChangedData && return E_OK; } -int StorageProxy::FillCloudAsset(const std::string &tableName, VBucket &asset, bool isFullReplace) +int StorageProxy::FillCloudAssetForDownload(const std::string &tableName, VBucket &asset, bool isFullReplace) { std::shared_lock readLock(storeMutex_); if (store_ == nullptr) { return -E_INVALID_DB; } - return store_->FillCloudAsset(tableName, asset, isFullReplace); + return store_->FillCloudAssetForDownload(tableName, asset, isFullReplace); +} + +int StorageProxy::FillCloudAssetForUpload(const CloudSyncData &data) +{ + std::shared_lock readLock(storeMutex_); + if (store_ == nullptr) { + return -E_INVALID_DB; + } + return store_->FillCloudAssetForUpload(data); } } diff --git a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp index b8ad7480491..a00fd1222aa 100644 --- a/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp +++ b/frameworks/libs/distributeddb/syncer/src/cloud/cloud_syncer.cpp @@ -627,13 +627,13 @@ int CloudSyncer::FillCloudAssets( { int ret = E_OK; if (!normalAssets.empty() && normalAssets.size() > 1) { - ret = storageProxy_->FillCloudAsset(tableName, normalAssets, true); + ret = storageProxy_->FillCloudAssetForDownload(tableName, normalAssets, true); if (ret != E_OK) { return ret; } } if (!failedAssets.empty() && failedAssets.size() > 1) { - ret = storageProxy_->FillCloudAsset(tableName, failedAssets, false); + ret = storageProxy_->FillCloudAssetForDownload(tableName, failedAssets, false); if (ret != E_OK) { return ret; } diff --git a/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_relational_cloud_syncable_storage_test.cpp b/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_relational_cloud_syncable_storage_test.cpp index 224fd2622ed..f8f1f201517 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_relational_cloud_syncable_storage_test.cpp +++ b/frameworks/libs/distributeddb/test/unittest/common/storage/distributeddb_relational_cloud_syncable_storage_test.cpp @@ -254,7 +254,7 @@ void fillCloudAssetTest(int64_t count, AssetStatus statusType, bool isFullReplac vBucket["assert"] = asset; vBucket["asserts"] = assets; ASSERT_EQ(g_storageProxy->StartTransaction(), E_OK); - ASSERT_EQ(g_storageProxy->FillCloudAsset(g_tableName, vBucket, isFullReplace), E_OK); + ASSERT_EQ(g_storageProxy->FillCloudAssetForDownload(g_tableName, vBucket, isFullReplace), E_OK); ASSERT_EQ(g_storageProxy->Rollback(), E_OK); } } diff --git a/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h b/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h index 1e2858b02db..aed113e826d 100644 --- a/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h +++ b/frameworks/libs/distributeddb/test/unittest/common/syncer/cloud/mock_icloud_sync_storage_interface.h @@ -38,9 +38,10 @@ public: MOCK_METHOD4(GetInfoByPrimaryKeyOrGid, int(const std::string &, const VBucket &, DataInfoWithLog &, VBucket &)); MOCK_METHOD2(PutCloudSyncData, int(const std::string &, DownloadData &)); MOCK_METHOD3(TriggerObserverAction, void(const std::string &, ChangedData &&, bool)); - MOCK_METHOD3(FillCloudAsset, int(const std::string &, VBucket &, bool)); MOCK_METHOD3(CleanCloudData, int(ClearMode mode, const std::vector &tableNameList, std::vector &assets)); + MOCK_METHOD3(FillCloudAssetForDownload, int(const std::string &, VBucket &, bool)); + MOCK_METHOD1(FillCloudAssetForUpload, int(const CloudSyncData &)); }; } -- Gitee