-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'unstable' into fix_slave_binlog_lock
- Loading branch information
Showing
101 changed files
with
5,922 additions
and
8,142 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 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
Oops, something went wrong.