Compare commits
No commits in common. "9fa94c2cdf805828642f1f7b3e670cc875791902" and "f938971c2d0bf95f46cd166bb411734a3b8a5503" have entirely different histories.
9fa94c2cdf
...
f938971c2d
File diff suppressed because it is too large
Load Diff
@ -1,543 +0,0 @@
|
|||||||
From 6a40f67e7cb56c491bec6089b940ad35f6594aea Mon Sep 17 00:00:00 2001
|
|
||||||
From: muyuying1 <muyuying1@huawei.com>
|
|
||||||
Date: Thu, 3 Aug 2023 17:01:05 +0800
|
|
||||||
Subject: [PATCH] =?UTF-8?q?=E8=A3=81=E5=89=AAhitrace=E5=92=8Chisysevent?=
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
---
|
|
||||||
frameworks/common/dds_trace.h | 115 +++++++++---------
|
|
||||||
.../src/distributed_kv_data_manager.cpp | 26 ++--
|
|
||||||
.../src/kvstore_sync_callback_client.cpp | 2 +-
|
|
||||||
.../kvdb/src/single_store_impl.cpp | 62 +++++-----
|
|
||||||
.../common/src/db_dfx_adapter.cpp | 4 +-
|
|
||||||
5 files changed, 105 insertions(+), 104 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/frameworks/common/dds_trace.h b/frameworks/common/dds_trace.h
|
|
||||||
index a80b19d..2370a19 100644
|
|
||||||
--- a/frameworks/common/dds_trace.h
|
|
||||||
+++ b/frameworks/common/dds_trace.h
|
|
||||||
@@ -16,13 +16,13 @@
|
|
||||||
#ifndef DDS_TRACE_H
|
|
||||||
#define DDS_TRACE_H
|
|
||||||
|
|
||||||
-#include <atomic>
|
|
||||||
-#include <cinttypes>
|
|
||||||
-#include <string>
|
|
||||||
-#include <functional>
|
|
||||||
-#include <chrono>
|
|
||||||
-#include "hitrace/trace.h"
|
|
||||||
-#include "hitrace_meter.h"
|
|
||||||
+// #include <atomic>
|
|
||||||
+// #include <cinttypes>
|
|
||||||
+// #include <string>
|
|
||||||
+// #include <functional>
|
|
||||||
+// #include <chrono>
|
|
||||||
+// // #include "hitrace/trace.h"
|
|
||||||
+// // #include "hitrace_meter.h"
|
|
||||||
namespace OHOS {
|
|
||||||
namespace DistributedDataDfx {
|
|
||||||
enum TraceSwitch {
|
|
||||||
@@ -31,58 +31,59 @@ enum TraceSwitch {
|
|
||||||
API_PERFORMANCE_TRACE_ON = 0x02,
|
|
||||||
TRACE_CHAIN_ON = 0x04,
|
|
||||||
};
|
|
||||||
-class __attribute__((visibility("hidden"))) DdsTrace {
|
|
||||||
-public:
|
|
||||||
- using Action = std::function<void(const std::string &value, uint64_t delta)>;
|
|
||||||
- using System = std::chrono::system_clock;
|
|
||||||
- DdsTrace(const std::string &value, unsigned int option = BYTRACE_ON, Action action = nullptr)
|
|
||||||
- {
|
|
||||||
- traceSwitch_ = option;
|
|
||||||
- traceValue_ = value;
|
|
||||||
- action_ = action;
|
|
||||||
- static std::atomic_bool enable = false;
|
|
||||||
- if (!enable.exchange(true)) {
|
|
||||||
- UpdateTraceLabel();
|
|
||||||
- }
|
|
||||||
- Start(value);
|
|
||||||
- }
|
|
||||||
+// class __attribute__((visibility("hidden"))) DdsTrace {
|
|
||||||
+// public:
|
|
||||||
+// using Action = std::function<void(const std::string &value, uint64_t delta)>;
|
|
||||||
+// using System = std::chrono::system_clock;
|
|
||||||
+// DdsTrace(const std::string &value, unsigned int option = BYTRACE_ON, Action action = nullptr)
|
|
||||||
+// {
|
|
||||||
+// traceSwitch_ = option;
|
|
||||||
+// traceValue_ = value;
|
|
||||||
+// action_ = action;
|
|
||||||
+// static std::atomic_bool enable = false;
|
|
||||||
+// // if (!enable.exchange(true)) {
|
|
||||||
+// // UpdateTraceLabel();
|
|
||||||
+// // }
|
|
||||||
+// Start(value);
|
|
||||||
+// }
|
|
||||||
|
|
||||||
- ~DdsTrace()
|
|
||||||
- {
|
|
||||||
- Finish(traceValue_);
|
|
||||||
- }
|
|
||||||
+// ~DdsTrace()
|
|
||||||
+// {
|
|
||||||
+// Finish(traceValue_);
|
|
||||||
+// }
|
|
||||||
|
|
||||||
-private:
|
|
||||||
- void Start(const std::string &value)
|
|
||||||
- {
|
|
||||||
- if ((traceSwitch_ & BYTRACE_ON) == BYTRACE_ON) {
|
|
||||||
- StartTrace(HITRACE_TAG_DISTRIBUTEDDATA, value);
|
|
||||||
- }
|
|
||||||
- if ((traceSwitch_ & TRACE_CHAIN_ON) == TRACE_CHAIN_ON) {
|
|
||||||
- traceId_ = OHOS::HiviewDFX::HiTraceChain::Begin(value, HITRACE_FLAG_DEFAULT);
|
|
||||||
- }
|
|
||||||
- if ((traceSwitch_ & API_PERFORMANCE_TRACE_ON) == API_PERFORMANCE_TRACE_ON) {
|
|
||||||
- lastTime_ = System::now();
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- void Finish(const std::string &value)
|
|
||||||
- {
|
|
||||||
- if ((traceSwitch_ & BYTRACE_ON) == BYTRACE_ON) {
|
|
||||||
- FinishTrace(HITRACE_TAG_DISTRIBUTEDDATA);
|
|
||||||
- }
|
|
||||||
- if ((traceSwitch_ & TRACE_CHAIN_ON) == TRACE_CHAIN_ON) {
|
|
||||||
- OHOS::HiviewDFX::HiTraceChain::End(traceId_);
|
|
||||||
- }
|
|
||||||
- if ((traceSwitch_ & API_PERFORMANCE_TRACE_ON) == API_PERFORMANCE_TRACE_ON && action_) {
|
|
||||||
- action_(value, std::chrono::duration_cast<std::chrono::milliseconds>(System::now() - lastTime_).count());
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
- Action action_;
|
|
||||||
- std::string traceValue_{ };
|
|
||||||
- HiviewDFX::HiTraceId traceId_;
|
|
||||||
- uint32_t traceSwitch_{ 0 };
|
|
||||||
- System::time_point lastTime_;
|
|
||||||
-};
|
|
||||||
+// private:
|
|
||||||
+// void Start(const std::string &value)
|
|
||||||
+// {
|
|
||||||
+// // if ((traceSwitch_ & BYTRACE_ON) == BYTRACE_ON) {
|
|
||||||
+// // StartTrace(HITRACE_TAG_DISTRIBUTEDDATA, value);
|
|
||||||
+// // }
|
|
||||||
+// // if ((traceSwitch_ & TRACE_CHAIN_ON) == TRACE_CHAIN_ON) {
|
|
||||||
+// // traceId_ = OHOS::HiviewDFX::HiTraceChain::Begin(value, HITRACE_FLAG_DEFAULT);
|
|
||||||
+// // }
|
|
||||||
+// if ((traceSwitch_ & API_PERFORMANCE_TRACE_ON) == API_PERFORMANCE_TRACE_ON) {
|
|
||||||
+// lastTime_ = System::now();
|
|
||||||
+// }
|
|
||||||
+// }
|
|
||||||
+// void Finish(const std::string &value)
|
|
||||||
+// {
|
|
||||||
+// // if ((traceSwitch_ & BYTRACE_ON) == BYTRACE_ON) {
|
|
||||||
+// // FinishTrace(HITRACE_TAG_DISTRIBUTEDDATA);
|
|
||||||
+// // }
|
|
||||||
+// // if ((traceSwitch_ & TRACE_CHAIN_ON) == TRACE_CHAIN_ON) {
|
|
||||||
+// // OHOS::HiviewDFX::HiTraceChain::End(traceId_);
|
|
||||||
+// // }
|
|
||||||
+// if ((traceSwitch_ & API_PERFORMANCE_TRACE_ON) == API_PERFORMANCE_TRACE_ON && action_) {
|
|
||||||
+// action_(value, std::chrono::duration_cast<std::chrono::milliseconds>(System::now() - lastTime_).count());
|
|
||||||
+// }
|
|
||||||
+// }
|
|
||||||
+// Action action_;
|
|
||||||
+// std::string traceValue_{ };
|
|
||||||
+// // HiviewDFX::HiTraceId traceId_;
|
|
||||||
+// uint32_t traceSwitch_{ 0 };
|
|
||||||
+// System::time_point lastTime_;
|
|
||||||
+// };
|
|
||||||
} // namespace DistributedDataDfx
|
|
||||||
} // namespace OHOS
|
|
||||||
+
|
|
||||||
#endif
|
|
||||||
diff --git a/frameworks/innerkitsimpl/distributeddatafwk/src/distributed_kv_data_manager.cpp b/frameworks/innerkitsimpl/distributeddatafwk/src/distributed_kv_data_manager.cpp
|
|
||||||
index 73e0fb3..85faa27 100644
|
|
||||||
--- a/frameworks/innerkitsimpl/distributeddatafwk/src/distributed_kv_data_manager.cpp
|
|
||||||
+++ b/frameworks/innerkitsimpl/distributeddatafwk/src/distributed_kv_data_manager.cpp
|
|
||||||
@@ -36,8 +36,8 @@ DistributedKvDataManager::~DistributedKvDataManager()
|
|
||||||
Status DistributedKvDataManager::GetSingleKvStore(const Options &options, const AppId &appId, const StoreId &storeId,
|
|
||||||
std::shared_ptr<SingleKvStore> &singleKvStore)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
- TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
+ // TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
|
|
||||||
singleKvStore = nullptr;
|
|
||||||
if (!storeId.IsValid()) {
|
|
||||||
@@ -57,7 +57,7 @@ Status DistributedKvDataManager::GetSingleKvStore(const Options &options, const
|
|
||||||
|
|
||||||
Status DistributedKvDataManager::GetAllKvStoreId(const AppId &appId, std::vector<StoreId> &storeIds)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
|
|
||||||
KvStoreServiceDeathNotifier::SetAppId(appId);
|
|
||||||
return StoreManager::GetInstance().GetStoreIds(appId, storeIds);
|
|
||||||
@@ -65,8 +65,8 @@ Status DistributedKvDataManager::GetAllKvStoreId(const AppId &appId, std::vector
|
|
||||||
|
|
||||||
Status DistributedKvDataManager::CloseKvStore(const AppId &appId, const StoreId &storeId)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
- TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
+ // TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
|
|
||||||
KvStoreServiceDeathNotifier::SetAppId(appId);
|
|
||||||
if (!storeId.IsValid()) {
|
|
||||||
@@ -79,8 +79,8 @@ Status DistributedKvDataManager::CloseKvStore(const AppId &appId, const StoreId
|
|
||||||
|
|
||||||
Status DistributedKvDataManager::CloseKvStore(const AppId &appId, std::shared_ptr<SingleKvStore> &kvStorePtr)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
- TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
+ // TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
|
|
||||||
if (kvStorePtr == nullptr) {
|
|
||||||
ZLOGE("kvStorePtr is nullptr.");
|
|
||||||
@@ -95,8 +95,8 @@ Status DistributedKvDataManager::CloseKvStore(const AppId &appId, std::shared_pt
|
|
||||||
|
|
||||||
Status DistributedKvDataManager::CloseAllKvStore(const AppId &appId)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
- TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
+ // TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
|
|
||||||
KvStoreServiceDeathNotifier::SetAppId(appId);
|
|
||||||
return StoreManager::GetInstance().CloseAllKVStore(appId);
|
|
||||||
@@ -104,8 +104,8 @@ Status DistributedKvDataManager::CloseAllKvStore(const AppId &appId)
|
|
||||||
|
|
||||||
Status DistributedKvDataManager::DeleteKvStore(const AppId &appId, const StoreId &storeId, const std::string &path)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
- TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
+ // TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
|
|
||||||
if (!storeId.IsValid()) {
|
|
||||||
ZLOGE("invalid storeId.");
|
|
||||||
@@ -122,8 +122,8 @@ Status DistributedKvDataManager::DeleteKvStore(const AppId &appId, const StoreId
|
|
||||||
|
|
||||||
Status DistributedKvDataManager::DeleteAllKvStore(const AppId &appId, const std::string &path)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
- TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__),
|
|
||||||
+ // TraceSwitch::BYTRACE_ON | TraceSwitch::TRACE_CHAIN_ON);
|
|
||||||
if (path.empty()) {
|
|
||||||
ZLOGE("path empty");
|
|
||||||
return Status::INVALID_ARGUMENT;
|
|
||||||
diff --git a/frameworks/innerkitsimpl/distributeddatafwk/src/kvstore_sync_callback_client.cpp b/frameworks/innerkitsimpl/distributeddatafwk/src/kvstore_sync_callback_client.cpp
|
|
||||||
index 5e70f0d..75b7846 100644
|
|
||||||
--- a/frameworks/innerkitsimpl/distributeddatafwk/src/kvstore_sync_callback_client.cpp
|
|
||||||
+++ b/frameworks/innerkitsimpl/distributeddatafwk/src/kvstore_sync_callback_client.cpp
|
|
||||||
@@ -31,7 +31,7 @@ KvStoreSyncCallbackClient::~KvStoreSyncCallbackClient()
|
|
||||||
|
|
||||||
void KvStoreSyncCallbackClient::SyncCompleted(const std::map<std::string, Status> &results, uint64_t sequenceId)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), TraceSwitch::BYTRACE_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), TraceSwitch::BYTRACE_ON);
|
|
||||||
auto finded = syncCallbackInfo_.Find(sequenceId);
|
|
||||||
if (finded.first) {
|
|
||||||
finded.second->SyncCompleted(results);
|
|
||||||
diff --git a/frameworks/innerkitsimpl/kvdb/src/single_store_impl.cpp b/frameworks/innerkitsimpl/kvdb/src/single_store_impl.cpp
|
|
||||||
index a82529f..6826238 100644
|
|
||||||
--- a/frameworks/innerkitsimpl/kvdb/src/single_store_impl.cpp
|
|
||||||
+++ b/frameworks/innerkitsimpl/kvdb/src/single_store_impl.cpp
|
|
||||||
@@ -64,7 +64,7 @@ StoreId SingleStoreImpl::GetStoreId() const
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Put(const Key &key, const Value &value)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -90,7 +90,7 @@ Status SingleStoreImpl::Put(const Key &key, const Value &value)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::PutBatch(const std::vector<Entry> &entries)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -120,7 +120,7 @@ Status SingleStoreImpl::PutBatch(const std::vector<Entry> &entries)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Delete(const Key &key)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -144,7 +144,7 @@ Status SingleStoreImpl::Delete(const Key &key)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::DeleteBatch(const std::vector<Key> &keys)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -172,7 +172,7 @@ Status SingleStoreImpl::DeleteBatch(const std::vector<Key> &keys)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::StartTransaction()
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -189,7 +189,7 @@ Status SingleStoreImpl::StartTransaction()
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Commit()
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -206,7 +206,7 @@ Status SingleStoreImpl::Commit()
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Rollback()
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -223,7 +223,7 @@ Status SingleStoreImpl::Rollback()
|
|
||||||
|
|
||||||
Status SingleStoreImpl::SubscribeKvStore(SubscribeType type, std::shared_ptr<Observer> observer)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -262,7 +262,7 @@ Status SingleStoreImpl::SubscribeKvStore(SubscribeType type, std::shared_ptr<Obs
|
|
||||||
|
|
||||||
Status SingleStoreImpl::UnSubscribeKvStore(SubscribeType type, std::shared_ptr<Observer> observer)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -300,7 +300,7 @@ Status SingleStoreImpl::UnSubscribeKvStore(SubscribeType type, std::shared_ptr<O
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Get(const Key &key, Value &value)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -325,7 +325,7 @@ Status SingleStoreImpl::Get(const Key &key, Value &value)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetEntries(const Key &prefix, std::vector<Entry> &entries) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
DBKey dbPrefix = convertor_.GetPrefix(prefix);
|
|
||||||
if (dbPrefix.empty() && !prefix.Empty()) {
|
|
||||||
ZLOGE("invalid prefix:%{public}s size:%{public}zu", StoreUtil::Anonymous(prefix.ToString()).c_str(),
|
|
||||||
@@ -344,7 +344,7 @@ Status SingleStoreImpl::GetEntries(const Key &prefix, std::vector<Entry> &entrie
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetEntries(const DataQuery &query, std::vector<Entry> &entries) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
DBQuery dbQuery = convertor_.GetDBQuery(query);
|
|
||||||
auto status = GetEntries(dbQuery, entries);
|
|
||||||
if (status != SUCCESS) {
|
|
||||||
@@ -355,7 +355,7 @@ Status SingleStoreImpl::GetEntries(const DataQuery &query, std::vector<Entry> &e
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetResultSet(const Key &prefix, std::shared_ptr<ResultSet> &resultSet) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
DBKey dbPrefix = convertor_.GetPrefix(prefix);
|
|
||||||
if (dbPrefix.empty() && !prefix.Empty()) {
|
|
||||||
ZLOGE("invalid prefix:%{public}s size:%{public}zu", StoreUtil::Anonymous(prefix.ToString()).c_str(),
|
|
||||||
@@ -374,7 +374,7 @@ Status SingleStoreImpl::GetResultSet(const Key &prefix, std::shared_ptr<ResultSe
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetResultSet(const DataQuery &query, std::shared_ptr<ResultSet> &resultSet) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
DBQuery dbQuery = convertor_.GetDBQuery(query);
|
|
||||||
auto status = GetResultSet(dbQuery, resultSet);
|
|
||||||
if (status != SUCCESS) {
|
|
||||||
@@ -385,7 +385,7 @@ Status SingleStoreImpl::GetResultSet(const DataQuery &query, std::shared_ptr<Res
|
|
||||||
|
|
||||||
Status SingleStoreImpl::CloseResultSet(std::shared_ptr<ResultSet> &resultSet)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
if (resultSet == nullptr) {
|
|
||||||
ZLOGE("input is nullptr");
|
|
||||||
return INVALID_ARGUMENT;
|
|
||||||
@@ -401,7 +401,7 @@ Status SingleStoreImpl::CloseResultSet(std::shared_ptr<ResultSet> &resultSet)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetCount(const DataQuery &query, int &result) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -419,7 +419,7 @@ Status SingleStoreImpl::GetCount(const DataQuery &query, int &result) const
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetSecurityLevel(SecurityLevel &secLevel) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -438,7 +438,7 @@ Status SingleStoreImpl::GetSecurityLevel(SecurityLevel &secLevel) const
|
|
||||||
|
|
||||||
Status SingleStoreImpl::RemoveDeviceData(const std::string &device)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
std::shared_lock<decltype(rwMutex_)> lock(rwMutex_);
|
|
||||||
if (dbStore_ == nullptr) {
|
|
||||||
ZLOGE("db:%{public}s already closed!", storeId_.c_str());
|
|
||||||
@@ -464,7 +464,7 @@ Status SingleStoreImpl::RemoveDeviceData(const std::string &device)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Sync(const std::vector<std::string> &devices, SyncMode mode, uint32_t delay)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
KVDBService::SyncInfo syncInfo;
|
|
||||||
syncInfo.seqId = StoreUtil::GenSequenceId();
|
|
||||||
syncInfo.mode = mode;
|
|
||||||
@@ -476,7 +476,7 @@ Status SingleStoreImpl::Sync(const std::vector<std::string> &devices, SyncMode m
|
|
||||||
Status SingleStoreImpl::Sync(const std::vector<std::string> &devices, SyncMode mode, const DataQuery &query,
|
|
||||||
std::shared_ptr<SyncCallback> syncCallback)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
KVDBService::SyncInfo syncInfo;
|
|
||||||
syncInfo.seqId = StoreUtil::GenSequenceId();
|
|
||||||
syncInfo.mode = mode;
|
|
||||||
@@ -487,7 +487,7 @@ Status SingleStoreImpl::Sync(const std::vector<std::string> &devices, SyncMode m
|
|
||||||
|
|
||||||
Status SingleStoreImpl::RegisterSyncCallback(std::shared_ptr<SyncCallback> callback)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), TraceSwitch::BYTRACE_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), TraceSwitch::BYTRACE_ON);
|
|
||||||
if (callback == nullptr) {
|
|
||||||
ZLOGW("INVALID_ARGUMENT.");
|
|
||||||
return INVALID_ARGUMENT;
|
|
||||||
@@ -498,14 +498,14 @@ Status SingleStoreImpl::RegisterSyncCallback(std::shared_ptr<SyncCallback> callb
|
|
||||||
|
|
||||||
Status SingleStoreImpl::UnRegisterSyncCallback()
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), TraceSwitch::BYTRACE_ON);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), TraceSwitch::BYTRACE_ON);
|
|
||||||
syncObserver_->Clean();
|
|
||||||
return SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
Status SingleStoreImpl::SetSyncParam(const KvSyncParam &syncParam)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
auto service = KVDBServiceClient::GetInstance();
|
|
||||||
if (service == nullptr) {
|
|
||||||
return SERVER_UNAVAILABLE;
|
|
||||||
@@ -515,7 +515,7 @@ Status SingleStoreImpl::SetSyncParam(const KvSyncParam &syncParam)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::GetSyncParam(KvSyncParam &syncParam)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
auto service = KVDBServiceClient::GetInstance();
|
|
||||||
if (service == nullptr) {
|
|
||||||
return SERVER_UNAVAILABLE;
|
|
||||||
@@ -525,7 +525,7 @@ Status SingleStoreImpl::GetSyncParam(KvSyncParam &syncParam)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::SetCapabilityEnabled(bool enabled) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
auto service = KVDBServiceClient::GetInstance();
|
|
||||||
if (service == nullptr) {
|
|
||||||
return SERVER_UNAVAILABLE;
|
|
||||||
@@ -539,7 +539,7 @@ Status SingleStoreImpl::SetCapabilityEnabled(bool enabled) const
|
|
||||||
Status SingleStoreImpl::SetCapabilityRange(const std::vector<std::string> &localLabels,
|
|
||||||
const std::vector<std::string> &remoteLabels) const
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
auto service = KVDBServiceClient::GetInstance();
|
|
||||||
if (service == nullptr) {
|
|
||||||
return SERVER_UNAVAILABLE;
|
|
||||||
@@ -549,7 +549,7 @@ Status SingleStoreImpl::SetCapabilityRange(const std::vector<std::string> &local
|
|
||||||
|
|
||||||
Status SingleStoreImpl::SubscribeWithQuery(const std::vector<std::string> &devices, const DataQuery &query)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
auto service = KVDBServiceClient::GetInstance();
|
|
||||||
if (service == nullptr) {
|
|
||||||
return SERVER_UNAVAILABLE;
|
|
||||||
@@ -570,7 +570,7 @@ Status SingleStoreImpl::SubscribeWithQuery(const std::vector<std::string> &devic
|
|
||||||
|
|
||||||
Status SingleStoreImpl::UnsubscribeWithQuery(const std::vector<std::string> &devices, const DataQuery &query)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__), true);
|
|
||||||
auto service = KVDBServiceClient::GetInstance();
|
|
||||||
if (service == nullptr) {
|
|
||||||
return SERVER_UNAVAILABLE;
|
|
||||||
@@ -614,7 +614,7 @@ int32_t SingleStoreImpl::Close(bool isForce)
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Backup(const std::string &file, const std::string &baseDir)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
auto status = BackupManager::GetInstance().Backup(file, baseDir, storeId_, dbStore_);
|
|
||||||
if (status != SUCCESS) {
|
|
||||||
ZLOGE("status:0x%{public}x storeId:%{public}s backup:%{public}s ", status, storeId_.c_str(), file.c_str());
|
|
||||||
@@ -624,7 +624,7 @@ Status SingleStoreImpl::Backup(const std::string &file, const std::string &baseD
|
|
||||||
|
|
||||||
Status SingleStoreImpl::Restore(const std::string &file, const std::string &baseDir)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
auto status = BackupManager::GetInstance().Restore(file, baseDir, appId_, storeId_, dbStore_);
|
|
||||||
if (status != SUCCESS) {
|
|
||||||
ZLOGE("status:0x%{public}x storeId:%{public}s backup:%{public}s ", status, storeId_.c_str(), file.c_str());
|
|
||||||
@@ -635,7 +635,7 @@ Status SingleStoreImpl::Restore(const std::string &file, const std::string &base
|
|
||||||
Status SingleStoreImpl::DeleteBackup(const std::vector<std::string> &files, const std::string &baseDir,
|
|
||||||
std::map<std::string, DistributedKv::Status> &results)
|
|
||||||
{
|
|
||||||
- DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
+ // DdsTrace trace(std::string(LOG_TAG "::") + std::string(__FUNCTION__));
|
|
||||||
for (auto &file : files) {
|
|
||||||
results.emplace(file, DEVICE_NOT_FOUND);
|
|
||||||
}
|
|
||||||
diff --git a/frameworks/libs/distributeddb/common/src/db_dfx_adapter.cpp b/frameworks/libs/distributeddb/common/src/db_dfx_adapter.cpp
|
|
||||||
index 6ffcc0d..c2a9e3a 100644
|
|
||||||
--- a/frameworks/libs/distributeddb/common/src/db_dfx_adapter.cpp
|
|
||||||
+++ b/frameworks/libs/distributeddb/common/src/db_dfx_adapter.cpp
|
|
||||||
@@ -27,8 +27,8 @@
|
|
||||||
#include "runtime_context.h"
|
|
||||||
#include "sqlite_utils.h"
|
|
||||||
#ifdef USE_DFX_ABILITY
|
|
||||||
-#include "hitrace_meter.h"
|
|
||||||
-#include "hisysevent.h"
|
|
||||||
+// #include "hitrace_meter.h"
|
|
||||||
+// #include "hisysevent.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace DistributedDB {
|
|
||||||
--
|
|
||||||
2.24.3 (Apple Git-128)
|
|
||||||
|
|
||||||
@ -1,235 +0,0 @@
|
|||||||
From 740bc65fec83e5410d4fc9e5b389e8be65c943ec Mon Sep 17 00:00:00 2001
|
|
||||||
From: muyuying1 <muyuying1@huawei.com>
|
|
||||||
Date: Thu, 3 Aug 2023 17:06:02 +0800
|
|
||||||
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9compile=E7=9B=B8=E5=85=B3?=
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
---
|
|
||||||
.../include/ikvstore_data_service.h | 22 +++++-----
|
|
||||||
.../innerkitsimpl/kvdb/src/system_api.cpp | 40 +++++++++----------
|
|
||||||
.../innerkitsimpl/rdb/include/rdb_notifier.h | 4 +-
|
|
||||||
frameworks/libs/distributeddb/BUILD.gn | 6 +--
|
|
||||||
.../src/kv_store_delegate_manager.cpp | 6 +++
|
|
||||||
.../storage/src/result_entries_window.cpp | 2 +-
|
|
||||||
6 files changed, 43 insertions(+), 37 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/frameworks/innerkitsimpl/distributeddatafwk/include/ikvstore_data_service.h b/frameworks/innerkitsimpl/distributeddatafwk/include/ikvstore_data_service.h
|
|
||||||
index b67e248..af25e6b 100644
|
|
||||||
--- a/frameworks/innerkitsimpl/distributeddatafwk/include/ikvstore_data_service.h
|
|
||||||
+++ b/frameworks/innerkitsimpl/distributeddatafwk/include/ikvstore_data_service.h
|
|
||||||
@@ -64,17 +64,17 @@ private:
|
|
||||||
|
|
||||||
using RequestHandler = int32_t(KvStoreDataServiceStub::*)(MessageParcel&, MessageParcel&);
|
|
||||||
static constexpr RequestHandler HANDLERS[SERVICE_CMD_LAST] = {
|
|
||||||
- [GET_FEATURE_INTERFACE] = &KvStoreDataServiceStub::GetFeatureInterfaceOnRemote,
|
|
||||||
- [REGISTERCLIENTDEATHOBSERVER] = &KvStoreDataServiceStub::RegisterClientDeathObserverOnRemote,
|
|
||||||
- [CLOSEKVSTORE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [CLOSEALLKVSTORE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [DELETEKVSTORE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [DELETEALLKVSTORE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [GETSINGLEKVSTORE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [GETLOCALDEVICE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [GETREMOTEDEVICES] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [STARTWATCHDEVICECHANGE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
- [STOPWATCHDEVICECHANGE] = &KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [GET_FEATURE_INTERFACE] = */&KvStoreDataServiceStub::GetFeatureInterfaceOnRemote,
|
|
||||||
+ /* [REGISTERCLIENTDEATHOBSERVER] = */&KvStoreDataServiceStub::RegisterClientDeathObserverOnRemote,
|
|
||||||
+ /* [CLOSEKVSTORE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [CLOSEALLKVSTORE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [DELETEKVSTORE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [DELETEALLKVSTORE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [GETSINGLEKVSTORE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [GETLOCALDEVICE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [GETREMOTEDEVICES] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [STARTWATCHDEVICECHANGE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
+ /* [STOPWATCHDEVICECHANGE] = */&KvStoreDataServiceStub::NoSupport,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/frameworks/innerkitsimpl/kvdb/src/system_api.cpp b/frameworks/innerkitsimpl/kvdb/src/system_api.cpp
|
|
||||||
index b1d147d..f6cd62f 100644
|
|
||||||
--- a/frameworks/innerkitsimpl/kvdb/src/system_api.cpp
|
|
||||||
+++ b/frameworks/innerkitsimpl/kvdb/src/system_api.cpp
|
|
||||||
@@ -18,12 +18,12 @@
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "log_print.h"
|
|
||||||
-#include "security_label.h"
|
|
||||||
+// #include "security_label.h"
|
|
||||||
#include "store_util.h"
|
|
||||||
namespace OHOS::DistributedKv {
|
|
||||||
using Label = DistributedDB::SecurityLabel;
|
|
||||||
using Flag = DistributedDB::SecurityFlag;
|
|
||||||
-using SecurityLabel = DistributedFS::ModuleSecurityLabel::SecurityLabel;
|
|
||||||
+// using SecurityLabel = DistributedFS::ModuleSecurityLabel::SecurityLabel;
|
|
||||||
SystemApi::SystemApi()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -44,9 +44,9 @@ bool SystemApi::IsAccessControlled() const
|
|
||||||
|
|
||||||
SystemApi::DBStatus SystemApi::SetSecurityOption(const std::string &filePath, const DBOption &option)
|
|
||||||
{
|
|
||||||
- if (filePath.empty() || option.securityLabel < Label::NOT_SET || option.securityLabel > Label::S4) {
|
|
||||||
- return DBStatus::INVALID_ARGS;
|
|
||||||
- }
|
|
||||||
+ // if (filePath.empty() || option.securityLabel < Label::NOT_SET || option.securityLabel > Label::S4) {
|
|
||||||
+ // return DBStatus::INVALID_ARGS;
|
|
||||||
+ // }
|
|
||||||
|
|
||||||
struct stat curStat;
|
|
||||||
stat(filePath.c_str(), &curStat);
|
|
||||||
@@ -58,17 +58,17 @@ SystemApi::DBStatus SystemApi::SetSecurityOption(const std::string &filePath, co
|
|
||||||
return DBStatus::INVALID_ARGS;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if (option.securityLabel == Label::NOT_SET) {
|
|
||||||
- return DBStatus::OK;
|
|
||||||
- }
|
|
||||||
+ // if (option.securityLabel == Label::NOT_SET) {
|
|
||||||
+ // return DBStatus::OK;
|
|
||||||
+ // }
|
|
||||||
|
|
||||||
auto secLevel = std::string("s") + std::to_string(option.securityLabel - 1);
|
|
||||||
- bool result = SecurityLabel::SetSecurityLabel(filePath, secLevel);
|
|
||||||
- if (!result) {
|
|
||||||
- ZLOGE("set label failed! level:%{public}s, file:%{public}s", secLevel.c_str(),
|
|
||||||
- StoreUtil::Anonymous(filePath).c_str());
|
|
||||||
- return DBStatus::DB_ERROR;
|
|
||||||
- }
|
|
||||||
+ // bool result = SecurityLabel::SetSecurityLabel(filePath, secLevel);
|
|
||||||
+ // if (!result) {
|
|
||||||
+ // ZLOGE("set label failed! level:%{public}s, file:%{public}s", secLevel.c_str(),
|
|
||||||
+ // StoreUtil::Anonymous(filePath).c_str());
|
|
||||||
+ // return DBStatus::DB_ERROR;
|
|
||||||
+ // }
|
|
||||||
|
|
||||||
return DBStatus::OK;
|
|
||||||
}
|
|
||||||
@@ -90,12 +90,12 @@ SystemApi::DBStatus SystemApi::GetSecurityOption(const std::string &filePath, DB
|
|
||||||
return DBStatus::OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
- std::string value = SecurityLabel::GetSecurityLabel(filePath);
|
|
||||||
- if (!std::regex_match(value, std::regex("s([01234])"))) {
|
|
||||||
- option = {Label::NOT_SET, Flag::ECE};
|
|
||||||
- return DBStatus::OK;
|
|
||||||
- }
|
|
||||||
- option = { (value[1] - '0') + 1, value[1] == '3' ? Flag::SECE : Flag::ECE};
|
|
||||||
+ // std::string value = SecurityLabel::GetSecurityLabel(filePath);
|
|
||||||
+ // if (!std::regex_match(value, std::regex("s([01234])"))) {
|
|
||||||
+ // option = {Label::NOT_SET, Flag::ECE};
|
|
||||||
+ // return DBStatus::OK;
|
|
||||||
+ // }
|
|
||||||
+ // option = { (value[1] - '0') + 1, value[1] == '3' ? Flag::SECE : Flag::ECE};
|
|
||||||
return DBStatus::OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/frameworks/innerkitsimpl/rdb/include/rdb_notifier.h b/frameworks/innerkitsimpl/rdb/include/rdb_notifier.h
|
|
||||||
index 4c0eb28..32fc087 100644
|
|
||||||
--- a/frameworks/innerkitsimpl/rdb/include/rdb_notifier.h
|
|
||||||
+++ b/frameworks/innerkitsimpl/rdb/include/rdb_notifier.h
|
|
||||||
@@ -73,8 +73,8 @@ private:
|
|
||||||
|
|
||||||
using RequestHandle = int32_t (RdbNotifierStub::*)(MessageParcel&, MessageParcel&);
|
|
||||||
static constexpr RequestHandle HANDLES[RDB_NOTIFIER_CMD_MAX] = {
|
|
||||||
- [RDB_NOTIFIER_CMD_SYNC_COMPLETE] = &RdbNotifierStub::OnCompleteInner,
|
|
||||||
- [RDB_NOTIFIER_CMD_DATA_CHANGE] = &RdbNotifierStub::OnChangeInner,
|
|
||||||
+ /* [RDB_NOTIFIER_CMD_SYNC_COMPLETE] = */&RdbNotifierStub::OnCompleteInner,
|
|
||||||
+ /* [RDB_NOTIFIER_CMD_DATA_CHANGE] = */&RdbNotifierStub::OnChangeInner,
|
|
||||||
};
|
|
||||||
|
|
||||||
RdbSyncCompleteNotifier completeNotifier_;
|
|
||||||
diff --git a/frameworks/libs/distributeddb/BUILD.gn b/frameworks/libs/distributeddb/BUILD.gn
|
|
||||||
index 209bf90..d08716e 100644
|
|
||||||
--- a/frameworks/libs/distributeddb/BUILD.gn
|
|
||||||
+++ b/frameworks/libs/distributeddb/BUILD.gn
|
|
||||||
@@ -46,7 +46,7 @@ config("distrdb_config") {
|
|
||||||
"OMIT_FLATBUFFER",
|
|
||||||
"RELATIONAL_STORE",
|
|
||||||
"SQLITE_DISTRIBUTE_RELATIONAL",
|
|
||||||
- "USE_DFX_ABILITY",
|
|
||||||
+ # "USE_DFX_ABILITY",
|
|
||||||
]
|
|
||||||
if (is_debug) {
|
|
||||||
defines += [ "TRACE_SQLITE_EXECUTE" ]
|
|
||||||
@@ -285,8 +285,8 @@ ohos_shared_library("distributeddb") {
|
|
||||||
|
|
||||||
external_deps = [
|
|
||||||
"c_utils:utils",
|
|
||||||
- "hisysevent_native:libhisysevent",
|
|
||||||
- "hitrace_native:hitrace_meter",
|
|
||||||
+ # "hisysevent_native:libhisysevent",
|
|
||||||
+ # "hitrace_native:hitrace_meter",
|
|
||||||
"hiviewdfx_hilog_native:libhilog",
|
|
||||||
]
|
|
||||||
|
|
||||||
diff --git a/frameworks/libs/distributeddb/interfaces/src/kv_store_delegate_manager.cpp b/frameworks/libs/distributeddb/interfaces/src/kv_store_delegate_manager.cpp
|
|
||||||
index b075ed1..c18b390 100644
|
|
||||||
--- a/frameworks/libs/distributeddb/interfaces/src/kv_store_delegate_manager.cpp
|
|
||||||
+++ b/frameworks/libs/distributeddb/interfaces/src/kv_store_delegate_manager.cpp
|
|
||||||
@@ -251,6 +251,7 @@ bool KvStoreDelegateManager::GetKvStoreParamCheck(const std::string &storeId, co
|
|
||||||
}
|
|
||||||
if (!ParamCheckUtils::CheckStoreParameter(storeId, appId_, userId_) ||
|
|
||||||
(GetKvStorePath().empty() && !option.isMemoryDb)) {
|
|
||||||
+ LOGE("[HP_DEBUG] GetKvStorePath is empty[%d], ismemorydb[%d]", GetKvStorePath().empty(), option.isMemoryDb);
|
|
||||||
LOGE("[KvStoreMgr] Invalid id or path info for the store");
|
|
||||||
callback(INVALID_ARGS, nullptr);
|
|
||||||
return false;
|
|
||||||
@@ -294,6 +295,7 @@ void KvStoreDelegateManager::GetKvStore(const std::string &storeId, const KvStor
|
|
||||||
const std::function<void(DBStatus, KvStoreNbDelegate *)> &callback)
|
|
||||||
{
|
|
||||||
if (!GetKvStoreParamCheck(storeId, option, callback)) {
|
|
||||||
+ LOGI("[HP_DEBUG] Param check failed!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// check if schema is supported and valid
|
|
||||||
@@ -301,6 +303,7 @@ void KvStoreDelegateManager::GetKvStore(const std::string &storeId, const KvStor
|
|
||||||
DBStatus retCode = CheckAndGetSchema(option.isMemoryDb, option.schema, schema);
|
|
||||||
if (retCode != OK) {
|
|
||||||
callback(retCode, nullptr);
|
|
||||||
+ LOGI("[HP_DEBUG] CheckAndGetSchema failed!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
KvDBProperties properties;
|
|
||||||
@@ -315,6 +318,7 @@ void KvStoreDelegateManager::GetKvStore(const std::string &storeId, const KvStor
|
|
||||||
DBStatus status = TransferDBErrno(errCode);
|
|
||||||
if (conn == nullptr) {
|
|
||||||
callback(status, nullptr);
|
|
||||||
+ LOGI("[HP_DEBUG] GetOneConnectionWithRetry failed!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -323,6 +327,7 @@ void KvStoreDelegateManager::GetKvStore(const std::string &storeId, const KvStor
|
|
||||||
conn->Close();
|
|
||||||
conn = nullptr;
|
|
||||||
callback(DB_ERROR, nullptr);
|
|
||||||
+ LOGI("[HP_DEBUG] new KvStoreNbDelegateImpl failed!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -330,6 +335,7 @@ void KvStoreDelegateManager::GetKvStore(const std::string &storeId, const KvStor
|
|
||||||
if (status != OK) {
|
|
||||||
CloseKvStore(kvStore);
|
|
||||||
callback(status, nullptr);
|
|
||||||
+ LOGI("[HP_DEBUG] SetObserverNotifier failed!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/frameworks/libs/distributeddb/storage/src/result_entries_window.cpp b/frameworks/libs/distributeddb/storage/src/result_entries_window.cpp
|
|
||||||
index 5709380..f01365b 100644
|
|
||||||
--- a/frameworks/libs/distributeddb/storage/src/result_entries_window.cpp
|
|
||||||
+++ b/frameworks/libs/distributeddb/storage/src/result_entries_window.cpp
|
|
||||||
@@ -176,7 +176,7 @@ int ResultEntriesWindow::LoadData(int begin, int target) const
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bufferSize += next.key.size() + next.value.size();
|
|
||||||
- buffer_.push_back(move(next));
|
|
||||||
+ buffer_.push_back(std::move(next));
|
|
||||||
}
|
|
||||||
if (buffer_.size() == static_cast<size_t>(totalCount_)) {
|
|
||||||
(void)(rawCursor_->Close());
|
|
||||||
--
|
|
||||||
2.24.3 (Apple Git-128)
|
|
||||||
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
From 09750a4c777c399bdaefaae74e4523a86b241e93 Mon Sep 17 00:00:00 2001
|
|
||||||
From: heppen <hepeng68@huawei.com>
|
|
||||||
Date: Thu, 7 Mar 2024 16:26:29 +0800
|
|
||||||
Subject: [PATCH] establish kvstore dependency on boundscheck
|
|
||||||
|
|
||||||
---
|
|
||||||
frameworks/libs/distributeddb/BUILD.gn | 1 +
|
|
||||||
.../libs/distributeddb/communicator/src/protocol_proto.cpp | 1 +
|
|
||||||
2 files changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/frameworks/libs/distributeddb/BUILD.gn b/frameworks/libs/distributeddb/BUILD.gn
|
|
||||||
index d08716e..536f8ee 100644
|
|
||||||
--- a/frameworks/libs/distributeddb/BUILD.gn
|
|
||||||
+++ b/frameworks/libs/distributeddb/BUILD.gn
|
|
||||||
@@ -273,6 +273,7 @@ ohos_shared_library("distributeddb") {
|
|
||||||
deps = [
|
|
||||||
"//third_party/sqlite:sqlite",
|
|
||||||
"//third_party/zlib:shared_libz",
|
|
||||||
+ "//third_party/bounds_checking_function:libsec_shared",
|
|
||||||
]
|
|
||||||
|
|
||||||
configs += [ "//third_party/jsoncpp:jsoncpp_config" ]
|
|
||||||
diff --git a/frameworks/libs/distributeddb/communicator/src/protocol_proto.cpp b/frameworks/libs/distributeddb/communicator/src/protocol_proto.cpp
|
|
||||||
index 6e58a47..4d9325f 100644
|
|
||||||
--- a/frameworks/libs/distributeddb/communicator/src/protocol_proto.cpp
|
|
||||||
+++ b/frameworks/libs/distributeddb/communicator/src/protocol_proto.cpp
|
|
||||||
@@ -24,6 +24,7 @@
|
|
||||||
#include "macro_utils.h"
|
|
||||||
#include "endian_convert.h"
|
|
||||||
#include "header_converter.h"
|
|
||||||
+#include <mutex>
|
|
||||||
|
|
||||||
namespace DistributedDB {
|
|
||||||
namespace {
|
|
||||||
--
|
|
||||||
2.43.0
|
|
||||||
|
|
||||||
116
bundle.json
116
bundle.json
@ -1,116 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "@openharmony/distributeddatamgr_kv_store",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"license": "Apache License 2.0",
|
|
||||||
"description": "",
|
|
||||||
"domain": "os",
|
|
||||||
"language": "",
|
|
||||||
"publishAs": "code-segment",
|
|
||||||
"private": false,
|
|
||||||
"tags": [
|
|
||||||
"foundation"
|
|
||||||
],
|
|
||||||
"keywords": [
|
|
||||||
"distributeddatamgr",
|
|
||||||
"kv_store"
|
|
||||||
],
|
|
||||||
"envs": [],
|
|
||||||
"author": {
|
|
||||||
"name": "",
|
|
||||||
"email": "",
|
|
||||||
"url": ""
|
|
||||||
},
|
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"email": "",
|
|
||||||
"url": ""
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"segment": {
|
|
||||||
"destPath": "foundation/distributeddatamgr/kv_store"
|
|
||||||
},
|
|
||||||
"dirs": {},
|
|
||||||
"scripts": {},
|
|
||||||
"component": {
|
|
||||||
"name": "kv_store",
|
|
||||||
"subsystem": "distributeddatamgr",
|
|
||||||
"syscap": [
|
|
||||||
"SystemCapability.DistributedDataManager.KVStore.Core",
|
|
||||||
"SystemCapability.DistributedDataManager.KVStore.Lite",
|
|
||||||
"SystemCapability.DistributedDataManager.KVStore.DistributedKVStore"
|
|
||||||
],
|
|
||||||
"features": [],
|
|
||||||
"adapted_system_type": [
|
|
||||||
"standard"
|
|
||||||
],
|
|
||||||
"rom": "",
|
|
||||||
"ram": "",
|
|
||||||
"hisysevent_config": [],
|
|
||||||
"deps": {
|
|
||||||
"thrid_party": [
|
|
||||||
"uv_static",
|
|
||||||
"sqlite",
|
|
||||||
"libz",
|
|
||||||
"jsoncpp",
|
|
||||||
"libcrypto_shared"
|
|
||||||
],
|
|
||||||
"kernel_special": {},
|
|
||||||
"board_special": {},
|
|
||||||
"components": [
|
|
||||||
"libuv",
|
|
||||||
"common_event_service",
|
|
||||||
"bundle_framework",
|
|
||||||
"safwk",
|
|
||||||
"zlib",
|
|
||||||
"init",
|
|
||||||
"os_account",
|
|
||||||
"common",
|
|
||||||
"samgr",
|
|
||||||
"dataclassification",
|
|
||||||
"dsoftbus",
|
|
||||||
"jsoncpp",
|
|
||||||
"hitrace_native",
|
|
||||||
"access_token",
|
|
||||||
"huks",
|
|
||||||
"ability_base",
|
|
||||||
"ability_runtime",
|
|
||||||
"hiviewdfx_hilog_native",
|
|
||||||
"hisysevent_native",
|
|
||||||
"device_auth",
|
|
||||||
"ipc",
|
|
||||||
"napi"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"sub_component": [
|
|
||||||
"//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:build_module",
|
|
||||||
"//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:build_module"
|
|
||||||
],
|
|
||||||
"inner_kits": [
|
|
||||||
{
|
|
||||||
"name": "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner",
|
|
||||||
"header": {
|
|
||||||
"header_files": [
|
|
||||||
"blob.h",
|
|
||||||
"change_notification.h",
|
|
||||||
"distributed_kv_data_manager.h",
|
|
||||||
"kvstore.h",
|
|
||||||
"kvstore_death_recipient.h",
|
|
||||||
"kvstore_observer.h",
|
|
||||||
"kvstore_result_set.h",
|
|
||||||
"kvstore_sync_callback.h",
|
|
||||||
"single_kvstore.h",
|
|
||||||
"types.h",
|
|
||||||
"visibility.h",
|
|
||||||
"data_query.h",
|
|
||||||
"device_status_change_listener.h",
|
|
||||||
"store_errno.h"
|
|
||||||
],
|
|
||||||
"header_base": "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata/include"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
@ -1,127 +0,0 @@
|
|||||||
%define debug_package %{nil}
|
|
||||||
%global oh_version OpenHarmony-v3.2-Release
|
|
||||||
%global distributeddata_dir %{_builddir}/foundation/distributeddatamgr/
|
|
||||||
%global build_opt /opt/distributed-middleware-build
|
|
||||||
%global bundle_dir %{build_opt}/openeuler/compiler_gn/foundation/distributeddatamgr/kv_store
|
|
||||||
|
|
||||||
Name: distributeddatamgr_kv_store
|
|
||||||
Version: 1.0.0
|
|
||||||
Release: 4
|
|
||||||
Summary: Supports distributed key-value data management
|
|
||||||
License: Apache-2.0
|
|
||||||
Url: https://gitee.com/openharmony/distributeddatamgr_kv_store
|
|
||||||
Source1: https://gitee.com/openharmony/distributeddatamgr_kv_store/repository/archive/%{oh_version}.tar.gz#/distributeddatamgr_kv_store-%{oh_version}.tar.gz
|
|
||||||
Source2: frameworks.BUILD.gn
|
|
||||||
Source3: interface.BUILD.gn
|
|
||||||
Source4: bundle.json
|
|
||||||
Patch1: 0001-remove-useless-dependency-datashare.patch
|
|
||||||
Patch2: 0002-remove-useless-dependency-hitrace-hisysevent.patch
|
|
||||||
Patch3: 0003-remove-useless-dependency-compile.patch
|
|
||||||
Patch4: 0004-establish-kvstore-dependence-on-boundscheck.patch
|
|
||||||
|
|
||||||
BuildRequires: libboundscheck, zlib, zlib-devel, jsoncpp, jsoncpp-devel, compat-openssl11-devel
|
|
||||||
BuildRequires: distributed-build, distributed-beget, hilog, commonlibrary_c_utils
|
|
||||||
BuildRequires: communication_ipc, communication_dsoftbus
|
|
||||||
BuildRequires: systemabilitymgr_safwk, systemabilitymgr_samgr
|
|
||||||
BuildRequires: security_dataclassification, security_device_auth, security_huks
|
|
||||||
BuildRequires: distributedhardware_device_manager
|
|
||||||
|
|
||||||
Requires: libboundscheck, zlib, zlib-devel, jsoncpp, jsoncpp-devel, compat-openssl11-devel
|
|
||||||
Requires: distributed-beget, hilog, commonlibrary_c_utils
|
|
||||||
Requires: communication_ipc, communication_dsoftbus
|
|
||||||
Requires: systemabilitymgr_safwk, systemabilitymgr_samgr
|
|
||||||
Requires: security_dataclassification, security_device_auth, security_huks
|
|
||||||
Requires: distributedhardware_device_manager
|
|
||||||
|
|
||||||
%description
|
|
||||||
KV database (KV store) is developed based on the KV storage capability provided by the current public basic library,and provides key-value pair data management capabilities for device applications. On a platform with processes, the parameter management provided by KV storage is accessed by a single process and cannot be used by other processes. On such platforms, KV storage is loaded in the application process as a basic library to ensure that it is not accessed by other processes.
|
|
||||||
|
|
||||||
%prep
|
|
||||||
rm -rf %{_builddir}/*
|
|
||||||
cp -rf %{build_opt} %{_builddir}/build
|
|
||||||
[ ! -L "%{_builddir}/build.sh" ] && ln -s %{_builddir}/build/build_scripts/build.sh %{_builddir}/build.sh
|
|
||||||
[ ! -L "%{_builddir}/.gn" ] && ln -s %{_builddir}/build/core/gn/dotfile.gn %{_builddir}/.gn
|
|
||||||
[ ! -L "%{_builddir}/build.py" ] && ln -s %{_builddir}/build/lite/build.py %{_builddir}/build.py
|
|
||||||
cp -rf %{_builddir}/build/openeuler/vendor %{_builddir}/
|
|
||||||
cp -rf %{_builddir}/build/openeuler/compiler_gn/* %{_builddir}
|
|
||||||
|
|
||||||
%setup -q -D -T -a 1 -c -n %{distributeddata_dir}
|
|
||||||
if [ -d "%{distributeddata_dir}/kv_store" ]; then
|
|
||||||
rm -rf %{distributeddata_dir}/kv_store
|
|
||||||
fi
|
|
||||||
mv %{distributeddata_dir}/%{name}-%{oh_version} %{distributeddata_dir}/kv_store
|
|
||||||
|
|
||||||
%patch -P1 -p1 -d %{distributeddata_dir}/kv_store
|
|
||||||
%patch -P2 -p1 -d %{distributeddata_dir}/kv_store
|
|
||||||
%patch -P3 -p1 -d %{distributeddata_dir}/kv_store
|
|
||||||
%patch -P4 -p1 -d %{distributeddata_dir}/kv_store
|
|
||||||
|
|
||||||
%build
|
|
||||||
%ifarch x86_64
|
|
||||||
%{_builddir}/build.sh --product-name openeuler --target-cpu x86_64
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifarch aarch64
|
|
||||||
%{_builddir}/build.sh --product-name openeuler --target-cpu arm64
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%install
|
|
||||||
%define frameworks_dir %{bundle_dir}/frameworks/libs/distributeddb
|
|
||||||
%define interface_dir %{bundle_dir}/interfaces/innerkits/distributeddata
|
|
||||||
|
|
||||||
install -d -m 0755 %{buildroot}/%{_includedir}/kv_store
|
|
||||||
install -d -m 0755 %{buildroot}/%{_libdir}
|
|
||||||
install -d -m 0755 %{buildroot}/%{frameworks_dir}
|
|
||||||
install -d -m 0755 %{buildroot}/%{interface_dir}
|
|
||||||
install -d -m 0755 %{buildroot}/system/lib64
|
|
||||||
|
|
||||||
cp %{SOURCE2} %{buildroot}/%{frameworks_dir}/BUILD.gn
|
|
||||||
cp %{SOURCE3} %{buildroot}/%{interface_dir}/BUILD.gn
|
|
||||||
cp %{SOURCE4} %{buildroot}/%{bundle_dir}
|
|
||||||
|
|
||||||
%ifarch aarch64
|
|
||||||
%define lib_out_path out/openeuler/linux_clang_arm64/distributeddatamgr/kv_store
|
|
||||||
%define header_out_path out/openeuler/innerkits/linux-arm64/kv_store
|
|
||||||
%endif
|
|
||||||
%ifarch x86_64
|
|
||||||
%define lib_out_path out/openeuler/linux_clang_x86_64/distributeddatamgr/kv_store
|
|
||||||
%define header_out_path out/openeuler/innerkits/linux-x86_64/kv_store
|
|
||||||
%endif
|
|
||||||
|
|
||||||
install -m 0755 %{_builddir}/%{lib_out_path}/*.so %{buildroot}%{_libdir}
|
|
||||||
install -m 0755 %{_builddir}/%{lib_out_path}/*.so %{buildroot}/system/lib64/
|
|
||||||
|
|
||||||
# 对外头文件,使用kv_store功能的头文件
|
|
||||||
find %{_builddir}/%{header_out_path} -name *.h -print0 | xargs -0 -i cp -rf {} %{buildroot}%{_includedir}/kv_store/
|
|
||||||
%define rdb_header_path foundation/distributeddatamgr/kv_store/frameworks/innerkitsimpl/rdb/include
|
|
||||||
cp -rf %{_builddir}/%{rdb_header_path}/*.h %{buildroot}%{_includedir}/kv_store/
|
|
||||||
|
|
||||||
# 导出所有的头文件到编译目录,给其他分布式数据组件编译使用
|
|
||||||
pushd %{_builddir}/foundation/distributeddatamgr/kv_store
|
|
||||||
for include_file in `find . \( -name kvstoremock -o -name test -o -name jskitsimpl \) -prune -o -name "*.h" -type f`
|
|
||||||
do
|
|
||||||
if [[ ${include_file} != *.h ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
cp --parents ${include_file} %{buildroot}%{bundle_dir}
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
|
|
||||||
%files
|
|
||||||
%{_libdir}/*.so
|
|
||||||
%{_includedir}/kv_store/*
|
|
||||||
%{bundle_dir}/*
|
|
||||||
/system/*
|
|
||||||
|
|
||||||
%changelog
|
|
||||||
* Tue Nov 21 2023 Peng He <hepeng68@huawei.com> - 1.0.0-4
|
|
||||||
- Update build requires and requires.
|
|
||||||
|
|
||||||
* Fri Aug 04 2023 Yuying Mu <muyuying1@huawei.com> - 1.0.0-3
|
|
||||||
- Disassemble the original patch according to its function.
|
|
||||||
|
|
||||||
* Thu Aug 03 2023 Peng He <hepeng68@huawei.com> - 1.0.0-2
|
|
||||||
- Add requires and rectify the contents of the RPM package.
|
|
||||||
|
|
||||||
* Tue Jul 18 2023 Ge Wang <wang__ge@126.com> - 1.0.0-1
|
|
||||||
- init package
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import("//build/ohos.gni")
|
|
||||||
|
|
||||||
config("distrdb_config") {
|
|
||||||
include_dirs = [
|
|
||||||
"interfaces/include",
|
|
||||||
"interfaces/include/relational",
|
|
||||||
"include"
|
|
||||||
# "/usr/include/kv_store",
|
|
||||||
# "/usr/include/openssl",
|
|
||||||
]
|
|
||||||
libs = [ "distributeddb.z" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
group("distributeddb") {
|
|
||||||
public_configs = [ ":distrdb_config" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
group("build_module") {
|
|
||||||
deps = [ ":distributeddb" ]
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import("//build/ohos.gni")
|
|
||||||
|
|
||||||
group("build_module") {
|
|
||||||
deps = [ ":distributeddata_inner" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
config("distributeddatall_config") {
|
|
||||||
include_dirs = [
|
|
||||||
"include",
|
|
||||||
"../../../frameworks/innerkitsimpl/rdb/include",
|
|
||||||
"../../../frameworks/innerkitsimpl/object/include",
|
|
||||||
"../../../frameworks/innerkitsimpl/distributeddatafwk/include",
|
|
||||||
"//commonlibrary/c_utils/base/include",
|
|
||||||
]
|
|
||||||
libs = [ "distributeddata_inner.z" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
group("distributeddata_inner") {
|
|
||||||
public_configs = [ ":distributeddatall_config" ]
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user