Functions | Variables

RecCore.cc File Reference

Record core definitions. More...

#include "libts.h"
#include "P_RecFile.h"
#include "P_RecCore.h"
#include "P_RecUtils.h"
#include "P_RecTree.h"
#include "I_Layout.h"
Include dependency graph for RecCore.cc:

Go to the source code of this file.

Functions

static RecRecordregister_record (RecT rec_type, const char *name, RecDataT data_type, RecData data_default, RecPersistT persist_type)
static int link_int (const char *, RecDataT, RecData data, void *cookie)
static int link_int32 (const char *, RecDataT, RecData data, void *cookie)
static int link_uint32 (const char *, RecDataT, RecData data, void *cookie)
static int link_float (const char *, RecDataT, RecData data, void *cookie)
static int link_counter (const char *, RecDataT, RecData data, void *cookie)
static int link_byte (const char *, RecDataT, RecData data, void *cookie)
static int link_string_alloc (const char *, RecDataT, RecData data, void *cookie)
int RecCoreInit (RecModeT mode_type, Diags *_diags)
int RecLinkConfigInt (const char *name, RecInt *rec_int)
int RecLinkConfigInt32 (const char *name, int32_t *p_int32)
int RecLinkConfigUInt32 (const char *name, uint32_t *p_uint32)
int RecLinkConfigFloat (const char *name, RecFloat *rec_float)
int RecLinkConfigCounter (const char *name, RecCounter *rec_counter)
int RecLinkConfigString (const char *name, RecString *rec_string)
int RecLinkConfigByte (const char *name, RecByte *rec_byte)
int RecLinkConfigBool (const char *name, RecBool *rec_bool)
int RecRegisterConfigUpdateCb (const char *name, RecConfigUpdateCb update_cb, void *cookie)
int RecGetRecordInt (const char *name, RecInt *rec_int, bool lock)
int RecGetRecordFloat (const char *name, RecFloat *rec_float, bool lock)
int RecGetRecordString (const char *name, char *buf, int buf_len, bool lock)
int RecGetRecordString_Xmalloc (const char *name, RecString *rec_string, bool lock)
int RecGetRecordCounter (const char *name, RecCounter *rec_counter, bool lock)
int RecGetRecordByte (const char *name, RecByte *rec_byte, bool lock)
int RecGetRecordBool (const char *name, RecBool *rec_bool, bool lock)
int RecGetRecordType (const char *name, RecT *rec_type, bool lock)
int RecGetRecordDataType (const char *name, RecDataT *data_type, bool lock)
int RecGetRecordPersistenceType (const char *name, RecPersistT *persist_type, bool lock)
int RecGetRecordOrderAndId (const char *name, int *order, int *id, bool lock)
int RecGetRecordUpdateType (const char *name, RecUpdateT *update_type, bool lock)
int RecGetRecordCheckType (const char *name, RecCheckT *check_type, bool lock)
int RecGetRecordCheckExpr (const char *name, char **check_expr, bool lock)
int RecGetRecordDefaultDataString_Xmalloc (char *name, char **buf, bool lock)
int RecGetRecordAccessType (const char *name, RecAccessT *access, bool lock)
int RecSetRecordAccessType (const char *name, RecAccessT access, bool lock)
RecRecordRecRegisterStat (RecT rec_type, const char *name, RecDataT data_type, RecData data_default, RecPersistT persist_type)
RecRecordRecRegisterConfig (RecT rec_type, const char *name, RecDataT data_type, RecData data_default, RecUpdateT update_type, RecCheckT check_type, const char *check_expr, RecAccessT access_type)
int RecGetRecord_Xmalloc (const char *name, RecDataT data_type, RecData *data, bool lock)
RecRecordRecForceInsert (RecRecord *record)
static void debug_record_callback (RecT, void *, int registered, const char *name, int data_type, RecData *datum)
void RecDumpRecords (RecT rec_type, RecDumpEntryCb callback, void *edata)
void RecDumpRecordsHt (RecT rec_type)
void RecGetRecordTree (char *subtree)
void RecGetRecordList (char *var, char ***buffer, int *count)
int RecGetRecordPrefix_Xmalloc (char *prefix, char **buf, int *buf_len)
RecInt REC_ConfigReadInteger (const char *name)
char * REC_ConfigReadString (const char *name)
RecFloat REC_ConfigReadFloat (const char *name)
RecCounter REC_ConfigReadCounter (const char *name)
RecInt REC_readInteger (const char *name, bool *found, bool lock)
RecFloat REC_readFloat (char *name, bool *found, bool lock)
RecCounter REC_readCounter (char *name, bool *found, bool lock)
RecString REC_readString (const char *name, bool *found, bool lock)
char * RecConfigReadRuntimeDir ()
char * RecConfigReadLogDir ()
char * RecConfigReadBinDir ()
char * RecConfigReadSnapshotDir ()
char * RecConfigReadConfigPath (const char *file_variable, const char *default_value)
char * RecConfigReadPrefixPath (const char *file_variable, const char *default_value)
char * RecConfigReadPersistentStatsPath ()
void RecSignalWarning (int sig, const char *fmt,...)

