A brief file description. More...
#include "P_Cluster.h"
#include "InkAPIInternal.h"
Go to the source code of this file.
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 ClusterAPI.cc.
#define CLUSTER_STATUS_HANDLE_TO_INDEX | ( | h | ) | ((int) ((h))) |
Definition at line 57 of file ClusterAPI.cc.
Referenced by MachineStatusSM::MachineStatusSMEvent(), TSDeleteClusterStatusFunction(), and TSEnableClusterStatusCallout().
#define INDEX_TO_CLUSTER_STATUS_HANDLE | ( | i | ) | ((TSClusterStatusHandle_t)((i))) |
Definition at line 56 of file ClusterAPI.cc.
Referenced by TSAddClusterStatusFunction().
#define IP_TO_NODE_HANDLE | ( | ip | ) | ((TSNodeHandle_t)((ip))) |
Definition at line 60 of file ClusterAPI.cc.
Referenced by default_api_ClusterFunction(), machine_offline_APIcallout(), machine_online_APIcallout(), MachineStatusSM::MachineStatusSMEvent(), and TSGetMyNodeHandle().
#define MAX_CLUSTERSTATUS_CALLOUTS 32 |
Definition at line 48 of file ClusterAPI.cc.
Referenced by TSDeleteClusterStatusFunction(), and TSEnableClusterStatusCallout().
#define NE_STATE_FREE 0 |
Definition at line 45 of file ClusterAPI.cc.
#define NE_STATE_INITIALIZED 1 |
Definition at line 46 of file ClusterAPI.cc.
Referenced by MachineStatusSM::MachineStatusSMEvent(), and TSEnableClusterStatusCallout().
#define NODE_HANDLE_TO_IP | ( | h | ) | (*((struct in_addr *) &((h)))) |
Definition at line 58 of file ClusterAPI.cc.
Referenced by TSNodeHandleToIPAddr(), and TSSendClusterRPC().
#define RPC_FUNCTION_KEY_TO_CLUSTER_NUMBER | ( | k | ) | ((int)((k))) |
Definition at line 59 of file ClusterAPI.cc.
Referenced by TSAddClusterRPCFunction().
#define RPC_HANDLE_MAGIC 0x12345678 |
Definition at line 78 of file ClusterAPI.cc.
Referenced by TSFreeRPCMsg(), and TSSendClusterRPC().
#define SIZEOF_RPC_MSG_LESS_DATA |
(sizeof(TSClusterRPCMsg_t) - \ (sizeof(TSClusterRPCMsg_t) - sizeof(TSClusterRPCHandle_t)))
Definition at line 61 of file ClusterAPI.cc.
Referenced by TSAllocClusterRPCMsg(), and TSFreeRPCMsg().
typedef int(ClusterAPIPeriodicSM::* ClusterAPIPeriodicSMHandler)(int, void *) |
Definition at line 204 of file ClusterAPI.cc.
typedef int(MachineStatusSM::* MachineStatusSMHandler)(int, void *) |
Definition at line 81 of file ClusterAPI.cc.
typedef struct node_callout_entry node_callout_entry_t |
typedef struct RPCHandle RPCHandle_t |
void clusterAPI_init | ( | ) |
Definition at line 277 of file ClusterAPI.cc.
References ET_CALL, eventProcessor, HRTIME_SECONDS, ink_atomiclist_init(), ink_release_assert, MUTEX_TRY_LOCK, new_ProxyMutex(), EventProcessor::schedule_every(), and this_ethread().
Referenced by ClusterProcessor::init().
void default_api_ClusterFunction | ( | ClusterHandler * | ch, | |
void * | data, | |||
int | len | |||
) |
Definition at line 482 of file ClusterAPI.cc.
References API_END_CLUSTER_FUNCTION, API_STARECT_CLUSTER_FUNCTION, clusterProcessor, Debug, default_api_ClusterFunction, DOT_SEPARATED, ClusterProcessor::free_remote_data(), ink_release_assert, RPCHandle::internal, ClusterMachine::ip, IP_TO_NODE_HANDLE, TSClusterRPCMsg::m_handle, ClusterHandler::machine, RPC_Functions, and RPCHandle::u.
void machine_offline_APIcallout | ( | int | Ipaddr | ) |
Definition at line 419 of file ClusterAPI.cc.
References ink_atomiclist_push(), IP_TO_NODE_HANDLE, and NODE_OFFLINE.
Referenced by ClusterHandler::machine_down().
void machine_online_APIcallout | ( | int | Ipaddr | ) |
Definition at line 408 of file ClusterAPI.cc.
References ink_atomiclist_push(), IP_TO_NODE_HANDLE, and NODE_ONLINE.
Referenced by ClusterHandler::startClusterEvent().
static void send_machine_online_list | ( | TSClusterStatusHandle_t * | h | ) | [static] |
Definition at line 383 of file ClusterAPI.cc.
References ink_atomiclist_push().
Referenced by TSEnableClusterStatusCallout().
int TSAddClusterRPCFunction | ( | TSClusterRPCKey_t | k, | |
TSClusterRPCFunction | func, | |||
TSClusterRPCHandle_t * | h | |||
) |
Definition at line 433 of file ClusterAPI.cc.
References API_END_CLUSTER_FUNCTION, API_STARECT_CLUSTER_FUNCTION, Debug, RPCHandle::external, ink_release_assert, RPCHandle::internal, MUTEX_TAKE_LOCK, MUTEX_UNTAKE_LOCK, RPC_FUNCTION_KEY_TO_CLUSTER_NUMBER, RPC_Functions, this_ethread(), and RPCHandle::u.
int TSAddClusterStatusFunction | ( | TSClusterStatusFunction | Status_Function, | |
TSMutex | m, | |||
TSClusterStatusHandle_t * | h | |||
) |
Definition at line 299 of file ClusterAPI.cc.
References Debug, node_callout_entry::func, func, INDEX_TO_CLUSTER_STATUS_HANDLE, ink_release_assert, node_callout_entry::mutex, MUTEX_TAKE_LOCK, MUTEX_UNTAKE_LOCK, and this_ethread().
TSClusterRPCMsg_t* TSAllocClusterRPCMsg | ( | TSClusterRPCHandle_t * | h, | |
int | data_size | |||
) |
Definition at line 520 of file ClusterAPI.cc.
References OutgoingControl::alloc(), OutgoingControl::alloc_data(), ClusterControl::data, ink_assert, ClusterControl::len, TSClusterRPCMsg::m_handle, and SIZEOF_RPC_MSG_LESS_DATA.
int TSDeleteClusterRPCFunction | ( | TSClusterRPCHandle_t * | rpch | ) |
Definition at line 463 of file ClusterAPI.cc.
References API_END_CLUSTER_FUNCTION, API_STARECT_CLUSTER_FUNCTION, Debug, ink_release_assert, RPCHandle::internal, MUTEX_TAKE_LOCK, MUTEX_UNTAKE_LOCK, RPC_Functions, this_ethread(), and RPCHandle::u.
int TSDeleteClusterStatusFunction | ( | TSClusterStatusHandle_t * | h | ) |
Definition at line 330 of file ClusterAPI.cc.
References CLUSTER_STATUS_HANDLE_TO_INDEX, Debug, node_callout_entry::func, ink_release_assert, MAX_CLUSTERSTATUS_CALLOUTS, node_callout_entry::mutex, MUTEX_TAKE_LOCK, MUTEX_UNTAKE_LOCK, node_callout_entry::state, and this_ethread().
void TSEnableClusterStatusCallout | ( | TSClusterStatusHandle_t * | h | ) |
Definition at line 367 of file ClusterAPI.cc.
References CLUSTER_STATUS_HANDLE_TO_INDEX, Debug, ink_release_assert, MAX_CLUSTERSTATUS_CALLOUTS, NE_STATE_INITIALIZED, and send_machine_online_list().
void TSFreeRPCMsg | ( | TSClusterRPCMsg_t * | msg, | |
int | msg_data_len | |||
) |
Definition at line 507 of file ClusterAPI.cc.
References clusterProcessor, Debug, ClusterProcessor::free_remote_data(), ink_release_assert, RPCHandle::internal, TSClusterRPCMsg::m_handle, RPC_HANDLE_MAGIC, SIZEOF_RPC_MSG_LESS_DATA, and RPCHandle::u.
void TSGetMyNodeHandle | ( | TSNodeHandle_t * | h | ) |
Definition at line 355 of file ClusterAPI.cc.
References IP_TO_NODE_HANDLE, and this_cluster_machine().
int TSNodeHandleToIPAddr | ( | TSNodeHandle_t * | h, | |
struct in_addr * | in | |||
) |
Definition at line 348 of file ClusterAPI.cc.
References NODE_HANDLE_TO_IP.
int TSSendClusterRPC | ( | TSNodeHandle_t * | nh, | |
TSClusterRPCMsg_t * | msg | |||
) |
Definition at line 551 of file ClusterAPI.cc.
References CLUSTER_OPT_STEAL, clusterProcessor, Cluster::current_configuration(), Debug, DOT_SEPARATED, ClusterConfiguration::find(), ink_release_assert, RPCHandle::internal, ClusterProcessor::invoke_remote(), TSClusterRPCMsg::m_handle, NODE_HANDLE_TO_IP, ClusterMachine::pop_ClusterHandler(), RPC_HANDLE_MAGIC, this_cluster(), and RPCHandle::u.
ProxyMutex* ClusterAPI_mutex [static] |
Definition at line 50 of file ClusterAPI.cc.
ClusterAPIPeriodicSM* periodicSM [static] |
Definition at line 51 of file ClusterAPI.cc.
TSClusterRPCFunction RPC_Functions[API_END_CLUSTER_FUNCTION] [static] |
Definition at line 54 of file ClusterAPI.cc.
Referenced by default_api_ClusterFunction(), TSAddClusterRPCFunction(), and TSDeleteClusterRPCFunction().
InkAtomicList status_callout_atomic_q [static] |
Definition at line 223 of file ClusterAPI.cc.
Queue<MachineStatusSM> status_callout_q [static] |
Definition at line 224 of file ClusterAPI.cc.
node_callout_entry_t status_callouts[MAX_CLUSTERSTATUS_CALLOUTS] [static] |
Definition at line 53 of file ClusterAPI.cc.