[Tile-serving] [openstreetmap/osm2pgsql] Add --middle-propagate-changes option (#1310)
Sarah Hoffmann
notifications at github.com
Fri Nov 6 09:33:58 UTC 2020
@lonvia commented on this pull request.
The change looks okay. Just some nitpicking wrt naming: internally, we have called the process 'dependency management'. So the previous terminology of forward-dependency might fit better in general than propagate-changes.
> @@ -193,11 +194,7 @@ class multithreaded_processor
auto copy_thread = std::make_shared<db_copy_thread_t>(conninfo);
for (auto const &out : m_outputs) {
- if (out->need_forward_dependencies()) {
- m_clones[i].push_back(out->clone(midq, copy_thread));
- } else {
- m_clones[i].emplace_back(nullptr);
- }
+ m_clones[i].push_back(out->clone(midq, copy_thread));
Given that we no longer push back nullptr here, I'd expect some ifs to be unnecessary somewhere else. Possibly line 249?
> @@ -72,13 +72,7 @@ middle_pgsql_t::table_desc::table_desc(options_t const &options,
m_copy_target->schema = options.middle_dbschema;
m_copy_target->id = "id"; // XXX hardcoded column name
- // Gazetteer doesn't use mark-pending processing and consequently
- // needs no way-node index.
- // TODO Currently, set here to keep the impact on the code small.
- // We actually should have the output plugins report their needs
- // and pass that via the constructor to middle_t, so that middle_t
- // itself doesn't need to know about details of the output.
- if (options.output_backend != "gazetteer") {
+ if (options.propagate_changes) {
m_prepare_intarray = build_sql(options, ts.prepare_mark);
m_array_indexes = build_sql(options, ts.create_index);
May I suggest to rename `prepare_mark` and `create_index` to reflect that this is the SQL needed for propagate_changes? The names were never particularly good to start with.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/1310#pullrequestreview-524959449
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20201106/02074a09/attachment.htm>
More information about the Tile-serving
mailing list