A brief file description. More...
#include "libts.h"
#include "P_EventSystem.h"
#include "P_Net.h"
#include "Main.h"
#include "CongestionDB.h"
#include "Congestion.h"
#include "ProcessManager.h"
Go to the source code of this file.
Data Structures | |
class | CongestionDBCont |
Defines | |
#define | SCHEDULE_CONGEST_CONT_INTERVAL HRTIME_MSECONDS(5) |
#define | CDBC_buf data.list_info.m_iobuf |
#define | CDBC_pid data.list_info.m_CurPartitionID |
#define | CDBC_lf data.list_info.m_list_format |
#define | CDBC_key data.entry_info.m_key |
#define | CDBC_host data.entry_info.m_hostname |
#define | CDBC_ip data.entry_info.m_ip |
#define | CDBC_rule data.entry_info.m_rule |
#define | CDBC_ppE data.entry_info.m_ppEntry |
Functions | |
void | Free_CongestionDBCont (CongestionDBCont *cont) |
void | Free_CongestRequestParam (CongestRequestParam *param) |
void | preCongestEntryGC (void) |
bool | congestEntryGC (CongestionEntry *p) |
void | initCongestionDB () |
void | revalidateCongestionDB () |
Action * | get_congest_entry (Continuation *cont, HttpRequestData *data, CongestionEntry **ppEntry) |
Action * | get_congest_list (Continuation *cont, MIOBuffer *buffer, int format) |
void | remove_all_congested_entry () |
void | remove_congested_entry (uint64_t key) |
void | remove_congested_entry (char *buf, MIOBuffer *out_buffer) |
Variables | |
int | CONGESTION_DB_SIZE = 1024 |
CongestionDB * | theCongestionDB = NULL |
static ClassAllocator < CongestionDBCont > | CongestionDBContAllocator ("CongestionDBContAllocator") |
ClassAllocator < CongestRequestParam > | CongestRequestParamAllocator ("CongestRequestParamAllocator") |
static long | congestEntryGCTime = 0 |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file CongestionDB.cc.
#define CDBC_buf data.list_info.m_iobuf |
Definition at line 84 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_list().
#define CDBC_host data.entry_info.m_hostname |
Definition at line 88 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_entry().
#define CDBC_ip data.entry_info.m_ip |
Definition at line 89 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_entry().
#define CDBC_key data.entry_info.m_key |
Definition at line 87 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_entry().
#define CDBC_lf data.list_info.m_list_format |
Definition at line 86 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_list().
#define CDBC_pid data.list_info.m_CurPartitionID |
Definition at line 85 of file CongestionDB.cc.
Referenced by CongestionDBCont::GC(), and CongestionDBCont::get_congest_list().
#define CDBC_ppE data.entry_info.m_ppEntry |
Definition at line 91 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_entry().
#define CDBC_rule data.entry_info.m_rule |
Definition at line 90 of file CongestionDB.cc.
Referenced by CongestionDBCont::get_congest_entry().
#define SCHEDULE_CONGEST_CONT_INTERVAL HRTIME_MSECONDS(5) |
Definition at line 38 of file CongestionDB.cc.
Referenced by get_congest_entry(), CongestionDBCont::get_congest_entry(), get_congest_list(), and CongestionDBCont::get_congest_list().
bool congestEntryGC | ( | CongestionEntry * | p | ) |
Definition at line 145 of file CongestionDB.cc.
References congestEntryGCTime, CongestionEntry::put(), and CongestionEntry::usefulInfo().
void Free_CongestionDBCont | ( | CongestionDBCont * | cont | ) | [inline] |
Definition at line 107 of file CongestionDB.cc.
References CongestionDBContAllocator, CongestionDBCont::m_action, and Continuation::mutex.
Referenced by CongestionDBCont::get_congest_entry(), and CongestionDBCont::get_congest_list().
void Free_CongestRequestParam | ( | CongestRequestParam * | param | ) | [inline] |
Definition at line 117 of file CongestionDB.cc.
References CongestRequestParamAllocator.
Referenced by CongestionDB::RunTodoList().
Action* get_congest_entry | ( | Continuation * | cont, | |
HttpRequestData * | data, | |||
CongestionEntry ** | ppEntry | |||
) |
Definition at line 468 of file CongestionDB.cc.
References ats_ip_copy(), congestionControlEnabled, CongestionControlled(), CongestionDBContAllocator, Debug, ET_NET, eventProcessor, CongestionControlRecord::get(), CongestionEntry::get(), CongestionDBCont::get_congest_entry(), HttpRequestData::get_host(), HttpRequestData::get_ip(), MTHashTable< key_t, data_t >::insert_entry(), ControlBase::line_num, MTHashTable< key_t, data_t >::lock_for_key(), MTHashTable< key_t, data_t >::lookup_entry(), CongestionDBCont::m_action, make_key(), CongestionControlRecord::max_connection, CongestionControlRecord::max_connection_failures, Continuation::mutex, MUTEX_TRY_LOCK, MTHashTable< key_t, data_t >::part_num(), CongestionDB::RunTodoList(), SCHEDULE_CONGEST_CONT_INTERVAL, EventProcessor::schedule_in(), SET_CONTINUATION_HANDLER, and this_ethread().
Referenced by HttpSM::do_congestion_control_lookup().
Action* get_congest_list | ( | Continuation * | cont, | |
MIOBuffer * | buffer, | |||
int | format | |||
) |
Definition at line 521 of file CongestionDB.cc.
References CongestionEntry::congested(), congestionControlEnabled, CongestionDBContAllocator, ET_NET, eventProcessor, MTHashTable< key_t, data_t >::first_entry(), CongestionDBCont::get_congest_list(), MTHashTable< key_t, data_t >::getSize(), MTHashTable< key_t, data_t >::lock_for_key(), CongestionDBCont::m_action, CongestionControlRecord::max_connection, Continuation::mutex, MUTEX_TRY_LOCK, MTHashTable< key_t, data_t >::next_entry(), CongestionEntry::pRecord, CongestionDB::RunTodoList(), SCHEDULE_CONGEST_CONT_INTERVAL, EventProcessor::schedule_in(), SET_CONTINUATION_HANDLER, CongestionEntry::sprint(), this_ethread(), and MIOBuffer::write().
void initCongestionDB | ( | ) |
Definition at line 434 of file CongestionDB.cc.
References CONGESTION_DB_SIZE, and MT_HASHTABLE_PARTITIONS.
void preCongestEntryGC | ( | void | ) |
Definition at line 137 of file CongestionDB.cc.
References congestEntryGCTime, ink_get_hrtime(), and ink_hrtime_to_sec().
void remove_all_congested_entry | ( | void | ) |
Definition at line 565 of file CongestionDB.cc.
References CongestionDB::removeAllRecords().
Referenced by remove_congested_entry().
void remove_congested_entry | ( | uint64_t | key | ) |
Definition at line 573 of file CongestionDB.cc.
References CongestionDB::removeRecord().
Referenced by remove_congested_entry().
void remove_congested_entry | ( | char * | buf, | |
MIOBuffer * | out_buffer | |||
) |
Definition at line 591 of file CongestionDB.cc.
References ats_ip_pton(), ats_is_ip(), make_key(), remove_all_congested_entry(), remove_congested_entry(), IpEndpoint::sa, and MIOBuffer::write().
void revalidateCongestionDB | ( | ) |
Definition at line 442 of file CongestionDB.cc.
References CONGESTION_DB_SIZE, CongestRequestParamAllocator, Debug, MTHashTable< key_t, data_t >::getSize(), ink_atomiclist_push(), MTHashTable< key_t, data_t >::lock_for_key(), CongestRequestParam::m_op, MT_HASHTABLE_PARTITIONS, MUTEX_TRY_LOCK, CongestionDB::revalidateBucket(), CongestionDB::RunTodoList(), this_ethread(), and CongestionDB::todo_lists.
Referenced by CongestionControlEnabledChanged(), and CongestionMatcherTable::reconfigure().
long congestEntryGCTime = 0 [static] |
Definition at line 130 of file CongestionDB.cc.
Referenced by congestEntryGC(), and preCongestEntryGC().
int CONGESTION_DB_SIZE = 1024 |
Definition at line 39 of file CongestionDB.cc.
Referenced by initCongestionDB(), and revalidateCongestionDB().
ClassAllocator< CongestionDBCont > CongestionDBContAllocator("CongestionDBContAllocator") [static] |
Referenced by Free_CongestionDBCont(), get_congest_entry(), and get_congest_list().
ClassAllocator<CongestRequestParam> CongestRequestParamAllocator("CongestRequestParamAllocator") |
CongestionDB* theCongestionDB = NULL |
Definition at line 41 of file CongestionDB.cc.