提交 11e04871 编写于 作者: S superjom

fix service name

上级 142431b0
...@@ -40,7 +40,7 @@ public: ...@@ -40,7 +40,7 @@ public:
void MaintainWrite(const std::string &dir, int msecs) { void MaintainWrite(const std::string &dir, int msecs) {
dynamic_cast<MemoryStorage *>(storage_.get()) dynamic_cast<MemoryStorage *>(storage_.get())
->StartWriteSerice(dir, msecs, &lock_); ->StartWriteService(dir, msecs, &lock_);
} }
/* /*
...@@ -77,6 +77,8 @@ public: ...@@ -77,6 +77,8 @@ public:
private: private:
// read write lock for protobuf in memory // read write lock for protobuf in memory
// TODO(ChunweiYan) mutex too heavy here, might change to a message queue to
// reduce the frequency of visiting disk
std::mutex lock_; std::mutex lock_;
std::unique_ptr<StorageBase> storage_; std::unique_ptr<StorageBase> storage_;
cc::PeriodExector executor_; cc::PeriodExector executor_;
......
...@@ -91,9 +91,9 @@ void MemoryStorage::StartReadService(const std::string &dir, ...@@ -91,9 +91,9 @@ void MemoryStorage::StartReadService(const std::string &dir,
(*executor_)(std::move(task), msecs); (*executor_)(std::move(task), msecs);
} }
void MemoryStorage::StartWriteSerice(const std::string &dir, void MemoryStorage::StartWriteService(const std::string &dir,
int msecs, int msecs,
std::mutex *handler) { std::mutex *handler) {
CHECK(executor_ != nullptr); CHECK(executor_ != nullptr);
CHECK(!dir.empty()) << "dir should be set first"; CHECK(!dir.empty()) << "dir should be set first";
storage_.set_dir(dir); storage_.set_dir(dir);
......
...@@ -105,7 +105,9 @@ public: ...@@ -105,7 +105,9 @@ public:
* *
* msecs: how many millisecond to sync memory and disk. * msecs: how many millisecond to sync memory and disk.
*/ */
void StartWriteSerice(const std::string &dir, int msecs, std::mutex *handler); void StartWriteService(const std::string &dir,
int msecs,
std::mutex *handler);
private: private:
std::map<std::string, storage::Tablet> tablets_; std::map<std::string, storage::Tablet> tablets_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册