Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
brother-jin committed Nov 27, 2023
1 parent 55edfd5 commit c1fcb13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
6 changes: 0 additions & 6 deletions include/pika_slot.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,12 @@ class Slot : public std::enable_shared_from_this<Slot>,public pstd::noncopyable
pstd::Status GetKeyNum(std::vector<storage::KeyInfo>* key_info);
KeyScanInfo GetKeyScanInfo();

/*
* SlotsMgrt used
*/
void GetSlotsMgrtSenderStatus(std::string *ip, int64_t *port, int64_t *slot, bool *migrating, int64_t *moved, int64_t *remained);
/*
* Cache used
*/
DisplayCacheInfo GetCacheInfo();
void UpdateCacheInfo(CacheInfo& cache_info);
void ResetDisplayCacheInfo(int status);
uint64_t GetCacheUsage() {return cache_usage_;}
uint64_t cache_usage_;

private:
Expand Down Expand Up @@ -181,7 +176,6 @@ class Slot : public std::enable_shared_from_this<Slot>,public pstd::noncopyable
/*
* Cache used
*/
pstd::Mutex cache_info_protector_;
DisplayCacheInfo cache_info_;
std::shared_mutex cache_info_rwlock_;
};
Expand Down
8 changes: 2 additions & 6 deletions src/pika_slot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,11 @@ std::shared_ptr<storage::Storage> Slot::db() const { return db_; }
std::shared_ptr<PikaCache> Slot::cache() const { return cache_; }

void Slot::Init() {
auto cache = std::make_shared<PikaCache>(g_pika_conf->zset_cache_start_pos(), g_pika_conf->zset_cache_field_num_per_key(), shared_from_this());
cache_ = std::make_shared<PikaCache>(g_pika_conf->zset_cache_start_pos(), g_pika_conf->zset_cache_field_num_per_key(), shared_from_this());
// Create cache
cache::CacheConfig cache_cfg;
g_pika_server->CacheConfigInit(cache_cfg);
rocksdb::Status ret = cache->Init(g_pika_conf->GetCacheNum(), &cache_cfg);
assert(cache_);
assert(ret.ok());
LOG(INFO) << "Cache Success";
cache_ = std::move(cache);
cache_->Init(g_pika_conf->GetCacheNum(), &cache_cfg);
}

void Slot::Compact(const storage::DataType& type) {
Expand Down

0 comments on commit c1fcb13

Please sign in to comment.