!1802 添加search触发事件

Merge pull request !1802 from wangjiaqiang/master
This commit is contained in:
openharmony_ci 2024-10-13 11:27:34 +00:00 committed by Gitee
commit 49c6630221
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 10 additions and 6 deletions

View File

@ -41,7 +41,7 @@ public:
int32_t InitNotifier(const RdbSyncerParam &param, sptr<IRemoteObject> notifier) override;
int32_t SetDistributedTables(const RdbSyncerParam &param, const std::vector<std::string> &tables,
const std::vector<Reference> &references, int32_t type = DISTRIBUTED_DEVICE) override;
const std::vector<Reference> &references, bool isRebuild, int32_t type = DISTRIBUTED_DEVICE) override;
int32_t Sync(const RdbSyncerParam& param, const Option& option,
const PredicatesMemo& predicates, const AsyncDetail &async) override;

View File

@ -177,11 +177,12 @@ int32_t RdbServiceProxy::DoAsync(const RdbSyncerParam& param, const Option &opti
}
int32_t RdbServiceProxy::SetDistributedTables(const RdbSyncerParam& param, const std::vector<std::string> &tables,
const std::vector<Reference> &references, int32_t type)
const std::vector<Reference> &references, bool isRebuild, int32_t type)
{
MessageParcel reply;
int32_t status = IPC_SEND(
static_cast<uint32_t>(RdbServiceCode::RDB_SERVICE_CMD_SET_DIST_TABLE), reply, param, tables, references, type);
static_cast<uint32_t>(RdbServiceCode::RDB_SERVICE_CMD_SET_DIST_TABLE), reply, param, tables, references,
type, isRebuild);
if (status != RDB_OK) {
LOG_ERROR("status:%{public}d, bundleName:%{public}s, storeName:%{public}s, type:%{public}d",
status, param.bundleName_.c_str(), SqliteUtils::Anonymous(param.storeName_).c_str(), type);

View File

@ -1932,7 +1932,8 @@ int RdbStoreImpl::SetDistributedTables(const std::vector<std::string> &tables, i
if (errCode != E_OK) {
return errCode;
}
int32_t errorCode = service->SetDistributedTables(syncerParam_, tables, distributedConfig.references, type);
int32_t errorCode = service->SetDistributedTables(syncerParam_, tables, distributedConfig.references,
distributedConfig.isRebuild, type);
if (errorCode != E_OK) {
LOG_ERROR("Fail to set distributed tables, error=%{public}d", errorCode);
return errorCode;

View File

@ -42,7 +42,7 @@ public:
virtual int32_t SetDistributedTables(
const RdbSyncerParam &param, const std::vector<std::string> &tables,
const std::vector<Reference> &references, int32_t type = DISTRIBUTED_DEVICE) = 0;
const std::vector<Reference> &references, bool isRebuild, int32_t type = DISTRIBUTED_DEVICE) = 0;
virtual int32_t Sync(const RdbSyncerParam &param, const Option &option, const PredicatesMemo &predicates,
const AsyncDetail &async) = 0;

View File

@ -95,7 +95,8 @@ struct SyncOption {
enum DistributedTableType {
DISTRIBUTED_DEVICE = 0,
DISTRIBUTED_CLOUD
DISTRIBUTED_CLOUD,
DISTRIBUTED_SEARCH
};
struct Reference {
@ -107,6 +108,7 @@ struct Reference {
struct DistributedConfig {
bool autoSync = true;
std::vector<Reference> references = {};
bool isRebuild = false;
};
enum Progress {