OpenSDN source code
|
#include <sandesh_client_sm_priv.h>
Classes | |
struct | EventContainer |
Public Member Functions | |
SandeshClientSMImpl (EventManager *evm, Mgr *mgr, int sm_task_instance, int sm_task_id, bool periodicuve) | |
virtual | ~SandeshClientSMImpl () |
Mgr *const | GetMgr () |
void | set_session (SandeshSession *session, bool enq=true) |
bool | send_session (Sandesh *snh) |
void | SetAdminState (bool down) |
void | SetCollectors (const std::vector< TcpServer::Endpoint > &collectors) |
void | GetCollectors (std::vector< TcpServer::Endpoint > &collectors) |
TcpServer::Endpoint | GetCollector () const |
TcpServer::Endpoint | GetNextCollector () |
bool | SendSandeshUVE (Sandesh *snh) |
bool | SendSandesh (Sandesh *snh) |
void | EnqueDelSession (SandeshSession *session) |
void | OnSessionEvent (TcpSession *session, TcpSession::Event event) |
bool | OnMessage (SandeshSession *session, const std::string &msg) |
template<class Ev > | |
void | OnIdle (const Ev &event) |
template<class Ev > | |
void | ReleaseSandesh (const Ev &event) |
template<class Ev > | |
void | DeleteTcpSession (const Ev &event) |
void | StartConnectTimer (int seconds) |
void | CancelConnectTimer () |
bool | ConnectTimerRunning () |
void | FireConnectTimer () |
void | StartIdleHoldTimer () |
void | CancelIdleHoldTimer () |
bool | IdleHoldTimerRunning () |
void | IdleHoldTimerFired () |
bool | CollectorUpdate (const std::vector< TcpServer::Endpoint > &collectors) |
bool | CollectorChange () |
int | GetConnectTime () const |
const std::string & | StateName () const |
const std::string & | StateName (SandeshClientSM::State state) const |
const std::string & | LastStateName () const |
void | set_state (State state) |
State | get_state () const |
int | connects_inc () |
int | connects () const |
void | connect_attempts_inc () |
void | connect_attempts_clear () |
int | idle_hold_time () const |
void | reset_idle_hold_time () |
void | set_idle_hold_time (int idle_hold_time) |
void | set_last_event (const std::string &event) |
const std::string | last_event () const |
void | reset_last_info () |
void | set_collector_name (const std::string &cname) |
std::string | collector_name () |
void | unconsumed_event (const sc::event_base &event) |
void | SendUVE () |
![]() | |
State | state () const |
SandeshSession * | session () |
TcpServer::Endpoint | server () |
virtual | ~SandeshClientSM () |
Static Public Attributes | |
static const int | kConnectInterval = 30 |
static const int | kIdleHoldTime = 5000 |
![]() | |
static const int | kTickInterval = 30000 |
Private Member Functions | |
void | StartStatisticsTimer () |
bool | StatisticsTimerExpired () |
void | TimerErrorHanlder (std::string name, std::string error) |
bool | ConnectTimerExpired () |
bool | IdleHoldTimerExpired () |
template<typename Ev > | |
void | Enqueue (const Ev &event) |
bool | DequeueEvent (EventContainer ec) |
void | UpdateEventDequeue (const sc::event_base &event) |
void | UpdateEventDequeueFail (const sc::event_base &event) |
void | UpdateEventEnqueue (const sc::event_base &event) |
void | UpdateEventEnqueueFail (const sc::event_base &event) |
void | UpdateEventStats (const sc::event_base &event, bool enqueue, bool fail) |
DISALLOW_COPY_AND_ASSIGN (SandeshClientSMImpl) | |
Private Attributes | |
std::vector< TcpServer::Endpoint > | collectors_ |
int | collector_index_ |
TcpServer::Endpoint | active_ |
WorkQueue< EventContainer > | work_queue_ |
Timer * | connect_timer_ |
Timer * | idle_hold_timer_ |
Timer * | statistics_timer_ |
int | idle_hold_time_ |
int | statistics_timer_interval_ |
bool | periodicuve_ |
int | attempts_ |
bool | deleted_ |
bool | in_dequeue_ |
int | connects_ |
State | last_state_ |
uint64_t | state_since_ |
std::string | last_event_ |
uint64_t | last_event_at_ |
std::string | coll_name_ |
tbb::mutex | mutex_ |
std::string | generator_key_ |
SandeshEventStatistics | event_stats_ |
Static Private Attributes | |
static const int | kStatisticsSendInterval = 30000 |
Friends | |
class | SandeshClientStateMachineTest |
Additional Inherited Members | |
![]() | |
enum | State { IDLE = 0, DISCONNECT = 1, CONNECT = 2, CLIENT_INIT = 3, ESTABLISHED = 4 } |
![]() | |
static SandeshClientSM * | CreateClientSM (EventManager *evm, Mgr *mgr, int sm_task_instance, int sm_task_id, bool periodicuve) |
![]() | |
SandeshClientSM (Mgr *mgr) | |
void | set_session (SandeshSession *session, bool enq) |
bool | send_session (Sandesh *snh) |
void | set_server (TcpServer::Endpoint e) |
![]() | |
Mgr *const | mgr_ |
tbb::atomic< State > | state_ |
Definition at line 42 of file sandesh_client_sm_priv.h.
SandeshClientSMImpl::SandeshClientSMImpl | ( | EventManager * | evm, |
Mgr * | mgr, | ||
int | sm_task_instance, | ||
int | sm_task_id, | ||
bool | periodicuve | ||
) |
|
virtual |
void SandeshClientSMImpl::CancelConnectTimer | ( | ) |
void SandeshClientSMImpl::CancelIdleHoldTimer | ( | ) |
|
inline |
Definition at line 136 of file sandesh_client_sm_priv.h.
bool SandeshClientSMImpl::CollectorChange | ( | ) |
bool SandeshClientSMImpl::CollectorUpdate | ( | const std::vector< TcpServer::Endpoint > & | collectors | ) |
|
inline |
Definition at line 113 of file sandesh_client_sm_priv.h.
|
inline |
Definition at line 112 of file sandesh_client_sm_priv.h.
|
inline |
Definition at line 111 of file sandesh_client_sm_priv.h.
|
inline |
Definition at line 110 of file sandesh_client_sm_priv.h.
|
private |
bool SandeshClientSMImpl::ConnectTimerRunning | ( | ) |
void SandeshClientSMImpl::DeleteTcpSession | ( | const Ev & | event | ) |
|
private |
|
private |
|
virtual |
Implements SandeshClientSM.
Definition at line 622 of file sandesh_client_sm.cc.
|
private |
void SandeshClientSMImpl::FireConnectTimer | ( | ) |
|
inline |
Definition at line 108 of file sandesh_client_sm_priv.h.
TcpServer::Endpoint SandeshClientSMImpl::GetCollector | ( | ) | const |
Definition at line 1018 of file sandesh_client_sm.cc.
void SandeshClientSMImpl::GetCollectors | ( | std::vector< TcpServer::Endpoint > & | collectors | ) |
Definition at line 1013 of file sandesh_client_sm.cc.
int SandeshClientSMImpl::GetConnectTime | ( | ) | const |
Definition at line 803 of file sandesh_client_sm.cc.
|
inline |
Definition at line 53 of file sandesh_client_sm_priv.h.
TcpServer::Endpoint SandeshClientSMImpl::GetNextCollector | ( | ) |
Definition at line 1025 of file sandesh_client_sm.cc.
|
inline |
Definition at line 114 of file sandesh_client_sm_priv.h.
|
private |
void SandeshClientSMImpl::IdleHoldTimerFired | ( | ) |
bool SandeshClientSMImpl::IdleHoldTimerRunning | ( | ) |
|
inline |
Definition at line 125 of file sandesh_client_sm_priv.h.
const string & SandeshClientSMImpl::LastStateName | ( | ) | const |
Definition at line 797 of file sandesh_client_sm.cc.
void SandeshClientSMImpl::OnIdle | ( | const Ev & | event | ) |
bool SandeshClientSMImpl::OnMessage | ( | SandeshSession * | session, |
const std::string & | msg | ||
) |
void SandeshClientSMImpl::OnSessionEvent | ( | TcpSession * | session, |
TcpSession::Event | event | ||
) |
void SandeshClientSMImpl::ReleaseSandesh | ( | const Ev & | event | ) |
|
inline |
Definition at line 115 of file sandesh_client_sm_priv.h.
|
inline |
Definition at line 129 of file sandesh_client_sm_priv.h.
|
inline |
|
virtual |
Implements SandeshClientSM.
Definition at line 752 of file sandesh_client_sm.cc.
|
virtual |
Implements SandeshClientSM.
Definition at line 747 of file sandesh_client_sm.cc.
|
inline |
|
inline |
Definition at line 135 of file sandesh_client_sm_priv.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
Implements SandeshClientSM.
Definition at line 611 of file sandesh_client_sm.cc.
|
virtual |
Implements SandeshClientSM.
Definition at line 1008 of file sandesh_client_sm.cc.
void SandeshClientSMImpl::StartConnectTimer | ( | int | seconds | ) |
void SandeshClientSMImpl::StartIdleHoldTimer | ( | ) |
|
private |
|
virtual |
Implements SandeshClientSM.
Definition at line 793 of file sandesh_client_sm.cc.
const string & SandeshClientSMImpl::StateName | ( | SandeshClientSM::State | state | ) | const |
|
private |
|
private |
Definition at line 699 of file sandesh_client_sm.cc.
void SandeshClientSMImpl::unconsumed_event | ( | const sc::event_base & | event | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
friend |
Definition at line 187 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 166 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 174 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 182 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 165 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 164 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 168 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 177 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 175 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 185 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 184 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 171 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 169 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 176 of file sandesh_client_sm_priv.h.
|
static |
Definition at line 46 of file sandesh_client_sm_priv.h.
|
static |
Definition at line 47 of file sandesh_client_sm_priv.h.
|
staticprivate |
Definition at line 144 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 180 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 181 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 178 of file sandesh_client_sm_priv.h.
|
mutableprivate |
Definition at line 183 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 173 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 179 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 170 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 172 of file sandesh_client_sm_priv.h.
|
private |
Definition at line 167 of file sandesh_client_sm_priv.h.