Addressed comments
This commit is contained in:
committed by
Daniel J. H
parent
d9e8caf369
commit
0b5c7a97a7
@@ -43,12 +43,13 @@ namespace contractor
|
||||
struct ContractorConfig final : storage::IOConfig
|
||||
{
|
||||
ContractorConfig()
|
||||
: requested_num_threads(0), IOConfig(
|
||||
{
|
||||
".osrm",
|
||||
},
|
||||
{},
|
||||
{".osrm.level", ".osrm.core", ".osrm.hsgr", ".osrm.enw"})
|
||||
: IOConfig(
|
||||
{
|
||||
".osrm",
|
||||
},
|
||||
{},
|
||||
{".osrm.level", ".osrm.core", ".osrm.hsgr", ".osrm.enw"}),
|
||||
requested_num_threads(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,13 @@ namespace customizer
|
||||
struct CustomizationConfig final : storage::IOConfig
|
||||
{
|
||||
CustomizationConfig()
|
||||
: requested_num_threads(0),
|
||||
IOConfig(
|
||||
: IOConfig(
|
||||
{
|
||||
".osrm",
|
||||
},
|
||||
{},
|
||||
{".osrm.ebg", ".osrm.partition", ".osrm.cells", ".osrm.mldgr"})
|
||||
{".osrm.ebg", ".osrm.partition", ".osrm.cells", ".osrm.mldgr"}),
|
||||
requested_num_threads(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ namespace extractor
|
||||
|
||||
struct ExtractorConfig final : storage::IOConfig
|
||||
{
|
||||
ExtractorConfig() noexcept : requested_num_threads(0),
|
||||
IOConfig(
|
||||
ExtractorConfig() noexcept : IOConfig(
|
||||
{
|
||||
"",
|
||||
},
|
||||
@@ -68,7 +67,8 @@ struct ExtractorConfig final : storage::IOConfig
|
||||
".osrm.properties",
|
||||
".osrm.icd",
|
||||
".osrm.cnbg",
|
||||
".osrm.cnbg_to_ebg"})
|
||||
".osrm.cnbg_to_ebg"}),
|
||||
requested_num_threads(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@ namespace partition
|
||||
struct PartitionConfig final : storage::IOConfig
|
||||
{
|
||||
PartitionConfig()
|
||||
: requested_num_threads(0), balance(1.2), boundary_factor(0.25), num_optimizing_cuts(10),
|
||||
small_component_size(1000),
|
||||
max_cell_sizes{128, 128 * 32, 128 * 32 * 16, 128 * 32 * 16 * 32},
|
||||
IOConfig(
|
||||
: IOConfig(
|
||||
{".osrm", ".osrm.fileIndex", ".osrm.ebg_nodes"},
|
||||
{".osrm.hsgr", ".osrm.cnbg"},
|
||||
{".osrm.ebg", ".osrm.cnbg", ".osrm.cnbg_to_ebg", ".osrm.partition", ".osrm.cells"})
|
||||
{".osrm.ebg", ".osrm.cnbg", ".osrm.cnbg_to_ebg", ".osrm.partition", ".osrm.cells"}),
|
||||
requested_num_threads(0), balance(1.2), boundary_factor(0.25), num_optimizing_cuts(10),
|
||||
small_component_size(1000),
|
||||
max_cell_sizes({128, 128 * 32, 128 * 32 * 16, 128 * 32 * 16 * 32})
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define OSRM_IO_CONFIG_HPP
|
||||
|
||||
#include "util/exception.hpp"
|
||||
#include "util/log.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
@@ -16,11 +15,11 @@ namespace storage
|
||||
{
|
||||
struct IOConfig
|
||||
{
|
||||
IOConfig(std::vector<boost::filesystem::path> _required_input_files,
|
||||
std::vector<boost::filesystem::path> _optional_input_files,
|
||||
std::vector<boost::filesystem::path> _output_files)
|
||||
: required_input_files(_required_input_files), optional_input_files(_optional_input_files),
|
||||
output_files(_output_files)
|
||||
IOConfig(std::vector<boost::filesystem::path> required_input_files_,
|
||||
std::vector<boost::filesystem::path> optional_input_files_,
|
||||
std::vector<boost::filesystem::path> output_files_)
|
||||
: required_input_files(required_input_files_), optional_input_files(optional_input_files_),
|
||||
output_files(output_files_)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -46,27 +45,12 @@ struct IOConfig
|
||||
base_path = {path};
|
||||
}
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
bool success = true;
|
||||
for (auto &fileName : required_input_files)
|
||||
{
|
||||
if (!boost::filesystem::is_regular_file({base_path.string() + fileName.string()}))
|
||||
{
|
||||
util::Log(logWARNING) << "Missing/Broken File: " << base_path.string()
|
||||
<< fileName.string();
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
bool IsValid() const;
|
||||
boost::filesystem::path GetPath(const std::string &fileName) const
|
||||
{
|
||||
if (!IsConfigured(fileName, required_input_files) &&
|
||||
!IsConfigured(fileName, optional_input_files) && !IsConfigured(fileName, output_files))
|
||||
{
|
||||
util::Log(logERROR) << "Tried to access file which is not configured: " << fileName;
|
||||
throw util::exception("Tried to access file which is not configured: " + fileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ struct StorageConfig final : IOConfig
|
||||
".osrm.properties",
|
||||
".osrm.icd"},
|
||||
{".osrm.hsgr",
|
||||
".osrm.nodes",
|
||||
".osrm.nbg_nodes",
|
||||
".osrm.ebg_nodes",
|
||||
".osrm.core",
|
||||
|
||||
Reference in New Issue
Block a user