Separate serialization and files in extractor

This commit is contained in:
Patrick Niklaus
2017-04-01 18:44:49 +00:00
committed by Patrick Niklaus
parent 603e2ee7de
commit 08d62cd5e3
8 changed files with 112 additions and 46 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
#include "extractor/edge_based_edge.hpp"
#include "extractor/guidance/turn_analysis.hpp"
#include "extractor/guidance/turn_lane_handler.hpp"
#include "extractor/io.hpp"
#include "extractor/files.hpp"
#include "extractor/scripting_environment.hpp"
#include "extractor/suffix_table.hpp"
@@ -205,7 +205,7 @@ void EdgeBasedGraphFactory::Run(ScriptingEnvironment &scripting_environment,
m_edge_based_node_weights.reserve(m_max_edge_id + 1);
{
auto mapping = GenerateEdgeExpandedNodes();
io::write(cnbg_ebg_mapping_path, mapping);
files::writeNBGMapping(cnbg_ebg_mapping_path, mapping);
}
TIMER_STOP(generate_nodes);
+2 -2
View File
@@ -5,7 +5,7 @@
#include "extractor/extraction_node.hpp"
#include "extractor/extraction_way.hpp"
#include "extractor/extractor_callbacks.hpp"
#include "extractor/io.hpp"
#include "extractor/files.hpp"
#include "extractor/raster_source.hpp"
#include "extractor/restriction_parser.hpp"
#include "extractor/scripting_environment.hpp"
@@ -512,7 +512,7 @@ Extractor::BuildEdgeExpandedGraph(ScriptingEnvironment &scripting_environment,
});
WriteTurnLaneData(config.turn_lane_descriptions_file_name);
io::write(config.geometry_output_path, *compressed_edge_container.ToSegmentData());
files::writeSegmentData(config.geometry_output_path, *compressed_edge_container.ToSegmentData());
edge_based_graph_factory.GetEdgeBasedEdges(edge_based_edge_list);
edge_based_graph_factory.GetEdgeBasedNodes(node_based_edge_list);
+2 -2
View File
@@ -9,7 +9,7 @@
#include "partition/recursive_bisection.hpp"
#include "partition/remove_unconnected.hpp"
#include "extractor/io.hpp"
#include "extractor/files.hpp"
#include "util/coordinate.hpp"
#include "util/geojson_debug_logger.hpp"
@@ -126,7 +126,7 @@ int Partitioner::Run(const PartitionConfig &config)
// For details see #3205
std::vector<extractor::NBGToEBG> mapping;
extractor::io::read(config.cnbg_ebg_mapping_path.string(), mapping);
extractor::files::readNBGMapping(config.cnbg_ebg_mapping_path.string(), mapping);
util::Log() << "Loaded node based graph to edge based graph mapping";
auto edge_based_graph = LoadEdgeBasedGraph(config.edge_based_graph_path.string());
+2 -2
View File
@@ -4,7 +4,7 @@
#include "extractor/compressed_edge_container.hpp"
#include "extractor/edge_based_edge.hpp"
#include "extractor/guidance/turn_instruction.hpp"
#include "extractor/io.hpp"
#include "extractor/files.hpp"
#include "extractor/original_edge_data.hpp"
#include "extractor/profile_properties.hpp"
#include "extractor/query_node.hpp"
@@ -686,7 +686,7 @@ void Storage::PopulateData(const DataLayout &layout, char *memory_ptr)
{
const auto datasources_names_ptr = layout.GetBlockPtr<extractor::Datasources, true>(
memory_ptr, DataLayout::DATASOURCES_NAMES);
extractor::io::read(config.datasource_names_path, *datasources_names_ptr);
extractor::files::readDatasources(config.datasource_names_path, *datasources_names_ptr);
}
// Loading list of coordinates
+7 -5
View File
@@ -2,12 +2,14 @@
#include "updater/csv_source.hpp"
#include "extractor/files.hpp"
#include "extractor/compressed_edge_container.hpp"
#include "extractor/edge_based_graph_factory.hpp"
#include "extractor/io.hpp"
#include "extractor/seralization.hpp"
#include "extractor/node_based_edge.hpp"
#include "storage/io.hpp"
#include "util/exception.hpp"
#include "util/exception_utils.hpp"
#include "util/for_each_pair.hpp"
@@ -85,7 +87,7 @@ void checkWeightsConsistency(
using OriginalEdgeData = osrm::extractor::OriginalEdgeData;
extractor::SegmentDataContainer segment_data;
extractor::io::read(config.geometry_path, segment_data);
extractor::files::readSegmentData(config.geometry_path, segment_data);
Reader edges_input_file(config.osrm_input_path.string() + ".edges", Reader::HasNoFingerprint);
std::vector<OriginalEdgeData> current_edge_data(edges_input_file.ReadElementCount64());
@@ -361,7 +363,7 @@ void saveDatasourcesNames(const UpdaterConfig &config)
source++;
}
extractor::io::write(config.datasource_names_path, sources);
extractor::files::writeDatasources(config.datasource_names_path, sources);
}
std::vector<std::uint64_t>
@@ -459,7 +461,7 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
if (update_edge_weights || update_turn_penalties)
{
const auto load_segment_data = [&] {
extractor::io::read(config.geometry_path, segment_data);
extractor::files::readSegmentData(config.geometry_path, segment_data);
};
const auto load_edge_data = [&] {
@@ -503,7 +505,7 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
updated_segments =
updateSegmentData(config, profile_properties, segment_speed_lookup, segment_data);
// Now save out the updated compressed geometries
extractor::io::write(config.geometry_path, segment_data);
extractor::files::writeSegmentData(config.geometry_path, segment_data);
TIMER_STOP(segment);
util::Log() << "Updating segment data took " << TIMER_MSEC(segment) << "ms.";
}