Private record core declarations. More...
#include "ink_thread.h"
#include "ink_hash_table.h"
#include "ink_llqueue.h"
#include "ink_rwlock.h"
#include "TextBuffer.h"
#include "I_RecCore.h"
#include "P_RecDefs.h"
#include "P_RecTree.h"
Go to the source code of this file.
Private record core declarations.
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 P_RecCore.h.
bool i_am_the_record_owner | ( | RecT | rec_type | ) |
Definition at line 42 of file RecLocal.cc.
References g_mode_type, ink_assert, RECM_CLIENT, RECM_STAND_ALONE, RECT_CLUSTER, RECT_CONFIG, RECT_LOCAL, RECT_NODE, RECT_PLUGIN, and RECT_PROCESS.
Referenced by _RecRegisterRawStat(), RecResetStatRecord(), RecSetRecord(), RecSetSyncRequired(), send_pull_message(), and send_push_message().
Definition at line 154 of file RecCore.cc.
References ats_free(), ats_malloc(), DL_Warning, g_initialized, g_num_records, g_rec_config_fpath, g_rec_config_lock, g_records_ht, Layout::get(), ink_hash_table_create(), ink_mutex_init(), ink_rwlock_init(), InkHashTableKeyType_String, REC_CONFIG_FILE, REC_ERR_FAIL, REC_MAX_RECORDS, REC_SHADOW_EXT, RecConfigFileInit(), RecFileExists(), RecLog(), RECM_SERVER, RECM_STAND_ALONE, RecReadConfigFile(), RecReadStatsFile(), RecSetDiags(), and Layout::relative_to().
Referenced by RecLocalInit(), and RecProcessInit().
void RecDumpRecords | ( | RecT | rec_type, | |
RecDumpEntryCb | callback, | |||
void * | edata | |||
) |
Definition at line 902 of file RecCore.cc.
References RecRecord::data, RecRecord::data_type, g_num_records, RecRecord::lock, RecRecord::name, rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, RECT_NULL, and RecRecord::registered.
Referenced by RecDumpRecordsHt(), and TSRecordDump().
void RecDumpRecordsHt | ( | RecT | rec_type = RECT_NULL |
) |
Definition at line 918 of file RecCore.cc.
References debug_record_callback(), DL_Note, RecDebug(), and RecDumpRecords().
int RecExecConfigUpdateCbs | ( | unsigned int | update_required_type | ) |
Definition at line 802 of file P_RecCore.cc.
References RecRecord::config_meta, RecRecord::data, RecRecord::data_type, g_num_records, g_records, RecRecord::lock, RecRecord::name, RecConfigCbList_t::next, rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, REC_TYPE_IS_CONFIG, RecConfigCbList_t::update_cb, RecConfigMeta::update_cb_list, RecConfigCbList_t::update_cookie, and RecConfigMeta::update_required.
Referenced by config_update_thr(), and config_update_cont::exec_callbacks().
int RecExecRawStatUpdateFuncs | ( | ) |
int RecExecStatUpdateFuncs | ( | ) |
Definition at line 824 of file RecCore.cc.
References RecConfigMeta::access_type, ats_free(), ats_strdup, RecConfigMeta::check_expr, RecConfigMeta::check_type, RecRecord::config_meta, RecRecord::data, RecRecord::data_default, RecStatMeta::data_raw, RecRecord::data_type, g_records_ht, ink_hash_table_insert(), ink_hash_table_lookup(), ink_rwlock_unlock(), ink_rwlock_wrlock(), RecRecord::name, RecStatMeta::persist_type, rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, REC_TYPE_IS_CONFIG, REC_TYPE_IS_STAT, RecAlloc(), RecDataSet(), RecRecord::registered, RecRecord::rsb_id, RecRecord::stat_meta, RecConfigMeta::update_required, and RecConfigMeta::update_type.
Referenced by recv_message_cb().
int RecGetRecord_Xmalloc | ( | const char * | name, | |
RecDataT | data_type, | |||
RecData * | data, | |||
bool | lock = true | |||
) |
Definition at line 788 of file RecCore.cc.
References g_records_ht, ink_hash_table_lookup(), ink_rwlock_rdlock(), ink_rwlock_unlock(), rec_mutex_acquire(), rec_mutex_release(), and RecDataSet().
Referenced by RecGetRecordBool(), RecGetRecordByte(), RecGetRecordCounter(), RecGetRecordFloat(), RecGetRecordInt(), and RecGetRecordString_Xmalloc().
int RecReadConfigFile | ( | bool | inc_version | ) |
Definition at line 643 of file P_RecCore.cc.
References DL_Note, g_rec_config_fpath, g_records_rwlock, ink_rwlock_unlock(), ink_rwlock_wrlock(), RecConfigFileParse(), RecConsumeConfigEntry(), and RecDebug().
Referenced by RecCoreInit().
int RecReadStatsFile | ( | ) |
Definition at line 531 of file P_RecCore.cc.
References ats_free(), RecRecord::data, RecStatMeta::data_raw, RecRecord::data_type, DL_Debug, DL_Warning, g_records_rwlock, ink_rwlock_unlock(), ink_rwlock_wrlock(), RecRecord::name, REC_ERR_FAIL, REC_ERR_OKAY, RecRecord::rec_type, REC_TYPE_IS_STAT, RecConfigReadPersistentStatsPath(), RecDebug(), RecGetRecordPersistenceType(), RecLog(), RecMessageReadFromDisk(), RecMessageUnmarshalFirst(), RecMessageUnmarshalNext(), RECP_NON_PERSISTENT, RecSetRecord(), and RecRecord::stat_meta.
Referenced by RecCoreInit().
RecRecord* RecRegisterConfig | ( | RecT | rec_type, | |
const char * | name, | |||
RecDataT | data_type, | |||
RecData | data_default, | |||
RecUpdateT | update_type, | |||
RecCheckT | check_type, | |||
const char * | check_regex, | |||
RecAccessT | access_type = RECA_NULL | |||
) |
Definition at line 761 of file RecCore.cc.
References RecConfigMeta::access_type, ats_free(), ats_strdup, RecConfigMeta::check_expr, RecConfigMeta::check_type, RecRecord::config_meta, ink_rwlock_unlock(), ink_rwlock_wrlock(), RECP_NULL, register_record(), RecConfigMeta::update_cb_list, and RecConfigMeta::update_type.
Referenced by recv_message_cb().
RecRecord* RecRegisterStat | ( | RecT | rec_type, | |
const char * | name, | |||
RecDataT | data_type, | |||
RecData | data_default, | |||
RecPersistT | persist_type | |||
) |
Definition at line 730 of file RecCore.cc.
References RecRecord::data, RecRecord::data_type, DL_Debug, DL_Warning, ink_assert, ink_rwlock_unlock(), ink_rwlock_wrlock(), RecRecord::name, RecStatMeta::persist_type, RecDataSet(), RecDebug(), RECP_NON_PERSISTENT, RECP_NULL, RECP_PERSISTENT, register_record(), and RecRecord::stat_meta.
Referenced by _RecRegisterRawStat(), and recv_message_cb().
int RecSetRecord | ( | RecT | rec_type, | |
const char * | name, | |||
RecDataT | data_type, | |||
RecData * | data, | |||
RecRawStat * | raw_stat, | |||
bool | lock = true , |
|||
bool | inc_version = true | |||
) |
Definition at line 382 of file P_RecCore.cc.
References RecRecord::data, RecStatMeta::data_raw, RecRecord::data_type, g_records_ht, g_records_rwlock, i_am_the_record_owner(), ink_assert, ink_atoi64(), ink_hash_table_insert(), ink_hash_table_lookup(), ink_rwlock_unlock(), ink_rwlock_wrlock(), RecRecord::name, rec_mutex_acquire(), rec_mutex_release(), RecData::rec_string, RecRecord::rec_type, REC_TYPE_IS_CONFIG, REC_TYPE_IS_STAT, RecAlloc(), RECD_COUNTER, RECD_FLOAT, RECD_INT, RECD_NULL, RECD_STRING, RecDataSet(), RecRecordFree(), RecRecordInit(), RECT_NULL, send_set_message(), and RecRecord::stat_meta.
Referenced by RecConsumeConfigEntry(), RecReadStatsFile(), RecSetRecordConvert(), RecSetRecordCounter(), RecSetRecordFloat(), RecSetRecordInt(), RecSetRecordString(), and recv_message_cb().
int RecSyncConfigToTB | ( | textBuffer * | tb, | |
bool * | inc_version = NULL | |||
) |
Definition at line 664 of file P_RecCore.cc.
References ats_malloc(), ats_strdup, textBuffer::copyFrom(), llqrec_s::data, enqueue(), RecConfigFileEntry::entry, RecConfigFileEntry::entry_type, g_mode_type, g_num_records, g_rec_config_contents_ht, g_rec_config_contents_llq, g_rec_config_lock, g_records, g_records_ht, g_records_rwlock, llq_s::head, ink_assert, ink_hash_table_insert(), ink_hash_table_isbound(), ink_hash_table_lookup(), ink_mutex_acquire(), ink_mutex_release(), ink_rwlock_rdlock(), ink_rwlock_unlock(), RecRecord::lock, RecRecord::name, llqrec_s::next, REC_DISK_SYNC_REQUIRED, REC_INC_CONFIG_VERSION, rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, REC_TYPE_IS_CONFIG, RECD_COUNTER, RECD_FLOAT, RECD_INT, RECD_STRING, RECE_COMMENT, RECM_NULL, RECM_SERVER, RECM_STAND_ALONE, RECT_CLUSTER, RECT_CONFIG, RECT_LOCAL, RECT_NODE, RECT_PROCESS, textBuffer::reUse(), and RecRecord::sync_required.
Referenced by sync_cont::sync(), and sync_thr().
int RecSyncStatsFile | ( | ) |
Definition at line 588 of file P_RecCore.cc.
References DL_Note, g_mode_type, g_num_records, g_records, ink_assert, RecRecord::lock, RecMessageHdr::o_start, RecMessageHdr::o_write, RecStatMeta::persist_type, rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, REC_TYPE_IS_STAT, RecConfigReadPersistentStatsPath(), RecDebug(), RECG_NULL, RECM_NULL, RECM_SERVER, RECM_STAND_ALONE, RecMessageAlloc(), RecMessageFree(), RecMessageMarshal_Realloc(), RecMessageWriteToDisk(), RECP_PERSISTENT, and RecRecord::stat_meta.
Referenced by sync_cont::sync(), and sync_thr().
int recv_message_cb | ( | RecMessage * | msg, | |
RecMessageT | msg_type, | |||
void * | cookie | |||
) |
Definition at line 187 of file P_RecCore.cc.
References RecConfigMeta::access_type, RecConfigMeta::check_expr, RecConfigMeta::check_type, RecRecord::config_meta, RecRecord::data, RecRecord::data_default, RecStatMeta::data_raw, RecRecord::data_type, DL_Note, ink_assert, RecRecord::name, RecMessageHdr::o_end, RecMessageHdr::o_start, RecStatMeta::persist_type, REC_ERR_FAIL, RecRecord::rec_type, REC_TYPE_IS_CONFIG, REC_TYPE_IS_STAT, RecDebug(), RecForceInsert(), RECG_PULL_ACK, RECG_PULL_REQ, RECG_PUSH, RECG_REGISTER, RECG_RESET, RECG_SET, RecMessageUnmarshalFirst(), RecMessageUnmarshalNext(), RecRegisterConfig(), RecRegisterStat(), RecResetStatRecord(), RecSetRecord(), send_pull_message(), RecRecord::stat_meta, and RecConfigMeta::update_type.
Referenced by RecLocalInitMessage(), and recv_message_cb__process().
int RecWriteConfigFile | ( | textBuffer * | tb | ) |
Definition at line 965 of file P_RecCore.cc.
References ats_free(), ats_malloc(), textBuffer::bufPtr(), DL_Note, DL_Warning, g_rec_config_fpath, REC_ERR_OKAY, REC_HANDLE_INVALID, RecDebug(), RecFileClose(), RecFileOpenW(), RecFileSync(), RecFileWrite(), RecLog(), textBuffer::spaceUsed(), and TMP_FILENAME_EXT_STR.
Referenced by sync_cont::sync(), and sync_thr().
int send_pull_message | ( | RecMessageT | msg_type | ) |
Definition at line 136 of file P_RecCore.cc.
References DL_Note, g_num_records, g_records, i_am_the_record_owner(), RecRecord::lock, RecMessageHdr::o_start, RecMessageHdr::o_write, RecStatMeta::persist_type, rec_mutex_acquire(), rec_mutex_release(), RecRecord::rec_type, REC_TYPE_IS_STAT, RecDebug(), RECG_PULL_ACK, RECG_PULL_REQ, RecMessageAlloc(), RecMessageFree(), RecMessageMarshal_Realloc(), RecMessageSend(), RecRecord::registered, RecRecord::stat_meta, and RecRecord::sync_required.
Referenced by RecProcessInitMessage(), and recv_message_cb().
int send_push_message | ( | ) |
Definition at line 101 of file P_RecCore.cc.
References DL_Note, g_num_records, g_records, i_am_the_record_owner(), RecRecord::lock, RecMessageHdr::o_start, RecMessageHdr::o_write, rec_mutex_acquire(), rec_mutex_release(), REC_PEER_SYNC_REQUIRED, RecRecord::rec_type, RecDebug(), RECG_PUSH, RecMessageAlloc(), RecMessageFree(), RecMessageMarshal_Realloc(), RecMessageSend(), and RecRecord::sync_required.
Referenced by sync_cont::sync(), and sync_thr().
int send_register_message | ( | RecRecord * | record | ) |
Definition at line 81 of file P_RecCore.cc.
References DL_Note, RecRecord::lock, RecMessageHdr::o_start, RecMessageHdr::o_write, rec_mutex_acquire(), rec_mutex_release(), RecDebug(), RECG_REGISTER, RecMessageAlloc(), RecMessageFree(), RecMessageMarshal_Realloc(), and RecMessageSend().
Referenced by _RecRegisterRawStat().
Definition at line 34 of file P_RecCore.cc.
Referenced by i_am_the_record_owner(), RecLocalInit(), RecMessageInit(), RecMessageSend(), RecProcessInit(), RecSyncConfigToTB(), and RecSyncStatsFile().
int g_num_records |
Definition at line 37 of file RecCore.cc.
Referenced by RecAlloc(), RecCoreInit(), RecDumpRecords(), RecExecConfigUpdateCbs(), RecExecRawStatSyncCbs(), RecGetRecordPrefix_Xmalloc(), RecResetStatRecord(), RecSyncConfigToTB(), RecSyncStatsFile(), send_pull_message(), and send_push_message().
Definition at line 37 of file RecConfigParse.cc.
Referenced by RecConfigFileInit(), RecConfigFileParse(), and RecSyncConfigToTB().
Definition at line 36 of file RecConfigParse.cc.
Referenced by RecSyncConfigToTB().
const char* g_rec_config_fpath |
Definition at line 35 of file RecConfigParse.cc.
Referenced by RecCoreInit(), RecReadConfigFile(), and RecWriteConfigFile().
Definition at line 38 of file RecConfigParse.cc.
Referenced by RecConfigFileInit(), RecConfigFileParse(), RecCoreInit(), and RecSyncConfigToTB().
Definition at line 34 of file RecCore.cc.
Referenced by RecAlloc(), RecExecConfigUpdateCbs(), RecExecRawStatSyncCbs(), RecResetStatRecord(), RecSyncConfigToTB(), RecSyncStatsFile(), send_pull_message(), and send_push_message().
Definition at line 35 of file RecCore.cc.
Referenced by RecCoreInit(), RecForceInsert(), RecGetRecord_Xmalloc(), RecGetRecordAccessType(), RecGetRecordCheckExpr(), RecGetRecordCheckType(), RecGetRecordDataType(), RecGetRecordDefaultDataString_Xmalloc(), RecGetRecordOrderAndId(), RecGetRecordPersistenceType(), RecGetRecordString(), RecGetRecordType(), RecGetRecordUpdateType(), RecRegisterConfigUpdateCb(), RecRegisterRawStatSyncCb(), RecResetStatRecord(), RecSetRecord(), RecSetRecordAccessType(), RecSetSyncRequired(), RecSyncConfigToTB(), and register_record().
Definition at line 36 of file RecCore.cc.
Referenced by RecReadConfigFile(), RecReadStatsFile(), RecRegisterRawStatSyncCb(), RecSetRecord(), RecSetSyncRequired(), and RecSyncConfigToTB().
Definition at line 39 of file RecCore.cc.
Referenced by RecAlloc().