http://git-wip-us.apache.org/repos/asf/trafficserver/blob/65477944/iocore/cluster/ClusterProcessor.cc ---------------------------------------------------------------------- diff --git a/iocore/cluster/ClusterProcessor.cc b/iocore/cluster/ClusterProcessor.cc index d205d43..843c30a 100644 --- a/iocore/cluster/ClusterProcessor.cc +++ b/iocore/cluster/ClusterProcessor.cc @@ -39,7 +39,7 @@ ClusterProcessor clusterProcessor; RecRawStatBlock *cluster_rsb = NULL; int ET_CLUSTER; -ClusterProcessor::ClusterProcessor():accept_handler(NULL), this_cluster(NULL) +ClusterProcessor::ClusterProcessor() : accept_handler(NULL), this_cluster(NULL) { } @@ -52,8 +52,7 @@ ClusterProcessor::~ClusterProcessor() } int -ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, - void *data, int len, int options, void *cmsg) +ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, void *data, int len, int options, void *cmsg) { EThread *thread = this_ethread(); ProxyMutex *mutex = thread->mutex; @@ -67,18 +66,17 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, bool malloced = (cluster_fn == CLUSTER_FUNCTION_MALLOCED); OutgoingControl *c; - if (!ch || (!malloced && !((unsigned int) cluster_fn < (uint32_t) SIZE_clusterFunction))) { + if (!ch || (!malloced && !((unsigned int)cluster_fn < (uint32_t)SIZE_clusterFunction))) { // Invalid message or node is down, free message data if (cmsg) { - invoke_remote_data_args *args = (invoke_remote_data_args *) - (((OutgoingControl *) cmsg)->data + sizeof(int32_t)); + invoke_remote_data_args *args = (invoke_remote_data_args *)(((OutgoingControl *)cmsg)->data + sizeof(int32_t)); ink_assert(args->magicno == invoke_remote_data_args::MagicNo); args->data_oc->freeall(); - ((OutgoingControl *) cmsg)->freeall(); + ((OutgoingControl *)cmsg)->freeall(); } if (data_in_ocntl) { - c = *((OutgoingControl **) ((char *) data - sizeof(OutgoingControl *))); + c = *((OutgoingControl **)((char *)data - sizeof(OutgoingControl *))); c->freeall(); } if (malloced) { @@ -88,7 +86,7 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, } if (data_in_ocntl) { - c = *((OutgoingControl **) ((char *) data - sizeof(OutgoingControl *))); + c = *((OutgoingControl **)((char *)data - sizeof(OutgoingControl *))); } else { c = OutgoingControl::alloc(); } @@ -96,7 +94,7 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, c->submit_time = ink_get_hrtime(); if (malloced) { - c->set_data((char *) data, len); + c->set_data((char *)data, len); } else { if (!data_in_ocntl) { c->len = len + sizeof(int32_t); @@ -105,23 +103,22 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, if (!c->fast_data()) { CLUSTER_INCREMENT_DYN_STAT(CLUSTER_SLOW_CTRL_MSGS_SENT_STAT); } - *(int32_t *) c->data = cluster_fn; + *(int32_t *)c->data = cluster_fn; if (!data_in_ocntl) { memcpy(c->data + sizeof(int32_t), data, len); } } - SET_CONTINUATION_HANDLER(c, (OutgoingCtrlHandler) & OutgoingControl::startEvent); + SET_CONTINUATION_HANDLER(c, (OutgoingCtrlHandler)&OutgoingControl::startEvent); ///////////////////////////////////// // Compound message adjustments ///////////////////////////////////// if (cmsg) { - invoke_remote_data_args *args = (invoke_remote_data_args *) - (((OutgoingControl *) cmsg)->data + sizeof(int32_t)); + invoke_remote_data_args *args = (invoke_remote_data_args *)(((OutgoingControl *)cmsg)->data + sizeof(int32_t)); ink_assert(args->magicno == invoke_remote_data_args::MagicNo); args->msg_oc = c; - c = (OutgoingControl *) cmsg; + c = (OutgoingControl *)cmsg; } #ifndef CLUSTER_THREAD_STEALING delay = true; @@ -130,13 +127,13 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, EThread *tt = this_ethread(); { int q = ClusterFuncToQpri(cluster_fn); - ink_atomiclist_push(&ch->outgoing_control_al[q], (void *) c); + ink_atomiclist_push(&ch->outgoing_control_al[q], (void *)c); MUTEX_TRY_LOCK(lock, ch->mutex, tt); if (!lock.is_locked()) { - if(ch->thread && ch->thread->signal_hook) - ch->thread->signal_hook(ch->thread); - return 1; + if (ch->thread && ch->thread->signal_hook) + ch->thread->signal_hook(ch->thread); + return 1; } if (steal) ch->steal_thread(tt); @@ -152,19 +149,17 @@ ClusterProcessor::internal_invoke_remote(ClusterHandler *ch, int cluster_fn, int ClusterProcessor::invoke_remote(ClusterHandler *ch, int cluster_fn, void *data, int len, int options) { - return internal_invoke_remote(ch, cluster_fn, data, len, options, (void *) NULL); + return internal_invoke_remote(ch, cluster_fn, data, len, options, (void *)NULL); } int -ClusterProcessor::invoke_remote_data(ClusterHandler *ch, int cluster_fn, - void *data, int data_len, - IOBufferBlock * buf, - int dest_channel, ClusterVCToken * token, - void (*bufdata_free_proc) (void *), void *bufdata_free_proc_arg, int options) +ClusterProcessor::invoke_remote_data(ClusterHandler *ch, int cluster_fn, void *data, int data_len, IOBufferBlock *buf, + int dest_channel, ClusterVCToken *token, void (*bufdata_free_proc)(void *), + void *bufdata_free_proc_arg, int options) { if (!buf) { // No buffer data, translate this into a invoke_remote() request - return internal_invoke_remote(ch, cluster_fn, data, data_len, options, (void *) NULL); + return internal_invoke_remote(ch, cluster_fn, data, data_len, options, (void *)NULL); } ink_assert(data); ink_assert(data_len); @@ -192,20 +187,20 @@ ClusterProcessor::invoke_remote_data(ClusterHandler *ch, int cluster_fn, chdr->submit_time = ink_get_hrtime(); chdr->len = sizeof(int32_t) + sizeof(mh); chdr->alloc_data(); - *(int32_t *) chdr->data = -1; // always -1 for compound message - memcpy(chdr->data + sizeof(int32_t), (char *) &mh, sizeof(mh)); + *(int32_t *)chdr->data = -1; // always -1 for compound message + memcpy(chdr->data + sizeof(int32_t), (char *)&mh, sizeof(mh)); - return internal_invoke_remote(ch, cluster_fn, data, data_len, options, (void *) chdr); + return internal_invoke_remote(ch, cluster_fn, data, data_len, options, (void *)chdr); } // TODO: Why pass in the length here if not used ? void ClusterProcessor::free_remote_data(char *p, int /* l ATS_UNUSED */) { - char *d = p - sizeof(int32_t); // reset to ptr to function code + char *d = p - sizeof(int32_t); // reset to ptr to function code int data_hdr = ClusterControl::DATA_HDR; - ink_release_assert(*((uint8_t *) (d - data_hdr + 1)) == (uint8_t) ALLOC_DATA_MAGIC); + ink_release_assert(*((uint8_t *)(d - data_hdr + 1)) == (uint8_t)ALLOC_DATA_MAGIC); unsigned char size_index = *(d - data_hdr); if (!(size_index & 0x80)) { ink_release_assert(size_index <= (DEFAULT_BUFFER_SIZES - 1)); @@ -216,7 +211,7 @@ ClusterProcessor::free_remote_data(char *p, int /* l ATS_UNUSED */) // Extract 'this' pointer ClusterControl *ccl; - memcpy((char *) &ccl, (d - data_hdr + 2), sizeof(void *)); + memcpy((char *)&ccl, (d - data_hdr + 2), sizeof(void *)); ink_assert(ccl->valid_alloc_data()); // Deallocate control structure and data @@ -225,7 +220,7 @@ ClusterProcessor::free_remote_data(char *p, int /* l ATS_UNUSED */) } ClusterVConnection * -ClusterProcessor::open_local(Continuation * cont, ClusterMachine */* m ATS_UNUSED */, ClusterVCToken & token, int options) +ClusterProcessor::open_local(Continuation *cont, ClusterMachine * /* m ATS_UNUSED */, ClusterVCToken &token, int options) { // // New connect protocol. @@ -265,9 +260,9 @@ ClusterProcessor::open_local(Continuation * cont, ClusterMachine */* m ATS_UNUSE return NULL; } vc->action_ = cont; - ink_atomiclist_push(&ch->external_incoming_open_local, (void *) vc); - if(ch->thread && ch->thread->signal_hook) - ch->thread->signal_hook(ch->thread); + ink_atomiclist_push(&ch->external_incoming_open_local, (void *)vc); + if (ch->thread && ch->thread->signal_hook) + ch->thread->signal_hook(ch->thread); return CLUSTER_DELAYED_OPEN; #ifdef CLUSTER_THREAD_STEALING @@ -287,7 +282,7 @@ ClusterProcessor::open_local(Continuation * cont, ClusterMachine */* m ATS_UNUSE } ClusterVConnection * -ClusterProcessor::connect_local(Continuation * cont, ClusterVCToken * token, int channel, int options) +ClusterProcessor::connect_local(Continuation *cont, ClusterVCToken *token, int channel, int options) { // // Establish VC connection initiated by remote node on the local node @@ -353,7 +348,8 @@ ClusterProcessor::connect_local(Continuation * cont, ClusterVCToken * token, int #endif } -bool ClusterProcessor::disable_remote_cluster_ops(ClusterMachine * m) +bool +ClusterProcessor::disable_remote_cluster_ops(ClusterMachine *m) { ClusterHandler *ch = m->pop_ClusterHandler(1); if (ch) { @@ -368,8 +364,7 @@ bool ClusterProcessor::disable_remote_cluster_ops(ClusterMachine * m) //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// -GlobalClusterPeriodicEvent * - PeriodicClusterEvent; +GlobalClusterPeriodicEvent *PeriodicClusterEvent; #ifdef CLUSTER_TOMCAT extern int cache_clustering_enabled; @@ -389,288 +384,220 @@ int RPC_only_CacheCluster = 0; int ClusterProcessor::init() { - cluster_rsb = RecAllocateRawStatBlock((int) cluster_stat_count); + cluster_rsb = RecAllocateRawStatBlock((int)cluster_stat_count); // // Statistics callbacks // - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_open", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CONNECTIONS_OPEN_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_open", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CONNECTIONS_OPEN_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CONNECTIONS_OPEN_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_opened", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CONNECTIONS_OPENNED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_opened", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CONNECTIONS_OPENNED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CONNECTIONS_OPENNED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_closed", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CON_TOTAL_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_closed", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CON_TOTAL_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CON_TOTAL_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.slow_ctrl_msgs_sent", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_SLOW_CTRL_MSGS_SENT_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.slow_ctrl_msgs_sent", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_SLOW_CTRL_MSGS_SENT_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_SLOW_CTRL_MSGS_SENT_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_read_locked", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CONNECTIONS_READ_LOCKED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_read_locked", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CONNECTIONS_READ_LOCKED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CONNECTIONS_READ_LOCKED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_write_locked", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CONNECTIONS_WRITE_LOCKED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_write_locked", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CONNECTIONS_WRITE_LOCKED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CONNECTIONS_WRITE_LOCKED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.reads", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_READ_BYTES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.reads", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_READ_BYTES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_READ_BYTES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.read_bytes", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_READ_BYTES_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.read_bytes", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_READ_BYTES_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_READ_BYTES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.writes", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_WRITE_BYTES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.writes", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_WRITE_BYTES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_WRITE_BYTES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.write_bytes", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_WRITE_BYTES_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.write_bytes", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_WRITE_BYTES_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_WRITE_BYTES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.control_messages_sent", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CTRL_MSGS_SEND_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.control_messages_sent", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CTRL_MSGS_SEND_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CTRL_MSGS_SEND_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.control_messages_received", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CTRL_MSGS_RECV_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.control_messages_received", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CTRL_MSGS_RECV_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CTRL_MSGS_RECV_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.op_delayed_for_lock", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_OP_DELAYED_FOR_LOCK_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.op_delayed_for_lock", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_OP_DELAYED_FOR_LOCK_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_OP_DELAYED_FOR_LOCK_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_bumped", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CONNECTIONS_BUMPED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_bumped", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CONNECTIONS_BUMPED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CONNECTIONS_BUMPED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.net_backup", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_NET_BACKUP_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.net_backup", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_NET_BACKUP_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_NET_BACKUP_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.nodes", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_NODES_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.nodes", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_NODES_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_NODES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.machines_allocated", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_MACHINES_ALLOCATED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.machines_allocated", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_MACHINES_ALLOCATED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_MACHINES_ALLOCATED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.machines_freed", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_MACHINES_FREED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.machines_freed", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_MACHINES_FREED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_MACHINES_FREED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.configuration_changes", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CONFIGURATION_CHANGES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.configuration_changes", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CONFIGURATION_CHANGES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CONFIGURATION_CHANGES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.delayed_reads", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_DELAYED_READS_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.delayed_reads", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_DELAYED_READS_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_DELAYED_READS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.byte_bank_used", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_BYTE_BANK_USED_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.byte_bank_used", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_BYTE_BANK_USED_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_BYTE_BANK_USED_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.alloc_data_news", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_ALLOC_DATA_NEWS_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.alloc_data_news", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_ALLOC_DATA_NEWS_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_ALLOC_DATA_NEWS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.write_bb_mallocs", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_WRITE_BB_MALLOCS_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.write_bb_mallocs", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_WRITE_BB_MALLOCS_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_WRITE_BB_MALLOCS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.partial_reads", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_PARTIAL_READS_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.partial_reads", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_PARTIAL_READS_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_PARTIAL_READS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.partial_writes", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_PARTIAL_WRITES_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.partial_writes", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_PARTIAL_WRITES_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_PARTIAL_WRITES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.cache_outstanding", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CACHE_OUTSTANDING_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.cache_outstanding", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_OUTSTANDING_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_OUTSTANDING_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.remote_op_timeouts", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_REMOTE_OP_TIMEOUTS_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.remote_op_timeouts", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_REMOTE_OP_TIMEOUTS_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_REMOTE_OP_TIMEOUTS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.remote_op_reply_timeouts", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_REMOTE_OP_REPLY_TIMEOUTS_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.remote_op_reply_timeouts", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_REMOTE_OP_REPLY_TIMEOUTS_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_REMOTE_OP_REPLY_TIMEOUTS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.chan_inuse", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CHAN_INUSE_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.chan_inuse", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CHAN_INUSE_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CHAN_INUSE_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.open_delays", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_OPEN_DELAY_TIME_STAT, RecRawStatSyncSum); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.open_delays", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_OPEN_DELAY_TIME_STAT, RecRawStatSyncSum); CLUSTER_CLEAR_DYN_STAT(CLUSTER_OPEN_DELAY_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.connections_avg_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_CON_TOTAL_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.connections_avg_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_CON_TOTAL_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CON_TOTAL_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.control_messages_avg_send_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_CTRL_MSGS_SEND_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.control_messages_avg_send_time", RECD_FLOAT, + RECP_NON_PERSISTENT, (int)CLUSTER_CTRL_MSGS_SEND_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CTRL_MSGS_SEND_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.control_messages_avg_receive_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_CTRL_MSGS_RECV_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.control_messages_avg_receive_time", RECD_FLOAT, + RECP_NON_PERSISTENT, (int)CLUSTER_CTRL_MSGS_RECV_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CTRL_MSGS_RECV_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.open_delay_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_OPEN_DELAY_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.open_delay_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_OPEN_DELAY_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_OPEN_DELAY_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.cache_callback_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_CACHE_CALLBACK_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.cache_callback_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_CALLBACK_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_CALLBACK_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.rmt_cache_callback_time", - RECD_FLOAT, RECP_NON_PERSISTENT, - (int) CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.rmt_cache_callback_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.lkrmt_cache_callback_time", - RECD_FLOAT, RECP_NON_PERSISTENT, - (int) CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.lkrmt_cache_callback_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.local_connection_time", - RECD_FLOAT, RECP_NON_PERSISTENT, - (int) CLUSTER_LOCAL_CONNECTION_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.local_connection_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_LOCAL_CONNECTION_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_LOCAL_CONNECTION_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.remote_connection_time", - RECD_FLOAT, RECP_NON_PERSISTENT, - (int) CLUSTER_REMOTE_CONNECTION_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.remote_connection_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_REMOTE_CONNECTION_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_REMOTE_CONNECTION_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.rdmsg_assemble_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_RDMSG_ASSEMBLE_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.rdmsg_assemble_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_RDMSG_ASSEMBLE_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_RDMSG_ASSEMBLE_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.cluster_ping_time", - RECD_FLOAT, RECP_NON_PERSISTENT, (int) CLUSTER_PING_TIME_STAT, RecRawStatSyncHrTimeAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.cluster_ping_time", RECD_FLOAT, RECP_NON_PERSISTENT, + (int)CLUSTER_PING_TIME_STAT, RecRawStatSyncHrTimeAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_PING_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.cache_callbacks", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CACHE_CALLBACK_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.cache_callbacks", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_CALLBACK_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_CALLBACK_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.rmt_cache_callbacks", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.rmt_cache_callbacks", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_RMT_CALLBACK_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.lkrmt_cache_callbacks", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.lkrmt_cache_callbacks", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_CACHE_LKRMT_CALLBACK_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.local_connections_closed", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_LOCAL_CONNECTION_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.local_connections_closed", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_LOCAL_CONNECTION_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_LOCAL_CONNECTION_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.remote_connections_closed", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_REMOTE_CONNECTION_TIME_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.remote_connections_closed", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_REMOTE_CONNECTION_TIME_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_REMOTE_CONNECTION_TIME_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.setdata_no_clustervc", - RECD_INT, RECP_NON_PERSISTENT, (int) cluster_setdata_no_CLUSTERVC_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.setdata_no_clustervc", RECD_INT, RECP_NON_PERSISTENT, + (int)cluster_setdata_no_CLUSTERVC_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(cluster_setdata_no_CLUSTERVC_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.setdata_no_tunnel", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_SETDATA_NO_TUNNEL_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.setdata_no_tunnel", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_SETDATA_NO_TUNNEL_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_SETDATA_NO_TUNNEL_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.setdata_no_cachevc", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_SETDATA_NO_CACHEVC_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.setdata_no_cachevc", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_SETDATA_NO_CACHEVC_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_SETDATA_NO_CACHEVC_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.setdata_no_cluster", - RECD_INT, RECP_NON_PERSISTENT, (int) cluster_setdata_no_CLUSTER_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.setdata_no_cluster", RECD_INT, RECP_NON_PERSISTENT, + (int)cluster_setdata_no_CLUSTER_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(cluster_setdata_no_CLUSTER_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_write_stall", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_WRITE_STALL_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_write_stall", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_WRITE_STALL_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_WRITE_STALL_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.no_remote_space", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_NO_REMOTE_SPACE_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.no_remote_space", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_NO_REMOTE_SPACE_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_NO_REMOTE_SPACE_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.level1_bank", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_LEVEL1_BANK_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.level1_bank", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_LEVEL1_BANK_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_LEVEL1_BANK_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.multilevel_bank", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_MULTILEVEL_BANK_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.multilevel_bank", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_MULTILEVEL_BANK_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_MULTILEVEL_BANK_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_insert_lock_misses", - RECD_INT, RECP_NON_PERSISTENT, - (int) CLUSTER_VC_CACHE_INSERT_LOCK_MISSES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_insert_lock_misses", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_INSERT_LOCK_MISSES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_INSERT_LOCK_MISSES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_inserts", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_CACHE_INSERTS_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_inserts", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_INSERTS_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_INSERTS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_lookup_lock_misses", - RECD_INT, RECP_NON_PERSISTENT, - (int) CLUSTER_VC_CACHE_LOOKUP_LOCK_MISSES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_lookup_lock_misses", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_LOOKUP_LOCK_MISSES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_LOOKUP_LOCK_MISSES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_lookup_hits", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_CACHE_LOOKUP_HITS_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_lookup_hits", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_LOOKUP_HITS_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_LOOKUP_HITS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_lookup_misses", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_CACHE_LOOKUP_MISSES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_lookup_misses", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_LOOKUP_MISSES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_LOOKUP_MISSES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_scans", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_CACHE_SCANS_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_scans", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_SCANS_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_SCANS_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_scan_lock_misses", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_CACHE_SCAN_LOCK_MISSES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_scan_lock_misses", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_SCAN_LOCK_MISSES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_SCAN_LOCK_MISSES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_cache_purges", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_CACHE_PURGES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_cache_purges", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_CACHE_PURGES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_CACHE_PURGES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.write_lock_misses", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_WRITE_LOCK_MISSES_STAT, RecRawStatSyncCount); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.write_lock_misses", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_WRITE_LOCK_MISSES_STAT, RecRawStatSyncCount); CLUSTER_CLEAR_DYN_STAT(CLUSTER_WRITE_LOCK_MISSES_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_read_list_len", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_READ_LIST_LEN_STAT, RecRawStatSyncAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_read_list_len", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_READ_LIST_LEN_STAT, RecRawStatSyncAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_READ_LIST_LEN_STAT); - RecRegisterRawStat(cluster_rsb, RECT_PROCESS, - "proxy.process.cluster.vc_write_list_len", - RECD_INT, RECP_NON_PERSISTENT, (int) CLUSTER_VC_WRITE_LIST_LEN_STAT, RecRawStatSyncAvg); + RecRegisterRawStat(cluster_rsb, RECT_PROCESS, "proxy.process.cluster.vc_write_list_len", RECD_INT, RECP_NON_PERSISTENT, + (int)CLUSTER_VC_WRITE_LIST_LEN_STAT, RecRawStatSyncAvg); CLUSTER_CLEAR_DYN_STAT(CLUSTER_VC_WRITE_LIST_LEN_STAT); - CLUSTER_CLEAR_DYN_STAT(CLUSTER_NODES_STAT); // clear sum and count + CLUSTER_CLEAR_DYN_STAT(CLUSTER_NODES_STAT); // clear sum and count // INKqa08033: win2k: ui: cluster warning light on // Used to call CLUSTER_INCREMENT_DYN_STAT here; switch to SUM_GLOBAL_DYN_STAT - CLUSTER_SUM_GLOBAL_DYN_STAT(CLUSTER_NODES_STAT, 1); // one node in cluster, ME + CLUSTER_SUM_GLOBAL_DYN_STAT(CLUSTER_NODES_STAT, 1); // one node in cluster, ME REC_ReadConfigInteger(ClusterLoadMonitor::cf_monitor_enabled, "proxy.config.cluster.load_monitor_enabled"); REC_ReadConfigInteger(ClusterLoadMonitor::cf_ping_message_send_msec_interval, "proxy.config.cluster.ping_send_interval_msecs"); REC_ReadConfigInteger(ClusterLoadMonitor::cf_num_ping_response_buckets, "proxy.config.cluster.ping_response_buckets"); - REC_ReadConfigInteger(ClusterLoadMonitor::cf_msecs_per_ping_response_bucket, "proxy.config.cluster.msecs_per_ping_response_bucket"); + REC_ReadConfigInteger(ClusterLoadMonitor::cf_msecs_per_ping_response_bucket, + "proxy.config.cluster.msecs_per_ping_response_bucket"); REC_ReadConfigInteger(ClusterLoadMonitor::cf_ping_latency_threshold_msecs, "proxy.config.cluster.ping_latency_threshold_msecs"); - REC_ReadConfigInteger(ClusterLoadMonitor::cf_cluster_load_compute_msec_interval, "proxy.config.cluster.load_compute_interval_msecs"); - REC_ReadConfigInteger(ClusterLoadMonitor::cf_cluster_periodic_msec_interval, "proxy.config.cluster.periodic_timer_interval_msecs"); + REC_ReadConfigInteger(ClusterLoadMonitor::cf_cluster_load_compute_msec_interval, + "proxy.config.cluster.load_compute_interval_msecs"); + REC_ReadConfigInteger(ClusterLoadMonitor::cf_cluster_periodic_msec_interval, + "proxy.config.cluster.periodic_timer_interval_msecs"); REC_ReadConfigInteger(ClusterLoadMonitor::cf_ping_history_buf_length, "proxy.config.cluster.ping_history_buf_length"); REC_ReadConfigInteger(ClusterLoadMonitor::cf_cluster_load_clear_duration, "proxy.config.cluster.cluster_load_clear_duration"); REC_ReadConfigInteger(ClusterLoadMonitor::cf_cluster_load_exceed_duration, "proxy.config.cluster.cluster_load_exceed_duration"); @@ -747,12 +674,12 @@ ClusterProcessor::start() for (int i = 0; i < eventProcessor.n_threads_for_type[ET_CLUSTER]; i++) { initialize_thread_for_net(eventProcessor.eventthread[ET_CLUSTER][i]); } - REC_RegisterConfigUpdateFunc("proxy.config.cluster.cluster_configuration", machine_config_change, (void *) CLUSTER_CONFIG); - do_machine_config_change((void *) CLUSTER_CONFIG, "proxy.config.cluster.cluster_configuration"); - // TODO: Remove this? + REC_RegisterConfigUpdateFunc("proxy.config.cluster.cluster_configuration", machine_config_change, (void *)CLUSTER_CONFIG); + do_machine_config_change((void *)CLUSTER_CONFIG, "proxy.config.cluster.cluster_configuration"); +// TODO: Remove this? #ifdef USE_SEPARATE_MACHINE_CONFIG - REC_RegisterConfigUpdateFunc("proxy.config.cluster.machine_configuration", machine_config_change, (void *) MACHINE_CONFIG); - do_machine_config_change((void *) MACHINE_CONFIG, "proxy.config.cluster.machine_configuration"); + REC_RegisterConfigUpdateFunc("proxy.config.cluster.machine_configuration", machine_config_change, (void *)MACHINE_CONFIG); + do_machine_config_change((void *)MACHINE_CONFIG, "proxy.config.cluster.machine_configuration"); #endif accept_handler = new ClusterAccept(&cluster_port, cluster_receive_buffer_size, cluster_send_buffer_size); @@ -768,7 +695,7 @@ ClusterProcessor::connect(char *hostname, int16_t id) // Construct a cluster link to the given machine // ClusterHandler *ch = new ClusterHandler; - SET_CONTINUATION_HANDLER(ch, (ClusterContHandler) & ClusterHandler::connectClusterEvent); + SET_CONTINUATION_HANDLER(ch, (ClusterContHandler)&ClusterHandler::connectClusterEvent); ch->hostname = ats_strdup(hostname); ch->connector = true; ch->id = id; @@ -782,7 +709,7 @@ ClusterProcessor::connect(unsigned int ip, int port, int16_t id, bool delay) // Construct a cluster link to the given machine // ClusterHandler *ch = new ClusterHandler; - SET_CONTINUATION_HANDLER(ch, (ClusterContHandler) & ClusterHandler::connectClusterEvent); + SET_CONTINUATION_HANDLER(ch, (ClusterContHandler)&ClusterHandler::connectClusterEvent); ch->ip = ip; ch->port = port; ch->connector = true; @@ -794,7 +721,7 @@ ClusterProcessor::connect(unsigned int ip, int port, int16_t id, bool delay) } void -ClusterProcessor::send_machine_list(ClusterMachine * m) +ClusterProcessor::send_machine_list(ClusterMachine *m) { // // In testing mode, cluster nodes automagically connect to all @@ -816,7 +743,7 @@ ClusterProcessor::send_machine_list(ClusterMachine * m) n++; } msg->n_ip = n; - data = (void *) msg; + data = (void *)msg; len = msg->sizeof_fixedlen_msg() + (n * sizeof(uint32_t)); } else {
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/65477944/iocore/cluster/ClusterRPC.cc ---------------------------------------------------------------------- diff --git a/iocore/cluster/ClusterRPC.cc b/iocore/cluster/ClusterRPC.cc index 043f082..40632c5 100644 --- a/iocore/cluster/ClusterRPC.cc +++ b/iocore/cluster/ClusterRPC.cc @@ -48,18 +48,18 @@ ping_reply_ClusterFunction(ClusterHandler *ch, void *data, int len) // // Pass back the data. // - PingMessage *msg = (PingMessage *) data; + PingMessage *msg = (PingMessage *)data; msg->fn(ch, msg->data, (len - msg->sizeof_fixedlen_msg())); } void -machine_list_ClusterFunction(ClusterHandler * from, void *data, int len) +machine_list_ClusterFunction(ClusterHandler *from, void *data, int len) { - (void) from; - ClusterMessageHeader *mh = (ClusterMessageHeader *) data; - MachineListMessage *m = (MachineListMessage *) data; + (void)from; + ClusterMessageHeader *mh = (ClusterMessageHeader *)data; + MachineListMessage *m = (MachineListMessage *)data; - if (mh->GetMsgVersion() != MachineListMessage::MACHINE_LIST_MESSAGE_VERSION) { //////////////////////////////////////////////// + if (mh->GetMsgVersion() != MachineListMessage::MACHINE_LIST_MESSAGE_VERSION) { //////////////////////////////////////////////// // Convert from old to current message format //////////////////////////////////////////////// ink_release_assert(!"machine_list_ClusterFunction() bad msg version"); @@ -95,10 +95,10 @@ machine_list_ClusterFunction(ClusterHandler * from, void *data, int len) void close_channel_ClusterFunction(ClusterHandler *ch, void *data, int len) { - ClusterMessageHeader *mh = (ClusterMessageHeader *) data; - CloseMessage *m = (CloseMessage *) data; + ClusterMessageHeader *mh = (ClusterMessageHeader *)data; + CloseMessage *m = (CloseMessage *)data; - if (mh->GetMsgVersion() != CloseMessage::CLOSE_CHAN_MESSAGE_VERSION) { //////////////////////////////////////////////// + if (mh->GetMsgVersion() != CloseMessage::CLOSE_CHAN_MESSAGE_VERSION) { //////////////////////////////////////////////// // Convert from old to current message format //////////////////////////////////////////////// ink_release_assert(!"close_channel_ClusterFunction() bad msg version"); @@ -109,7 +109,7 @@ close_channel_ClusterFunction(ClusterHandler *ch, void *data, int len) // // Close the remote side of a VC connection (remote node is originator) // - ink_assert(len >= (int) sizeof(CloseMessage)); + ink_assert(len >= (int)sizeof(CloseMessage)); if (!ch || !ch->channels) return; ClusterVConnection *vc = ch->channels[m->channel]; @@ -131,27 +131,25 @@ test_ClusterFunction(ClusterHandler *ch, void *data, int len) } CacheVC * -ChannelToCacheWriteVC(ClusterHandler * ch, int channel, uint32_t channel_seqno, ClusterVConnection ** cluster_vc) +ChannelToCacheWriteVC(ClusterHandler *ch, int channel, uint32_t channel_seqno, ClusterVConnection **cluster_vc) { EThread *thread = this_ethread(); ProxyMutex *mutex = thread->mutex; ClusterVConnection *cvc = ch->channels[channel]; - if (!VALID_CHANNEL(cvc) - || (channel_seqno != cvc->token.sequence_number) - || (cvc->read.vio.op != VIO::READ)) { + if (!VALID_CHANNEL(cvc) || (channel_seqno != cvc->token.sequence_number) || (cvc->read.vio.op != VIO::READ)) { CLUSTER_INCREMENT_DYN_STAT(cluster_setdata_no_CLUSTERVC_STAT); return NULL; } // Tunneling from cluster to cache (remote write). // Get cache VC pointer. - OneWayTunnel *owt = (OneWayTunnel *) cvc->read.vio._cont; + OneWayTunnel *owt = (OneWayTunnel *)cvc->read.vio._cont; if (!owt) { CLUSTER_INCREMENT_DYN_STAT(CLUSTER_SETDATA_NO_TUNNEL_STAT); return NULL; } - CacheVC *cache_vc = (CacheVC *) owt->vioTarget->vc_server; + CacheVC *cache_vc = (CacheVC *)owt->vioTarget->vc_server; if (!cache_vc) { CLUSTER_INCREMENT_DYN_STAT(CLUSTER_SETDATA_NO_CACHEVC_STAT); return NULL; @@ -176,14 +174,15 @@ set_channel_data_ClusterFunction(ClusterHandler *ch, void *tdata, int tlen) ic->len = tlen; ic->alloc_data(); - data = ic->data + sizeof(int32_t); // free_remote_data expects d+sizeof(int32_t) + data = ic->data + sizeof(int32_t); // free_remote_data expects d+sizeof(int32_t) memcpy(data, tdata, tlen); len = tlen; - ClusterMessageHeader *mh = (ClusterMessageHeader *) data; - SetChanDataMessage *m = (SetChanDataMessage *) data; + ClusterMessageHeader *mh = (ClusterMessageHeader *)data; + SetChanDataMessage *m = (SetChanDataMessage *)data; - if (mh->GetMsgVersion() != SetChanDataMessage::SET_CHANNEL_DATA_MESSAGE_VERSION) { //////////////////////////////////////////////// + if (mh->GetMsgVersion() != + SetChanDataMessage::SET_CHANNEL_DATA_MESSAGE_VERSION) { //////////////////////////////////////////////// // Convert from old to current message format //////////////////////////////////////////////// ink_release_assert(!"set_channel_data_ClusterFunction() bad msg version"); @@ -202,27 +201,25 @@ set_channel_data_ClusterFunction(ClusterHandler *ch, void *tdata, int tlen) } // Unmarshal data. switch (m->data_type) { - case CACHE_DATA_HTTP_INFO: - { - char *p = (char *) m + SetChanDataMessage::sizeof_fixedlen_msg(); - - IOBufferBlock *block_ref = ic->get_block(); - res = HTTPInfo::unmarshal(p, len, block_ref); - ink_assert(res > 0); - - CacheHTTPInfo h; - h.get_handle((char *) &m->data[0], len); - h.set_buffer_reference(block_ref); - cache_vc->set_http_info(&h); - ic->freeall(); - break; - } - default: - { - ink_release_assert(!"set_channel_data_ClusterFunction bad CacheDataType"); - } - } // End of switch - ++cvc->n_recv_set_data_msgs; // note received messages + case CACHE_DATA_HTTP_INFO: { + char *p = (char *)m + SetChanDataMessage::sizeof_fixedlen_msg(); + + IOBufferBlock *block_ref = ic->get_block(); + res = HTTPInfo::unmarshal(p, len, block_ref); + ink_assert(res > 0); + + CacheHTTPInfo h; + h.get_handle((char *)&m->data[0], len); + h.set_buffer_reference(block_ref); + cache_vc->set_http_info(&h); + ic->freeall(); + break; + } + default: { + ink_release_assert(!"set_channel_data_ClusterFunction bad CacheDataType"); + } + } // End of switch + ++cvc->n_recv_set_data_msgs; // note received messages } else { ic->freeall(); @@ -241,7 +238,7 @@ post_setchan_send_ClusterFunction(ClusterHandler *ch, void *data, int /* len ATS // Decrement Cluster VC n_set_data_msgs to allow transmission of // initial open_write data after (n_set_data_msgs == 0). - SetChanDataMessage *m = (SetChanDataMessage *) data; + SetChanDataMessage *m = (SetChanDataMessage *)data; ClusterVConnection *cvc; if (ch) { @@ -260,15 +257,15 @@ void set_channel_pin_ClusterFunction(ClusterHandler *ch, void *data, int /* len ATS_UNUSED */) { // This isn't used. /leif - //EThread *thread = this_ethread(); - //ProxyMutex *mutex = thread->mutex; + // EThread *thread = this_ethread(); + // ProxyMutex *mutex = thread->mutex; // We are called on the ET_CLUSTER thread. - ClusterMessageHeader *mh = (ClusterMessageHeader *) data; - SetChanPinMessage *m = (SetChanPinMessage *) data; + ClusterMessageHeader *mh = (ClusterMessageHeader *)data; + SetChanPinMessage *m = (SetChanPinMessage *)data; - if (mh->GetMsgVersion() != SetChanPinMessage::SET_CHANNEL_PIN_MESSAGE_VERSION) { //////////////////////////////////////////////// + if (mh->GetMsgVersion() != SetChanPinMessage::SET_CHANNEL_PIN_MESSAGE_VERSION) { //////////////////////////////////////////////// // Convert from old to current message format //////////////////////////////////////////////// ink_release_assert(!"set_channel_pin_ClusterFunction() bad msg version"); @@ -277,7 +274,7 @@ set_channel_pin_ClusterFunction(ClusterHandler *ch, void *data, int /* len ATS_U if (m->NeedByteSwap()) m->SwapBytes(); - ClusterVConnection *cvc = NULL; // Just to make GCC happy + ClusterVConnection *cvc = NULL; // Just to make GCC happy CacheVC *cache_vc; if (ch != 0) { @@ -286,7 +283,7 @@ set_channel_pin_ClusterFunction(ClusterHandler *ch, void *data, int /* len ATS_U cache_vc->set_pin_in_cache(m->pin_time); } // cvc is always set in ChannelToCacheWriteVC, so need to check it - ++cvc->n_recv_set_data_msgs; // note received messages + ++cvc->n_recv_set_data_msgs; // note received messages } } @@ -301,7 +298,7 @@ post_setchan_pin_ClusterFunction(ClusterHandler *ch, void *data, int /* len ATS_ // Decrement Cluster VC n_set_data_msgs to allow transmission of // initial open_write data after (n_set_data_msgs == 0). - SetChanPinMessage *m = (SetChanPinMessage *) data; + SetChanPinMessage *m = (SetChanPinMessage *)data; ClusterVConnection *cvc; if (ch) { @@ -320,15 +317,16 @@ void set_channel_priority_ClusterFunction(ClusterHandler *ch, void *data, int /* len ATS_UNUSED */) { // This isn't used. - //EThread *thread = this_ethread(); - //ProxyMutex *mutex = thread->mutex; + // EThread *thread = this_ethread(); + // ProxyMutex *mutex = thread->mutex; // We are called on the ET_CLUSTER thread. - ClusterMessageHeader *mh = (ClusterMessageHeader *) data; - SetChanPriorityMessage *m = (SetChanPriorityMessage *) data; + ClusterMessageHeader *mh = (ClusterMessageHeader *)data; + SetChanPriorityMessage *m = (SetChanPriorityMessage *)data; - if (mh->GetMsgVersion() != SetChanPriorityMessage::SET_CHANNEL_PRIORITY_MESSAGE_VERSION) { //////////////////////////////////////////////// + if (mh->GetMsgVersion() != + SetChanPriorityMessage::SET_CHANNEL_PRIORITY_MESSAGE_VERSION) { //////////////////////////////////////////////// // Convert from old to current message format //////////////////////////////////////////////// ink_release_assert(!"set_channel_priority_ClusterFunction() bad msg version"); @@ -336,7 +334,7 @@ set_channel_priority_ClusterFunction(ClusterHandler *ch, void *data, int /* len if (m->NeedByteSwap()) m->SwapBytes(); - ClusterVConnection *cvc = NULL; // Just to make GCC happy + ClusterVConnection *cvc = NULL; // Just to make GCC happy CacheVC *cache_vc; if (ch != 0) { @@ -345,7 +343,7 @@ set_channel_priority_ClusterFunction(ClusterHandler *ch, void *data, int /* len cache_vc->set_disk_io_priority(m->disk_priority); } // cvc is always set in ChannelToCacheWriteVC, so need to check it - ++cvc->n_recv_set_data_msgs; // note received messages + ++cvc->n_recv_set_data_msgs; // note received messages } } @@ -361,7 +359,7 @@ post_setchan_priority_ClusterFunction(ClusterHandler *ch, void *data, int /* len // Decrement Cluster VC n_set_data_msgs to allow transmission of // initial open_write data after (n_set_data_msgs == 0). - SetChanPriorityMessage *m = (SetChanPriorityMessage *) data; + SetChanPriorityMessage *m = (SetChanPriorityMessage *)data; ClusterVConnection *cvc; if (ch) { http://git-wip-us.apache.org/repos/asf/trafficserver/blob/65477944/iocore/cluster/ClusterVConnection.cc ---------------------------------------------------------------------- diff --git a/iocore/cluster/ClusterVConnection.cc b/iocore/cluster/ClusterVConnection.cc index c2c53ac..7a3185e 100644 --- a/iocore/cluster/ClusterVConnection.cc +++ b/iocore/cluster/ClusterVConnection.cc @@ -32,7 +32,7 @@ ClassAllocator<ClusterVConnection> clusterVCAllocator("clusterVCAllocator"); ClassAllocator<ByteBankDescriptor> byteBankAllocator("byteBankAllocator"); ByteBankDescriptor * -ByteBankDescriptor::ByteBankDescriptor_alloc(IOBufferBlock * iob) +ByteBankDescriptor::ByteBankDescriptor_alloc(IOBufferBlock *iob) { ByteBankDescriptor *b = byteBankAllocator.alloc(); b->block = iob; @@ -40,14 +40,14 @@ ByteBankDescriptor::ByteBankDescriptor_alloc(IOBufferBlock * iob) } void -ByteBankDescriptor::ByteBankDescriptor_free(ByteBankDescriptor * b) +ByteBankDescriptor::ByteBankDescriptor_free(ByteBankDescriptor *b) { b->block = 0; byteBankAllocator.free(b); } void -clusterVCAllocator_free(ClusterVConnection * vc) +clusterVCAllocator_free(ClusterVConnection *vc) { vc->mutex = 0; vc->action_ = 0; @@ -59,22 +59,21 @@ clusterVCAllocator_free(ClusterVConnection * vc) clusterVCAllocator.free(vc); } -ClusterVConnState::ClusterVConnState():enabled(0), priority(1), vio(VIO::NONE), queue(0), ifd(-1), delay_timeout(NULL) +ClusterVConnState::ClusterVConnState() : enabled(0), priority(1), vio(VIO::NONE), queue(0), ifd(-1), delay_timeout(NULL) { } -ClusterVConnectionBase::ClusterVConnectionBase(): -thread(0), closed(0), inactivity_timeout_in(0), active_timeout_in(0), inactivity_timeout(NULL), active_timeout(NULL) +ClusterVConnectionBase::ClusterVConnectionBase() + : thread(0), closed(0), inactivity_timeout_in(0), active_timeout_in(0), inactivity_timeout(NULL), active_timeout(NULL) { } #ifdef DEBUG -int - ClusterVConnectionBase::enable_debug_trace = 0; +int ClusterVConnectionBase::enable_debug_trace = 0; #endif VIO * -ClusterVConnectionBase::do_io_read(Continuation * acont, int64_t anbytes, MIOBuffer * abuffer) +ClusterVConnectionBase::do_io_read(Continuation *acont, int64_t anbytes, MIOBuffer *abuffer) { ink_assert(!closed); read.vio.buffer.writer_for(abuffer); @@ -82,10 +81,10 @@ ClusterVConnectionBase::do_io_read(Continuation * acont, int64_t anbytes, MIOBuf read.vio.set_continuation(acont); read.vio.nbytes = anbytes; read.vio.ndone = 0; - read.vio.vc_server = (VConnection *) this; + read.vio.vc_server = (VConnection *)this; read.enabled = 1; - ClusterVConnection *cvc = (ClusterVConnection *) this; + ClusterVConnection *cvc = (ClusterVConnection *)this; Debug("cluster_vc_xfer", "do_io_read [%s] chan %d", "", cvc->channel); return &read.vio; } @@ -119,7 +118,7 @@ ClusterVConnection::get_single_data(void ** /* ptr ATS_UNUSED */, int * /* len A } VIO * -ClusterVConnectionBase::do_io_write(Continuation * acont, int64_t anbytes, IOBufferReader * abuffer, bool owner) +ClusterVConnectionBase::do_io_write(Continuation *acont, int64_t anbytes, IOBufferReader *abuffer, bool owner) { ink_assert(!closed); ink_assert(!owner); @@ -128,7 +127,7 @@ ClusterVConnectionBase::do_io_write(Continuation * acont, int64_t anbytes, IOBuf write.vio.set_continuation(acont); write.vio.nbytes = anbytes; write.vio.ndone = 0; - write.vio.vc_server = (VConnection *) this; + write.vio.vc_server = (VConnection *)this; write.enabled = 1; return &write.vio; @@ -162,7 +161,7 @@ ClusterVConnection::reenable(VIO *vio) } void -ClusterVConnectionBase::reenable(VIO * vio) +ClusterVConnectionBase::reenable(VIO *vio) { ink_assert(!closed); if (vio == &read.vio) { @@ -183,45 +182,23 @@ ClusterVConnectionBase::reenable(VIO * vio) } void -ClusterVConnectionBase::reenable_re(VIO * vio) +ClusterVConnectionBase::reenable_re(VIO *vio) { reenable(vio); } ClusterVConnection::ClusterVConnection(int is_new_connect_read) - : ch(NULL), - new_connect_read(is_new_connect_read), - remote_free(0), - last_local_free(0), - channel(0), - close_disabled(0), - remote_closed(0), - remote_close_disabled(1), - remote_lerrno(0), - in_vcs(0), - type(0), - start_time(0), - last_activity_time(0), - n_set_data_msgs(0), - n_recv_set_data_msgs(0), - pending_remote_fill(0), - remote_ram_cache_hit(0), - have_all_data(0), - initial_data_bytes(0), - current_cont(0), - iov_map(CLUSTER_IOV_NOT_OPEN), - write_list_tail(0), - write_list_bytes(0), - write_bytes_in_transit(0), - alternate(), - time_pin(0), - disk_io_priority(0) + : ch(NULL), new_connect_read(is_new_connect_read), remote_free(0), last_local_free(0), channel(0), close_disabled(0), + remote_closed(0), remote_close_disabled(1), remote_lerrno(0), in_vcs(0), type(0), start_time(0), last_activity_time(0), + n_set_data_msgs(0), n_recv_set_data_msgs(0), pending_remote_fill(0), remote_ram_cache_hit(0), have_all_data(0), + initial_data_bytes(0), current_cont(0), iov_map(CLUSTER_IOV_NOT_OPEN), write_list_tail(0), write_list_bytes(0), + write_bytes_in_transit(0), alternate(), time_pin(0), disk_io_priority(0) { #ifdef DEBUG read.vio.buffer.name = "ClusterVConnection.read"; write.vio.buffer.name = "ClusterVConnection.write"; #endif - SET_HANDLER((ClusterVConnHandler) & ClusterVConnection::startEvent); + SET_HANDLER((ClusterVConnHandler)&ClusterVConnection::startEvent); } ClusterVConnection::~ClusterVConnection() @@ -249,7 +226,7 @@ ClusterVConnection::free() } VIO * -ClusterVConnection::do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf) +ClusterVConnection::do_io_read(Continuation *c, int64_t nbytes, MIOBuffer *buf) { if (type == VC_CLUSTER) type = VC_CLUSTER_READ; @@ -259,7 +236,7 @@ ClusterVConnection::do_io_read(Continuation * c, int64_t nbytes, MIOBuffer * buf } VIO * -ClusterVConnection::do_io_write(Continuation * c, int64_t nbytes, IOBufferReader * buf, bool owner) +ClusterVConnection::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *buf, bool owner) { if (type == VC_CLUSTER) type = VC_CLUSTER_WRITE; @@ -283,27 +260,27 @@ ClusterVConnection::do_io_close(int alerrno) } int -ClusterVConnection::startEvent(int event, Event * e) +ClusterVConnection::startEvent(int event, Event *e) { // // Safe to call with e == NULL from the same thread. // - (void) event; - start(e ? e->ethread : (EThread *) NULL); + (void)event; + start(e ? e->ethread : (EThread *)NULL); return EVENT_DONE; } int -ClusterVConnection::mainEvent(int event, Event * e) +ClusterVConnection::mainEvent(int event, Event *e) { - (void) event; - (void) e; + (void)event; + (void)e; ink_assert(!"unexpected event"); return EVENT_DONE; } int -ClusterVConnection::start(EThread * t) +ClusterVConnection::start(EThread *t) { // // New channel connect protocol. Establish VC locally and send the @@ -352,7 +329,7 @@ ClusterVConnection::start(EThread * t) } if (!ch) { if (action_.continuation) { - action_.continuation->handleEvent(CLUSTER_EVENT_OPEN_FAILED, (void *) -ECLUSTER_NO_MACHINE); + action_.continuation->handleEvent(CLUSTER_EVENT_OPEN_FAILED, (void *)-ECLUSTER_NO_MACHINE); clusterVCAllocator_free(this); return EVENT_DONE; } else { @@ -365,7 +342,7 @@ ClusterVConnection::start(EThread * t) channel = ch->alloc_channel(this); if (channel < 0) { if (action_.continuation) { - action_.continuation->handleEvent(CLUSTER_EVENT_OPEN_FAILED, (void *) -ECLUSTER_NOMORE_CHANNELS); + action_.continuation->handleEvent(CLUSTER_EVENT_OPEN_FAILED, (void *)-ECLUSTER_NOMORE_CHANNELS); clusterVCAllocator_free(this); return EVENT_DONE; } else { @@ -385,7 +362,7 @@ ClusterVConnection::start(EThread * t) if ((status = ch->alloc_channel(this, channel)) < 0) { Debug(CL_TRACE, "VC start alloc remote failed chan=%d VC=%p", channel, this); clusterVCAllocator_free(this); - return status; // Channel active or no more channels + return status; // Channel active or no more channels } else { Debug(CL_TRACE, "VC start alloc remote chan=%d VC=%p", channel, this); if (new_connect_read) @@ -435,7 +412,8 @@ ClusterVConnection::allow_remote_close() remote_close_disabled = 0; } -bool ClusterVConnection::schedule_write() +bool +ClusterVConnection::schedule_write() { // // Schedule write if we have all data or current write data is @@ -476,27 +454,25 @@ ClusterVConnection::set_type(int options) } // Overide functions in base class VConnection. -bool ClusterVConnection::get_data(int id, void * /* data ATS_UNUSED */) +bool +ClusterVConnection::get_data(int id, void * /* data ATS_UNUSED */) { switch (id) { - case CACHE_DATA_HTTP_INFO: - { - ink_release_assert(!"ClusterVConnection::get_data CACHE_DATA_HTTP_INFO not supported"); - } - case CACHE_DATA_KEY: - { - ink_release_assert(!"ClusterVConnection::get_data CACHE_DATA_KEY not supported"); - } - default: - { - ink_release_assert(!"ClusterVConnection::get_data invalid id"); - } + case CACHE_DATA_HTTP_INFO: { + ink_release_assert(!"ClusterVConnection::get_data CACHE_DATA_HTTP_INFO not supported"); + } + case CACHE_DATA_KEY: { + ink_release_assert(!"ClusterVConnection::get_data CACHE_DATA_KEY not supported"); + } + default: { + ink_release_assert(!"ClusterVConnection::get_data invalid id"); + } } return false; } void -ClusterVConnection::get_http_info(CacheHTTPInfo ** info) +ClusterVConnection::get_http_info(CacheHTTPInfo **info) { *info = &alternate; } @@ -514,7 +490,7 @@ ClusterVConnection::is_pread_capable() } void -ClusterVConnection::set_http_info(CacheHTTPInfo * d) +ClusterVConnection::set_http_info(CacheHTTPInfo *d) { int flen, len; void *data; @@ -529,9 +505,9 @@ ClusterVConnection::set_http_info(CacheHTTPInfo * d) // Cache semantics dictate that set_http_info() be established prior // to transferring any data on the ClusterVConnection. // - ink_release_assert(this->write.vio.op == VIO::NONE); // not true if do_io() + ink_release_assert(this->write.vio.op == VIO::NONE); // not true if do_io() // already done - ink_release_assert(this->read.vio.op == VIO::NONE); // should always be true + ink_release_assert(this->read.vio.op == VIO::NONE); // should always be true int vers = SetChanDataMessage::protoToVersion(ch->machine->msg_proto_major); if (vers == SetChanDataMessage::SET_CHANNEL_DATA_MESSAGE_VERSION) { @@ -547,12 +523,12 @@ ClusterVConnection::set_http_info(CacheHTTPInfo * d) CacheHTTPInfo *r = d; len = r->marshal_length(); - data = (void *) ALLOCA_DOUBLE(flen + len); - memcpy((char *) data, (char *) &msg, sizeof(msg)); - m = (SetChanDataMessage *) data; + data = (void *)ALLOCA_DOUBLE(flen + len); + memcpy((char *)data, (char *)&msg, sizeof(msg)); + m = (SetChanDataMessage *)data; m->data_type = CACHE_DATA_HTTP_INFO; - char *p = (char *) m + flen; + char *p = (char *)m + flen; res = r->marshal(p, len); if (res < 0) { r->destroy(); @@ -569,7 +545,8 @@ ClusterVConnection::set_http_info(CacheHTTPInfo * d) clusterProcessor.invoke_remote(ch, SET_CHANNEL_DATA_CLUSTER_FUNCTION, data, flen + len); } -bool ClusterVConnection::set_pin_in_cache(time_t t) +bool +ClusterVConnection::set_pin_in_cache(time_t t) { SetChanPinMessage msg; @@ -578,9 +555,9 @@ bool ClusterVConnection::set_pin_in_cache(time_t t) // open_write() ClusterVConnection. It is only allowed after a // successful open_write() and prior to issuing the do_io(VIO::WRITE). // - ink_release_assert(this->write.vio.op == VIO::NONE); // not true if do_io() + ink_release_assert(this->write.vio.op == VIO::NONE); // not true if do_io() // already done - ink_release_assert(this->read.vio.op == VIO::NONE); // should always be true + ink_release_assert(this->read.vio.op == VIO::NONE); // should always be true time_pin = t; int vers = SetChanPinMessage::protoToVersion(ch->machine->msg_proto_major); @@ -591,7 +568,8 @@ bool ClusterVConnection::set_pin_in_cache(time_t t) ////////////////////////////////////////////////////////////// // Create the specified down rev version of this message ////////////////////////////////////////////////////////////// - ink_release_assert(!"ClusterVConnection::set_pin_in_cache() bad msg " "version"); + ink_release_assert(!"ClusterVConnection::set_pin_in_cache() bad msg " + "version"); } msg.channel = channel; msg.sequence_number = token.sequence_number; @@ -600,16 +578,18 @@ bool ClusterVConnection::set_pin_in_cache(time_t t) // note pending set_data() msgs on VC. ink_atomic_increment(&n_set_data_msgs, 1); - clusterProcessor.invoke_remote(ch, SET_CHANNEL_PIN_CLUSTER_FUNCTION, (char *) &msg, sizeof(msg)); + clusterProcessor.invoke_remote(ch, SET_CHANNEL_PIN_CLUSTER_FUNCTION, (char *)&msg, sizeof(msg)); return true; } -time_t ClusterVConnection::get_pin_in_cache() +time_t +ClusterVConnection::get_pin_in_cache() { return time_pin; } -bool ClusterVConnection::set_disk_io_priority(int priority) +bool +ClusterVConnection::set_disk_io_priority(int priority) { SetChanPriorityMessage msg; @@ -618,9 +598,9 @@ bool ClusterVConnection::set_disk_io_priority(int priority) // open_write() ClusterVConnection. It is only allowed after a // successful open_write() and prior to issuing the do_io(VIO::WRITE). // - ink_release_assert(this->write.vio.op == VIO::NONE); // not true if do_io() + ink_release_assert(this->write.vio.op == VIO::NONE); // not true if do_io() // already done - ink_release_assert(this->read.vio.op == VIO::NONE); // should always be true + ink_release_assert(this->read.vio.op == VIO::NONE); // should always be true disk_io_priority = priority; int vers = SetChanPriorityMessage::protoToVersion(ch->machine->msg_proto_major); @@ -631,7 +611,8 @@ bool ClusterVConnection::set_disk_io_priority(int priority) ////////////////////////////////////////////////////////////// // Create the specified down rev version of this message ////////////////////////////////////////////////////////////// - ink_release_assert(!"ClusterVConnection::set_disk_io_priority() bad msg " "version"); + ink_release_assert(!"ClusterVConnection::set_disk_io_priority() bad msg " + "version"); } msg.channel = channel; msg.sequence_number = token.sequence_number; @@ -640,7 +621,7 @@ bool ClusterVConnection::set_disk_io_priority(int priority) // note pending set_data() msgs on VC. ink_atomic_increment(&n_set_data_msgs, 1); - clusterProcessor.invoke_remote(ch, SET_CHANNEL_PRIORITY_CLUSTER_FUNCTION, (char *) &msg, sizeof(msg)); + clusterProcessor.invoke_remote(ch, SET_CHANNEL_PRIORITY_CLUSTER_FUNCTION, (char *)&msg, sizeof(msg)); return true; } http://git-wip-us.apache.org/repos/asf/trafficserver/blob/65477944/iocore/cluster/P_Cluster.h ---------------------------------------------------------------------- diff --git a/iocore/cluster/P_Cluster.h b/iocore/cluster/P_Cluster.h index aa3d6a5..0376f63 100644 --- a/iocore/cluster/P_Cluster.h +++ b/iocore/cluster/P_Cluster.h @@ -47,17 +47,16 @@ #include "P_TimeTrace.h" -#define ECLUSTER_NO_VC (CLUSTER_ERRNO+0) -#define ECLUSTER_NO_MACHINE (CLUSTER_ERRNO+1) -#define ECLUSTER_OP_TIMEOUT (CLUSTER_ERRNO+2) -#define ECLUSTER_ORB_DATA_READ (CLUSTER_ERRNO+3) -#define ECLUSTER_ORB_EIO (CLUSTER_ERRNO+4) -#define ECLUSTER_CHANNEL_INUSE (CLUSTER_ERRNO+5) -#define ECLUSTER_NOMORE_CHANNELS (CLUSTER_ERRNO+6) +#define ECLUSTER_NO_VC (CLUSTER_ERRNO + 0) +#define ECLUSTER_NO_MACHINE (CLUSTER_ERRNO + 1) +#define ECLUSTER_OP_TIMEOUT (CLUSTER_ERRNO + 2) +#define ECLUSTER_ORB_DATA_READ (CLUSTER_ERRNO + 3) +#define ECLUSTER_ORB_EIO (CLUSTER_ERRNO + 4) +#define ECLUSTER_CHANNEL_INUSE (CLUSTER_ERRNO + 5) +#define ECLUSTER_NOMORE_CHANNELS (CLUSTER_ERRNO + 6) int init_clusterprocessor(void); -enum -{ +enum { CLUSTER_CONNECTIONS_OPEN_STAT, CLUSTER_CONNECTIONS_OPENNED_STAT, CLUSTER_CON_TOTAL_TIME_STAT, @@ -124,19 +123,15 @@ enum }; extern RecRawStatBlock *cluster_rsb; -#define CLUSTER_INCREMENT_DYN_STAT(x) \ - RecIncrRawStat(cluster_rsb, mutex->thread_holding, (int) x, 1); -#define CLUSTER_DECREMENT_DYN_STAT(x) \ - RecIncrRawStat(cluster_rsb, mutex->thread_holding, (int) x, -1); -#define CLUSTER_SUM_DYN_STAT(x, y) \ - RecIncrRawStat(cluster_rsb, mutex->thread_holding, (int) x, y); -#define CLUSTER_SUM_GLOBAL_DYN_STAT(x, y) \ - RecIncrGlobalRawStatSum(cluster_rsb,x,y) -#define CLUSTER_CLEAR_DYN_STAT(x) \ -do { \ - RecSetRawStatSum(cluster_rsb, x, 0); \ - RecSetRawStatCount(cluster_rsb, x, 0); \ -} while (0); +#define CLUSTER_INCREMENT_DYN_STAT(x) RecIncrRawStat(cluster_rsb, mutex->thread_holding, (int)x, 1); +#define CLUSTER_DECREMENT_DYN_STAT(x) RecIncrRawStat(cluster_rsb, mutex->thread_holding, (int)x, -1); +#define CLUSTER_SUM_DYN_STAT(x, y) RecIncrRawStat(cluster_rsb, mutex->thread_holding, (int)x, y); +#define CLUSTER_SUM_GLOBAL_DYN_STAT(x, y) RecIncrGlobalRawStatSum(cluster_rsb, x, y) +#define CLUSTER_CLEAR_DYN_STAT(x) \ + do { \ + RecSetRawStatSum(cluster_rsb, x, 0); \ + RecSetRawStatCount(cluster_rsb, x, 0); \ + } while (0); #endif
