Add support for disabling feature datasets (#6666)

This change adds support for disabling datasets, such that specific
files are not loaded into memory when running OSRM. This enables users
to not pay the memory cost for features they do not intend to use.

Initially, there are two options:
- ROUTE_GEOMETRY, for disabling overview, steps, annotations and waypoints.
- ROUTE_STEPS, for disabling steps only.

Attempts to query features for which the datasets are disabled will
lead to a DisabledDatasetException being returned.
This commit is contained in:
Michael Bell
2023-08-04 18:43:37 +01:00
committed by GitHub
parent 522d0f066e
commit db7946d762
34 changed files with 1005 additions and 200 deletions
+15
View File
@@ -0,0 +1,15 @@
#ifndef DATASETS_HPP
#define DATASETS_HPP
namespace osrm::storage
{
enum class FeatureDataset
{
ROUTE_STEPS,
ROUTE_GEOMETRY,
};
} // namespace osrm::storage
#endif
+2 -1
View File
@@ -23,7 +23,8 @@ enum ErrorCode
FileIOError,
UnexpectedEndOfFile,
IncompatibleDataset,
UnknownAlgorithm
UnknownAlgorithm,
UnknownFeatureDataset
#ifndef NDEBUG
// Leave this at the end. In debug mode, we assert that the size of
// this enum matches the number of messages we have documented, and __ENDMARKER__