Variables

static bool g_initialized = false
RecRecordg_records = NULL
InkHashTableg_records_ht = NULL
ink_rwlock g_records_rwlock
int g_num_records = 0
RecTreeg_records_tree = NULL

Detailed Description

Record core definitions.

License

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 RecCore.cc.


Function Documentation

static void debug_record_callback ( RecT  ,
void *  ,
int  registered,
const char *  name,
int  data_type,
RecData datum 
) [static]
static int link_byte ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 119 of file RecCore.cc.

References RecData::rec_int.

Referenced by RecLinkConfigBool(), and RecLinkConfigByte().

static int link_counter ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 109 of file RecCore.cc.

References RecData::rec_counter.

Referenced by RecLinkConfigCounter().

static int link_float ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 102 of file RecCore.cc.

References RecData::rec_float.

Referenced by RecLinkConfigFloat().

static int link_int ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 80 of file RecCore.cc.

References RecData::rec_int.

Referenced by RecLinkConfigInt().

static int link_int32 ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 88 of file RecCore.cc.

References REC_ERR_OKAY, and RecData::rec_int.

Referenced by RecLinkConfigInt32().

static int link_string_alloc ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 132 of file RecCore.cc.

References ats_free(), ats_strdup, and RecData::rec_string.

Referenced by RecLinkConfigString().

static int link_uint32 ( const char *  ,
RecDataT  ,
RecData  data,
void *  cookie 
) [static]

Definition at line 95 of file RecCore.cc.

References REC_ERR_OKAY, and RecData::rec_int.

Referenced by RecLinkConfigUInt32().

RecCounter REC_ConfigReadCounter ( const char *  name  ) 

Definition at line 1035 of file RecCore.cc.

References RecGetRecordCounter().

RecFloat REC_ConfigReadFloat ( const char *  name  ) 

Definition at line 1027 of file RecCore.cc.

References RecGetRecordFloat().

RecInt REC_ConfigReadInteger ( const char *  name  ) 
char* REC_ConfigReadString ( const char *  name  ) 
RecCounter REC_readCounter ( char *  name,
bool *  found,
bool  lock 
)

Definition at line 1071 of file RecCore.cc.

References ink_assert, and RecGetRecordCounter().

Referenced by LogAccess::marshal_record().

RecFloat REC_readFloat ( char *  name,
bool *  found,
bool  lock 
)

Definition at line 1059 of file RecCore.cc.

References ink_assert, and RecGetRecordFloat().

Referenced by LogAccess::marshal_record().

RecInt REC_readInteger ( const char *  name,
bool *  found,
bool  lock 
)

Definition at line 1047 of file RecCore.cc.

References ink_assert, and RecGetRecordInt().

Referenced by LogAccess::marshal_record(), and DiagsConfig::reconfigure_diags().

RecString REC_readString ( const char *  name,
bool *  found,
bool  lock 
)
char* RecConfigReadBinDir (  ) 
char* RecConfigReadConfigPath ( const char *  file_variable,
const char *  default_value 
)
char* RecConfigReadLogDir (  ) 
char* RecConfigReadPersistentStatsPath (  ) 
char* RecConfigReadPrefixPath ( const char *  file_variable,
const char *  default_value 
)

Definition at line 1187 of file RecCore.cc.

References Layout::get(), PATH_NAME_MAX, RecGetRecordString(), and Layout::relative_to().

Referenced by TSPluginDirGet().

char* RecConfigReadRuntimeDir (  ) 
char* RecConfigReadSnapshotDir (  ) 

Definition at line 1149 of file RecCore.cc.

References Layout::get(), PATH_NAME_MAX, RecGetRecordString(), and Layout::relative_to().

int RecCoreInit ( RecModeT  mode_type,
Diags _diags 
)
void RecDumpRecords ( RecT  rec_type,
RecDumpEntryCb  callback,
void *  edata 
)
void RecDumpRecordsHt ( RecT  rec_type  ) 

Definition at line 918 of file RecCore.cc.

References debug_record_callback(), DL_Note, RecDebug(), and RecDumpRecords().

RecRecord* RecForceInsert ( RecRecord record  ) 
int RecGetRecord_Xmalloc ( const char *  name,
RecDataT  data_type,
RecData data,
bool  lock 
)
int RecGetRecordAccessType ( const char *  name,
RecAccessT access,
bool  lock 
)
int RecGetRecordBool ( const char *  name,
RecBool rec_bool,
bool  lock 
)

