/* Initialize GLib hash tables */ void init_storage (void) { GModule module; ht_agent_keys = new_str_ht (g_free, g_free); ht_agent_vals = new_str_ht (g_free, g_free); ht_hostnames = new_str_ht (g_free, g_free); ht_unique_keys = new_str_ht (g_free, g_free); ht_storage = new_gstorage (TOTAL_MODULES); for (module = 0; module < TOTAL_MODULES; ++module) { init_tables (module); } }
/* Initialize Tokyo Cabinet storage tables */ void init_storage (void) { GModule module; ht_agent_keys = tc_adb_create (get_dbname (DB_AGENT_KEYS, -1)); ht_agent_vals = tc_adb_create (get_dbname (DB_AGENT_VALS, -1)); ht_general_stats = tc_adb_create (get_dbname (DB_GEN_STATS, -1)); ht_hostnames = tc_adb_create (get_dbname (DB_HOSTNAMES, -1)); ht_unique_keys = tc_adb_create (get_dbname (DB_UNIQUE_KEYS, -1)); ht_storage = new_gstorage (TOTAL_MODULES); for (module = 0; module < TOTAL_MODULES; ++module) { init_tables (module); } }