Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
shuaihehe committed Nov 27, 2023
1 parent 0b9a4d3 commit 41b912b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions curvefs/src/client/kvclient/kvclient_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ bool KVClientManager::Init(const KVClientManagerOpt& config,
const std::string& fsName) {
client_ = kvclient;
kvClientManagerMetric_ = absl::make_unique<KVClientManagerMetric>(fsName);
getQueueSize_.reset("get_queue_size"); //1
setQueueSize_.reset("set_queue_size"); //1
brpc::StartDummyServerAt(9000);
getQueueSize_.expose("getQueueSize_");
setQueueSize_.expose("setQueueSize_");
getQueueSize_.reset();
setQueueSize_.reset();
return threadPool_.Start(config.setThreadPooln) == 0;
}

Expand All @@ -66,7 +69,7 @@ void KVClientManager::Uninit() {
void KVClientManager::Set(std::shared_ptr<SetKVCacheTask> task) {
threadPool_.Enqueue([task, this]() {
std::string error_log;
setQueueSize_ << 1
setQueueSize_ << 1;
task->res =
client_->Set(task->key, task->value, task->length, &error_log);
if (task->res) {
Expand Down
3 changes: 2 additions & 1 deletion curvefs/src/client/kvclient/kvclient_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
#include <string>
#include <thread>
#include <utility>
#include "bvar/bvar.h"
#include "brpc/server.h"

#include "absl/strings/string_view.h"
#include "curvefs/src/client/common/config.h"
#include "curvefs/src/client/kvclient/kvclient.h"
#include "curvefs/src/client/metric/client_metric.h"
#include "src/common/concurrent/task_thread_pool.h"
#include "src/common/s3_adapter.h"
#include "bvar/bvar.h"

using curvefs::client::metric::KVClientManagerMetric;

Expand Down

0 comments on commit 41b912b

Please sign in to comment.