mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-23 07:00:41 +00:00
commit
49c6630221
@ -41,7 +41,7 @@ public:
|
||||
int32_t InitNotifier(const RdbSyncerParam ¶m, sptr<IRemoteObject> notifier) override;
|
||||
|
||||
int32_t SetDistributedTables(const RdbSyncerParam ¶m, 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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
|
||||
virtual int32_t SetDistributedTables(
|
||||
const RdbSyncerParam ¶m, 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 ¶m, const Option &option, const PredicatesMemo &predicates,
|
||||
const AsyncDetail &async) = 0;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user