Definition at line 417 of file RecCore.cc.

References REC_ERR_OKAY, RecData::rec_int, RECD_INT, and RecGetRecord_Xmalloc().

Referenced by RecLinkConfigBool().

int RecGetRecordByte ( const char *  name,
RecByte rec_byte,
bool  lock 
)
int RecGetRecordCheckExpr ( const char *  name,
char **  check_expr,
bool  lock 
)
int RecGetRecordCheckType ( const char *  name,
RecCheckT check_type,
bool  lock 
)
int RecGetRecordCounter ( const char *  name,
RecCounter rec_counter,
bool  lock 
)
int RecGetRecordDataType ( const char *  name,
RecDataT data_type,
bool  lock 
)
int RecGetRecordDefaultDataString_Xmalloc ( char *  name,
char **  buf,
bool  lock 
)
int RecGetRecordFloat ( const char *  name,
RecFloat rec_float,
bool  lock 
)
int RecGetRecordInt ( const char *  name,
RecInt rec_int,
bool  lock 
)
void RecGetRecordList ( char *  var,
char ***  buffer,
int *  count 
)

Definition at line 934 of file RecCore.cc.

References RecTree::rec_tree_get_list().

int RecGetRecordOrderAndId ( const char *  name,
int *  order,
int *  id,
bool  lock 
)
int RecGetRecordPersistenceType ( const char *  name,
RecPersistT persist_type,
bool  lock 
)
int RecGetRecordPrefix_Xmalloc ( char *  prefix,
char **  buf,
int *  buf_len 
)
int RecGetRecordString ( const char *  name,
char *  buf,
int  buf_len,
bool  lock 
)
int RecGetRecordString_Xmalloc ( const char *  name,
RecString rec_string,
bool  lock 
)
void RecGetRecordTree ( char *  subtree  ) 

Definition at line 924 of file RecCore.cc.

References RecTree::print(), and RecTree::rec_tree_get().

int RecGetRecordType ( const char *  name,
RecT rec_type,
bool  lock 
)
int RecGetRecordUpdateType ( const char *  name,
RecUpdateT update_type,
bool  lock 
)
int RecLinkConfigBool ( const char *  name,
RecBool rec_bool 
)

Definition at line 271 of file RecCore.cc.

References link_byte(), REC_ERR_FAIL, RecGetRecordBool(), and RecRegisterConfigUpdateCb().

int RecLinkConfigByte ( const char *  name,
RecByte rec_byte 
)

Definition at line 262 of file RecCore.cc.

References link_byte(), REC_ERR_FAIL, RecGetRecordByte(), and RecRegisterConfigUpdateCb().

int RecLinkConfigCounter ( const char *  name,
RecCounter rec_counter 
)
int RecLinkConfigFloat ( const char *  name,
RecFloat rec_float 
)
int RecLinkConfigInt ( const char *  name,
RecInt rec_int 
)

Definition at line 214 of file RecCore.cc.

References link_int(), REC_ERR_FAIL, RecGetRecordInt(), and RecRegisterConfigUpdateCb().

int RecLinkConfigInt32 ( const char *  name,
int32_t *  p_int32 
)

Definition at line 223 of file RecCore.cc.

References link_int32(), and RecRegisterConfigUpdateCb().

int RecLinkConfigString ( const char *  name,
RecString rec_string 
)
int RecLinkConfigUInt32 ( const char *  name,
uint32_t *  p_uint32 
)

Definition at line 229 of file RecCore.cc.

References link_uint32(), and RecRegisterConfigUpdateCb().

RecRecord* RecRegisterConfig ( RecT  rec_type,
const char *  name,
RecDataT  data_type,
RecData  data_default,
RecUpdateT  update_type,
RecCheckT  check_type,
const char *  check_expr,
RecAccessT  access_type 
)
int RecRegisterConfigUpdateCb ( const char *  name,
RecConfigUpdateCb  update_cb,
void *  cookie 
)
RecRecord* RecRegisterStat ( RecT  rec_type,
const char *  name,
RecDataT  data_type,
RecData  data_default,
RecPersistT  persist_type 
)
int RecSetRecordAccessType ( const char *  name,
RecAccessT  access,
bool  lock 
)
void RecSignalWarning ( int  sig,
const char *  fmt,
  ... 
)

Definition at line 1215 of file RecCore.cc.

References RecSignalManager(), and WarningV.

static RecRecord* register_record ( RecT  rec_type,
const char *  name,
RecDataT  data_type,
RecData  data_default,
RecPersistT  persist_type 
) [static]

Variable Documentation

bool g_initialized = false [static]

Definition at line 32 of file RecCore.cc.

Referenced by RecCoreInit().

int g_num_records = 0

Definition at line 39 of file RecCore.cc.

Referenced by RecAlloc().