# # # # get_raw_graph_exists() # # # subroutine(get_raw_graph_exists( string profile_name, string graph_id, node collected_whitelist_objects), ( debug_message("\n\n#### get_raw_graph_exists START \n"); # The node collected_whitelist_objects is the in memory whitelist which tracks objects created in the current process. # We need to check for whitelist object existence in the whitelist in profiles_cache on disk or in the in memory whitelist! bool raw_graph_exists = false; bool raw_graph_node_exists = (?("profiles_cache." . profile_name . ".raw_graphs." . graph_id)); bool raw_graph_exists_in_whitelist = false; # 2008-11-10 - KHP - Check if the object is in disk whitelist or in memory in case that it hasn't been checked-out to disk yet. if (?("profiles_cache." . profile_name . ".whitelist.raw_graphs." . graph_id) or ?(collected_whitelist_objects . ".raw_graphs." . graph_id)) then ( raw_graph_exists_in_whitelist = true; ); # debug_message("v.collected_whitelist_objects: " . node_as_string('v.collected_whitelist_objects') . "\n"); # debug_message("raw_graph_exists_in_whitelist: " . raw_graph_exists_in_whitelist . "\n"); # 2008-11-10 - GMF - If it's not in the disk whitelist, maybe it's in memory, and hasn't been checked-out to disk yet. # 2008-11-11 - KHP - Greg's modification has been incorporated in the above modification # if (!raw_graph_exists_in_whitelist) then # raw_graph_exists_in_whitelist = ?('v.collected_whitelist_objects.raw_graphs.' . graph_id); # debug_message("2v.collected_whitelist_objects: " . node_as_string('v.collected_whitelist_objects') . "\n"); # debug_message("2raw_graph_exists_in_whitelist: " . raw_graph_exists_in_whitelist . "\n"); if (raw_graph_node_exists and raw_graph_exists_in_whitelist) then ( raw_graph_exists = true; ) else if (raw_graph_node_exists and !raw_graph_exists_in_whitelist) then ( # The raw graph node does not exist in whitelist, so there is most likely an invalid # raw_graph in profiles_cache. We delete the file. string pathname = LOGANALYSISINFO_DIRECTORY . "profiles_cache/" . profile_name . "/raw_graphs/" . graph_id . ".cfg"; delete_file(pathname); debug_message("#### Deleting raw graph file (" . pathname . ") because it does not exist in whitelist\n"); ); debug_message("#### raw_graph_node_exists: " . raw_graph_node_exists . "\n"); debug_message("#### raw_graph_exists_in_whitelist: " . raw_graph_exists_in_whitelist . "\n"); debug_message("#### raw_graph_node_exists: " . raw_graph_node_exists . "\n"); raw_graph_exists; debug_message("#### get_raw_graph_exists END \n"); ));