• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "single_ver_kv_sync_task_context.h"
17 
18 namespace DistributedDB {
SingleVerKvSyncTaskContext()19 SingleVerKvSyncTaskContext::SingleVerKvSyncTaskContext()
20     : SingleVerSyncTaskContext(), syncStrategy_{}
21 {}
22 
~SingleVerKvSyncTaskContext()23 SingleVerKvSyncTaskContext::~SingleVerKvSyncTaskContext()
24 {
25 }
26 
GetQuerySyncId() const27 std::string SingleVerKvSyncTaskContext::GetQuerySyncId() const
28 {
29     return query_.GetIdentify();
30 }
31 
GetDeleteSyncId() const32 std::string SingleVerKvSyncTaskContext::GetDeleteSyncId() const
33 {
34     return GetDeviceId();
35 }
36 
SetSyncStrategy(const SyncStrategy & strategy)37 void SingleVerKvSyncTaskContext::SetSyncStrategy(const SyncStrategy &strategy)
38 {
39     syncStrategy_.permitSync = strategy.permitSync;
40     syncStrategy_.convertOnSend = strategy.convertOnSend;
41     syncStrategy_.convertOnReceive = strategy.convertOnReceive;
42     syncStrategy_.checkOnReceive = strategy.checkOnReceive;
43 }
44 
GetSyncStrategy(QuerySyncObject & querySyncObject) const45 SyncStrategy SingleVerKvSyncTaskContext::GetSyncStrategy(QuerySyncObject &querySyncObject) const
46 {
47     (void) querySyncObject;
48     return syncStrategy_;
49 }
50 }