0.9.8.10
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
home
doug
src
hypertable
src
cc
Hypertable
Master
LoadBalancer.h
Go to the documentation of this file.
1
/* -*- c++ -*-
2
* Copyright (C) 2007-2015 Hypertable, Inc.
3
*
4
* This file is part of Hypertable.
5
*
6
* Hypertable is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; version 3 of the
9
* License, or any later version.
10
*
11
* Hypertable is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
* 02110-1301, USA.
20
*/
21
22
#ifndef Hypertable_Master_LoadBalancer_h
23
#define Hypertable_Master_LoadBalancer_h
24
25
#include "
RangeServerConnection.h
"
26
#include "
RangeServerStatistics.h
"
27
#include "
Context.h
"
28
29
#include <
Hypertable/Lib/BalancePlan.h
>
30
31
#include <
Common/Crontab.h
>
32
33
#include <ctime>
34
#include <mutex>
35
#include <vector>
36
37
namespace
Hypertable
{
38
39
class
LoadBalancer
{
40
public
:
41
LoadBalancer
(
ContextPtr
context);
42
43
void
signal_new_server
();
44
45
bool
balance_needed
();
46
47
void
unpause
();
48
49
void
create_plan
(
BalancePlanPtr
&plan,
50
std::vector <RangeServerConnectionPtr> &balanced);
51
52
void
transfer_monitoring_data
(vector<RangeServerStatistics> &stats);
53
54
private
:
55
std::mutex
m_mutex
;
56
ContextPtr
m_context
;
57
std::mutex
m_add_mutex
;
58
Crontab
m_crontab
;
59
time_t
m_next_balance_time_load
;
60
time_t
m_next_balance_time_new_server
;
61
double
m_loadavg_threshold
;
62
uint32_t
m_new_server_balance_delay
;
63
bool
m_new_server_added
;
64
bool
m_enabled
;
65
bool
m_paused
;
66
std::vector <RangeServerStatistics>
m_statistics
;
67
};
68
69
void
reenable_balancer
(
LoadBalancer
*balancer);
70
}
71
72
#endif // Hypertable_Master_LoadBalancer_h
Hypertable::Logger::mutex
static std::mutex mutex
Definition:
Logger.cc:43
Hypertable::LoadBalancer::LoadBalancer
LoadBalancer(ContextPtr context)
Definition:
LoadBalancer.cc:34
Hypertable::BalancePlanPtr
std::shared_ptr< BalancePlan > BalancePlanPtr
Definition:
BalancePlan.h:81
Hypertable::LoadBalancer::m_loadavg_threshold
double m_loadavg_threshold
Definition:
LoadBalancer.h:61
Hypertable::LoadBalancer::m_add_mutex
std::mutex m_add_mutex
Definition:
LoadBalancer.h:57
Hypertable::LoadBalancer::m_mutex
std::mutex m_mutex
Definition:
LoadBalancer.h:55
Hypertable::ContextPtr
std::shared_ptr< Context > ContextPtr
Smart pointer to Context.
Definition:
Context.h:265
Hypertable::LoadBalancer::m_next_balance_time_new_server
time_t m_next_balance_time_new_server
Definition:
LoadBalancer.h:60
Hypertable::LoadBalancer::create_plan
void create_plan(BalancePlanPtr &plan, std::vector< RangeServerConnectionPtr > &balanced)
Definition:
LoadBalancer.cc:98
Hypertable::LoadBalancer::unpause
void unpause()
Definition:
LoadBalancer.cc:79
Hypertable::LoadBalancer::m_context
ContextPtr m_context
Definition:
LoadBalancer.h:56
Hypertable::Crontab
Tracks timing of periodic events.
Definition:
Crontab.h:55
Hypertable::LoadBalancer
Definition:
LoadBalancer.h:39
Hypertable::LoadBalancer::m_next_balance_time_load
time_t m_next_balance_time_load
Definition:
LoadBalancer.h:59
Hypertable::LoadBalancer::m_new_server_balance_delay
uint32_t m_new_server_balance_delay
Definition:
LoadBalancer.h:62
Hypertable
Hypertable definitions
Definition:
ApplicationHandler.h:36
Hypertable::LoadBalancer::m_paused
bool m_paused
Definition:
LoadBalancer.h:65
Hypertable::LoadBalancer::m_enabled
bool m_enabled
Definition:
LoadBalancer.h:64
Hypertable::LoadBalancer::m_crontab
Crontab m_crontab
Definition:
LoadBalancer.h:58
RangeServerConnection.h
Hypertable::LoadBalancer::m_statistics
std::vector< RangeServerStatistics > m_statistics
Definition:
LoadBalancer.h:66
Crontab.h
Crontab class for periodic events.
BalancePlan.h
Hypertable::LoadBalancer::transfer_monitoring_data
void transfer_monitoring_data(vector< RangeServerStatistics > &stats)
Definition:
LoadBalancer.cc:92
Hypertable::reenable_balancer
void reenable_balancer(LoadBalancer *balancer)
Definition:
LoadBalancer.cc:174
Context.h
Declarations for Context.
Hypertable::LoadBalancer::signal_new_server
void signal_new_server()
Definition:
LoadBalancer.cc:60
RangeServerStatistics.h
Hypertable::LoadBalancer::balance_needed
bool balance_needed()
Definition:
LoadBalancer.cc:66
Hypertable::LoadBalancer::m_new_server_added
bool m_new_server_added
Definition:
LoadBalancer.h:63
Generated on Tue Dec 22 2015 18:43:13 for Hypertable by
1.8.8