forked from OpenAtomFoundation/pika
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Feature/floyd rebase unstable (OpenAtomFoundation#2413)
* feat: add floyd (OpenAtomFoundation#2347) * floyd: refactor storage to support multi rocksdb instance && todis key format --------- Co-authored-by: wangshaoyi <[email protected]> * fix floyd keys (OpenAtomFoundation#2364) Co-authored-by: wuxianrong <[email protected]> * floyd rebase unstable branch * fix by review comments --------- Co-authored-by: wangshaoyi <[email protected]> Co-authored-by: Mixficsol <[email protected]> Co-authored-by: wuxianrong <[email protected]>
- Loading branch information
1 parent
1dae356
commit f7d2997
Showing
99 changed files
with
5,882 additions
and
8,140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Copyright (c) 2015-present, Qihoo, Inc. All rights reserved. | ||
// This source code is licensed under the BSD-style license found in the | ||
// LICENSE file in the root directory of this source tree. An additional grant | ||
// of patent rights can be found in the PATENTS file in the same directory. | ||
|
||
#ifndef PIKA_MONITOR_THREAD_H_ | ||
#define PIKA_MONITOR_THREAD_H_ | ||
|
||
#include <atomic> | ||
#include <deque> | ||
#include <list> | ||
#include <queue> | ||
|
||
#include "net/include/net_thread.h" | ||
#include "pstd/include/pstd_mutex.h" | ||
#include "include/pika_define.h" | ||
#include "include/pika_client_conn.h" | ||
|
||
class PikaMonitorThread : public net::Thread { | ||
public: | ||
PikaMonitorThread(); | ||
~PikaMonitorThread() override; | ||
|
||
void AddMonitorClient(const std::shared_ptr<PikaClientConn>& client_ptr); | ||
void AddMonitorMessage(const std::string& monitor_message); | ||
int32_t ThreadClientList(std::vector<ClientInfo>* client = nullptr); | ||
bool ThreadClientKill(const std::string& ip_port = "all"); | ||
bool HasMonitorClients(); | ||
|
||
private: | ||
void AddCronTask(const MonitorCronTask& task); | ||
bool FindClient(const std::string& ip_port); | ||
net::WriteStatus SendMessage(int32_t fd, std::string& message); | ||
void RemoveMonitorClient(const std::string& ip_port); | ||
|
||
std::atomic<bool> has_monitor_clients_; | ||
pstd::Mutex monitor_mutex_protector_; | ||
pstd::CondVar monitor_cond_; | ||
|
||
std::list<ClientInfo> monitor_clients_; | ||
std::deque<std::string> monitor_messages_; | ||
std::queue<MonitorCronTask> cron_tasks_; | ||
|
||
void* ThreadMain() override; | ||
void RemoveMonitorClient(int32_t client_fd); | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.