#include <P_ClusterCache.h>
Public Member Functions | |
int | invoke_remote (ClusterHandler *ch, int cluster_fn_index, void *data, int len, int options=CLUSTER_OPT_STEAL) |
int | invoke_remote_data (ClusterHandler *ch, int cluster_fn_index, void *data, int data_len, IOBufferBlock *buf, int logical_channel, ClusterVCToken *token, void(*bufdata_free)(void *), void *bufdata_free_arg, int options=CLUSTER_OPT_STEAL) |
int | invoke_remote_malloced (ClusterHandler *ch, ClusterRemoteDataHeader *data, int len) |
void | free_remote_data (char *data, int len) |
ClusterVConnection * | open_local (Continuation *cont, ClusterMachine *mp, ClusterVCToken &token, int options=0) |
ClusterVConnection * | connect_local (Continuation *cont, ClusterVCToken *token, int channel, int options=0) |
inkcoreapi bool | disable_remote_cluster_ops (ClusterMachine *) |
virtual int | init () |
virtual int | start () |
ClusterProcessor () | |
virtual | ~ClusterProcessor () |
void | connect (char *hostname, int16_t id=-1) |
void | connect (unsigned int ip, int port=0, int16_t id=-1, bool delay=false) |
void | send_machine_list (ClusterMachine *m) |
void | compute_cluster_mode () |
int | internal_invoke_remote (ClusterHandler *m, int cluster_fn, void *data, int len, int options, void *cmsg) |
Data Fields | |
ClusterAccept * | accept_handler |
Cluster * | this_cluster |
Definition at line 630 of file P_ClusterCache.h.
ClusterProcessor::ClusterProcessor | ( | ) |
Definition at line 42 of file ClusterProcessor.cc.
ClusterProcessor::~ClusterProcessor | ( | ) | [virtual] |
Definition at line 46 of file ClusterProcessor.cc.
References accept_handler, and ClusterAccept::ShutdownDelete().
void ClusterProcessor::compute_cluster_mode | ( | ) |
Definition at line 832 of file ClusterProcessor.cc.
References Note.
Referenced by GlobalClusterPeriodicEvent::calloutEvent(), and init().
void ClusterProcessor::connect | ( | unsigned int | ip, | |
int | port = 0 , |
|||
int16_t | id = -1 , |
|||
bool | delay = false | |||
) |
Definition at line 779 of file ClusterProcessor.cc.
References CLUSTER_MEMBER_DELAY, ClusterHandler::connectClusterEvent(), ClusterHandler::connector, ET_CLUSTER, eventProcessor, ClusterHandler::id, ClusterHandler::ip, ClusterHandler::port, EventProcessor::schedule_imm(), EventProcessor::schedule_in(), and SET_CONTINUATION_HANDLER.
void ClusterProcessor::connect | ( | char * | hostname, | |
int16_t | id = -1 | |||
) |
Definition at line 765 of file ClusterProcessor.cc.
References ats_strdup, ClusterHandler::connectClusterEvent(), ClusterHandler::connector, ET_CLUSTER, eventProcessor, ClusterHandler::hostname, ClusterHandler::id, EventProcessor::schedule_imm(), and SET_CONTINUATION_HANDLER.
Referenced by ClusterHandler::machine_down(), machine_list_ClusterFunction(), make_cluster_connections(), redirect_test(), and ClusterHandler::startClusterEvent().
ClusterVConnection * ClusterProcessor::connect_local | ( | Continuation * | cont, | |
ClusterVCToken * | token, | |||
int | channel, | |||
int | options = 0 | |||
) |
Definition at line 290 of file ClusterProcessor.cc.
References ClusterVConnectionBase::action_, ClusterVConnection::ch, ClusterVCToken::ch_id, ClusterVConnection::channel, CLUSTER_CONNECTIONS_OPEN_STAT, CLUSTER_CONNECTIONS_OPENNED_STAT, CLUSTER_INCREMENT_DYN_STAT, CLUSTER_OPT_CONN_READ, ClusterMachine::clusterHandlers, clusterVCAllocator, clusterVCAllocator_free(), Cluster::current_configuration(), ClusterConfiguration::find(), ink_get_hrtime(), ClusterVCToken::ip_created, ClusterVConnection::last_activity_time, Continuation::mutex, Thread::mutex, MUTEX_TRY_LOCK, ClusterVConnection::new_connect_read, ClusterMachine::num_connections, EThread::schedule_imm_signal(), ClusterVConnection::start(), ClusterVConnection::start_time, this_cluster, this_ethread(), ClusterHandler::thread, and ClusterVConnection::token.
Referenced by cache_op_ClusterFunction().
bool ClusterProcessor::disable_remote_cluster_ops | ( | ClusterMachine * | m | ) |
Definition at line 356 of file ClusterProcessor.cc.
References ClusterHandler::disable_remote_cluster_ops, and ClusterMachine::pop_ClusterHandler().
Referenced by Cluster_deref(), Cluster_link(), Cluster_lookup(), Cluster_read(), Cluster_remove(), and Cluster_write().
void ClusterProcessor::free_remote_data | ( | char * | data, | |
int | len | |||
) |
Definition at line 203 of file ClusterProcessor.cc.
References ALLOC_DATA_MAGIC, DEFAULT_BUFFER_SIZES, ink_assert, ink_release_assert, and memcpy.
Referenced by cache_op_malloc_ClusterFunction(), default_api_ClusterFunction(), and TSFreeRPCMsg().
int ClusterProcessor::init | ( | ) | [virtual] |
Definition at line 390 of file ClusterProcessor.cc.
References ClusterLoadMonitor::cf_cluster_load_clear_duration, ClusterLoadMonitor::cf_cluster_load_compute_msec_interval, ClusterLoadMonitor::cf_cluster_load_exceed_duration, ClusterLoadMonitor::cf_cluster_periodic_msec_interval, ClusterLoadMonitor::cf_monitor_enabled, ClusterLoadMonitor::cf_msecs_per_ping_response_bucket, ClusterLoadMonitor::cf_num_ping_response_buckets, ClusterLoadMonitor::cf_ping_history_buf_length, ClusterLoadMonitor::cf_ping_latency_threshold_msecs, ClusterLoadMonitor::cf_ping_message_send_msec_interval, channel_dummy_output, CLUSTER_ALLOC_DATA_NEWS_STAT, CLUSTER_BYTE_BANK_USED_STAT, CLUSTER_CACHE_CALLBACK_TIME_STAT, CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT, CLUSTER_CACHE_OUTSTANDING_STAT, CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT, CLUSTER_CHAN_INUSE_STAT, CLUSTER_CLEAR_DYN_STAT, CLUSTER_CON_TOTAL_TIME_STAT, CLUSTER_CONFIGURATION_CHANGES_STAT, CLUSTER_CONNECTIONS_BUMPED_STAT, CLUSTER_CONNECTIONS_OPEN_STAT, CLUSTER_CONNECTIONS_OPENNED_STAT, CLUSTER_CONNECTIONS_READ_LOCKED_STAT, CLUSTER_CONNECTIONS_WRITE_LOCKED_STAT, CLUSTER_CTRL_MSGS_RECV_TIME_STAT, CLUSTER_CTRL_MSGS_SEND_TIME_STAT, CLUSTER_DELAYED_READS_STAT, CLUSTER_HASH_TABLE_SIZE, CLUSTER_LEVEL1_BANK_STAT, CLUSTER_LOCAL_CONNECTION_TIME_STAT, CLUSTER_MACHINES_ALLOCATED_STAT, CLUSTER_MACHINES_FREED_STAT, CLUSTER_MULTILEVEL_BANK_STAT, CLUSTER_NET_BACKUP_STAT, CLUSTER_NO_REMOTE_SPACE_STAT, CLUSTER_NODES_STAT, CLUSTER_OP_DELAYED_FOR_LOCK_STAT, CLUSTER_OPEN_DELAY_TIME_STAT, CLUSTER_PARTIAL_READS_STAT, CLUSTER_PARTIAL_WRITES_STAT, CLUSTER_PING_TIME_STAT, cluster_port, cluster_port_number, CLUSTER_RDMSG_ASSEMBLE_TIME_STAT, CLUSTER_READ_BYTES_STAT, CLUSTER_REMOTE_CONNECTION_TIME_STAT, CLUSTER_REMOTE_OP_REPLY_TIMEOUTS_STAT, CLUSTER_REMOTE_OP_TIMEOUTS_STAT, CLUSTER_SETDATA_NO_CACHEVC_STAT, cluster_setdata_no_CLUSTER_STAT, cluster_setdata_no_CLUSTERVC_STAT, CLUSTER_SETDATA_NO_TUNNEL_STAT, CLUSTER_SLOW_CTRL_MSGS_SENT_STAT, cluster_stat_count, CLUSTER_SUM_GLOBAL_DYN_STAT, CLUSTER_VC_CACHE_INSERT_LOCK_MISSES_STAT, CLUSTER_VC_CACHE_INSERTS_STAT, CLUSTER_VC_CACHE_LOOKUP_HITS_STAT, CLUSTER_VC_CACHE_LOOKUP_LOCK_MISSES_STAT, CLUSTER_VC_CACHE_LOOKUP_MISSES_STAT, CLUSTER_VC_CACHE_PURGES_STAT, CLUSTER_VC_CACHE_SCAN_LOCK_MISSES_STAT, CLUSTER_VC_CACHE_SCANS_STAT, CLUSTER_VC_READ_LIST_LEN_STAT, CLUSTER_VC_WRITE_LIST_LEN_STAT, CLUSTER_VC_WRITE_STALL_STAT, CLUSTER_WRITE_BB_MALLOCS_STAT, CLUSTER_WRITE_BYTES_STAT, CLUSTER_WRITE_LOCK_MISSES_STAT, clusterAPI_init(), compute_cluster_mode(), Cluster::configurations, create_this_cluster_machine(), DEFAULT_CLUSTER_PORT_NUMBER, DEFAULT_NUMBER_OF_CLUSTER_THREADS, ClusterConfiguration::hash_table, GlobalClusterPeriodicEvent::init(), ClusterConfiguration::machines, ClusterConfiguration::n_machines, Note, num_of_cluster_threads, PeriodicClusterEvent, SLL< C, L >::push(), REC_EstablishStaticConfigInt32, REC_ReadConfigInteger, RecAllocateRawStatBlock(), RECD_FLOAT, RECD_INT, RECP_NON_PERSISTENT, RecRawStatSyncAvg(), RecRawStatSyncCount(), RecRawStatSyncHrTimeAvg(), RecRawStatSyncSum(), RecRegisterRawStat, RECT_PROCESS, this_cluster, and this_cluster_machine().
Referenced by init_clusterprocessor(), and main().
int ClusterProcessor::internal_invoke_remote | ( | ClusterHandler * | m, | |
int | cluster_fn, | |||
void * | data, | |||
int | len, | |||
int | options, | |||
void * | cmsg | |||
) |
Definition at line 55 of file ClusterProcessor.cc.
References OutgoingControl::alloc(), OutgoingControl::alloc_data(), ats_free(), CLUSTER_CTRL_MSGS_SENT_STAT, CLUSTER_INCREMENT_DYN_STAT, CLUSTER_OPT_DATA_IS_OCONTROL, CLUSTER_OPT_DELAY, CLUSTER_OPT_STEAL, CLUSTER_SLOW_CTRL_MSGS_SENT_STAT, ClusterFuncToQpri(), ClusterControl::data, invoke_remote_data_args::data_oc, eventProcessor, ClusterControl::fast_data(), OutgoingControl::freeall(), ink_assert, ink_atomiclist_push(), ink_get_hrtime(), ClusterControl::len, invoke_remote_data_args::MagicNo, invoke_remote_data_args::magicno, memcpy, invoke_remote_data_args::msg_oc, Continuation::mutex, Thread::mutex, MUTEX_TRY_LOCK, ClusterHandler::outgoing_control_al, EventProcessor::schedule_imm_signal(), SET_CONTINUATION_HANDLER, OutgoingControl::set_data(), EThread::signal_hook, SIZE_clusterFunction, OutgoingControl::startEvent(), ClusterHandler::steal_thread(), OutgoingControl::submit_time, this_ethread(), and ClusterHandler::thread.
Referenced by invoke_remote(), and invoke_remote_data().
int ClusterProcessor::invoke_remote | ( | ClusterHandler * | ch, | |
int | cluster_fn_index, | |||
void * | data, | |||
int | len, | |||
int | options = CLUSTER_OPT_STEAL | |||
) |
Definition at line 153 of file ClusterProcessor.cc.
References internal_invoke_remote().
Referenced by ClusterHandler::close_ClusterVConnection(), cluster_ping(), HostDBContinuation::do_get_response(), CacheContinuation::do_op(), HostDBContinuation::do_put_response(), CacheContinuation::do_remote_lookup(), invoke_remote_malloced(), CacheContinuation::localVCsetupEvent(), ping_ClusterFunction(), CacheContinuation::replyLookupEvent(), CacheContinuation::replyOpEvent(), send_machine_list(), ClusterVConnection::set_disk_io_priority(), ClusterVConnection::set_http_info(), ClusterVConnection::set_pin_in_cache(), and TSSendClusterRPC().
int ClusterProcessor::invoke_remote_data | ( | ClusterHandler * | ch, | |
int | cluster_fn_index, | |||
void * | data, | |||
int | data_len, | |||
IOBufferBlock * | buf, | |||
int | logical_channel, | |||
ClusterVCToken * | token, | |||
void(*)(void *) | bufdata_free, | |||
void * | bufdata_free_arg, | |||
int | options = CLUSTER_OPT_STEAL | |||
) |
Definition at line 159 of file ClusterProcessor.cc.
References OutgoingControl::alloc(), OutgoingControl::alloc_data(), ClusterControl::data, invoke_remote_data_args::data_oc, invoke_remote_data_args::dest_channel, ink_assert, ink_get_hrtime(), internal_invoke_remote(), ClusterControl::len, memcpy, invoke_remote_data_args::msg_oc, OutgoingControl::set_data(), OutgoingControl::submit_time, and invoke_remote_data_args::token.
Referenced by CacheContinuation::replyOpEvent().
int ClusterProcessor::invoke_remote_malloced | ( | ClusterHandler * | ch, | |
ClusterRemoteDataHeader * | data, | |||
int | len | |||
) | [inline] |
Definition at line 651 of file P_ClusterCache.h.
References CLUSTER_FUNCTION_MALLOCED, and invoke_remote().
ClusterVConnection * ClusterProcessor::open_local | ( | Continuation * | cont, | |
ClusterMachine * | mp, | |||
ClusterVCToken & | token, | |||
int | options = 0 | |||
) |
Definition at line 228 of file ClusterProcessor.cc.
References ClusterVConnectionBase::action_, ClusterVCToken::alloc(), ClusterVConnection::ch, ClusterVCToken::ch_id, CLUSTER_CONNECTIONS_OPEN_STAT, CLUSTER_CONNECTIONS_OPENNED_STAT, CLUSTER_INCREMENT_DYN_STAT, CLUSTER_OPT_CONN_READ, clusterVCAllocator, clusterVCAllocator_free(), ClusterHandler::external_incoming_open_local, ClusterHandler::id, ink_atomiclist_push(), ink_get_hrtime(), ClusterVConnection::last_activity_time, Continuation::mutex, Thread::mutex, MUTEX_TRY_LOCK, ClusterVConnection::new_connect_read, EThread::signal_hook, ClusterVConnection::start(), ClusterVConnection::start_time, this_ethread(), ClusterHandler::thread, and ClusterVConnection::token.
Referenced by CacheContinuation::lookupOpenWriteVC(), and CacheContinuation::setup_local_vc().
void ClusterProcessor::send_machine_list | ( | ClusterMachine * | m | ) |
Definition at line 797 of file ClusterProcessor.cc.
References Cluster::current_configuration(), ink_release_assert, invoke_remote(), ClusterMachine::ip, MachineListMessage::ip, MachineListMessage::MACHINE_LIST_MESSAGE_VERSION, ClusterConfiguration::machines, ClusterMachine::msg_proto_major, MachineListMessage::n_ip, ClusterMachine::pop_ClusterHandler(), MachineListMessage::protoToVersion(), MachineListMessage::sizeof_fixedlen_msg(), and this_cluster.
int ClusterProcessor::start | ( | ) | [virtual] |
Definition at line 737 of file ClusterProcessor.cc.
References accept_handler, cacheProcessor, CLUSTER_CONFIG, cluster_port, ClusterMachine::cluster_port, do_machine_config_change(), ET_CLUSTER, eventProcessor, EventProcessor::eventthread, ClusterAccept::Init(), initialize_thread_for_net(), CacheProcessor::IsCacheEnabled(), MACHINE_CONFIG, machine_config_change(), EventProcessor::n_threads_for_type, num_of_cluster_threads, REC_ReadConfigInteger, REC_RegisterConfigUpdateFunc, EventProcessor::spawn_event_threads(), and this_cluster_machine().
Referenced by CacheProcessor::cacheInitialized().
Definition at line 696 of file P_ClusterCache.h.
Referenced by start(), and ~ClusterProcessor().
Definition at line 697 of file P_ClusterCache.h.
Referenced by connect_local(), init(), send_machine_list(), test(), and this_cluster().