Build all 7 edge index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */
| 2006 | |
| 2007 | /* Build all 7 edge index B-trees. Returns 0 on success, ERR_SORT_FAILED on failure. */ |
| 2008 | static int build_edge_indexes(FILE *fp, uint32_t *next_page, CBMDumpEdge *edges, int edge_count, |
| 2009 | SortJob *esorts, uint32_t *source_root, uint32_t *target_root, |
| 2010 | uint32_t *type_root, uint32_t *tgt_type_root, uint32_t *src_type_root, |
| 2011 | uint32_t *url_path_root, uint32_t *auto_root) { |
| 2012 | *source_root = |
| 2013 | build_edge_index_sorted(fp, next_page, edges, edge_count, esorts[0].perm, ecell_source); |
| 2014 | *target_root = build_edge_index_sorted(fp, next_page, edges, edge_count, |
| 2015 | esorts[ESORT_TARGET].perm, ecell_target); |
| 2016 | *type_root = build_edge_index_sorted(fp, next_page, edges, edge_count, esorts[ESORT_TYPE].perm, |
| 2017 | ecell_type); |
| 2018 | *tgt_type_root = build_edge_index_sorted( |
| 2019 | fp, next_page, edges, edge_count, esorts[ESORT_PROJ_TGT_TYPE].perm, ecell_proj_target_type); |
| 2020 | *src_type_root = build_edge_index_sorted( |
| 2021 | fp, next_page, edges, edge_count, esorts[ESORT_PROJ_SRC_TYPE].perm, ecell_proj_source_type); |
| 2022 | *url_path_root = build_edge_index_sorted(fp, next_page, edges, edge_count, |
| 2023 | esorts[ESORT_URL_PATH].perm, ecell_url_path); |
| 2024 | *auto_root = build_edge_index_sorted(fp, next_page, edges, edge_count, |
| 2025 | esorts[ESORT_SRC_TGT_TYPE].perm, ecell_src_tgt_type); |
| 2026 | if (edge_count > 0 && (!*source_root || !*target_root || !*type_root || !*tgt_type_root || |
| 2027 | !*src_type_root || !*url_path_root || !*auto_root)) { |
| 2028 | return ERR_SORT_FAILED; |
| 2029 | } |
| 2030 | return 0; |
| 2031 | } |
| 2032 | |
| 2033 | /* Launch parallel sort threads for all index permutations. */ |
| 2034 | static void parallel_sort_indexes(SortJob *nsorts, int n_node, SortJob *esorts, int n_edge) { |
no test coverage detected