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 #include "sync_config.h"
16 namespace DistributedDB {
17 const AbilityItem SyncConfig::DATABASE_COMPRESSION_ZLIB = {0, 1};
18 const AbilityItem SyncConfig::ALLPREDICATEQUERY = {1, 1}; // 0b10 {1: start at second bit, 1: 1 bit len}
19 const AbilityItem SyncConfig::SUBSCRIBEQUERY = {2, 1}; //   0b100
20 const AbilityItem SyncConfig::INKEYS_QUERY = {3, 1}; //    0b1000
21 
22 const std::vector<AbilityItem> SyncConfig::ABILITYBITS = {
23     DATABASE_COMPRESSION_ZLIB,
24     ALLPREDICATEQUERY,
25     SUBSCRIBEQUERY,
26     INKEYS_QUERY};
27 
28 const std::map<const uint8_t, const AbilityItem> SyncConfig::COMPRESSALGOMAP = {
29     {static_cast<uint8_t>(CompressAlgorithm::ZLIB), DATABASE_COMPRESSION_ZLIB},
30 };
31 } // DistributedDB