Skip to content

Commit aa1813f

Browse files
committed
Remove commit() function on middle
This can now be handled by the after_relations() function.
1 parent a79d355 commit aa1813f

File tree

7 files changed

+17
-87
lines changed

7 files changed

+17
-87
lines changed

src/middle-pgsql.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,9 @@ void middle_pgsql_t::after_relations()
629629
m_db_copy.sync();
630630
auto const &table = m_tables[REL_TABLE];
631631
analyze_table(m_db_connection, table.schema(), table.name());
632+
633+
// release the copy thread and its database connection
634+
m_copy_thread->finish();
632635
}
633636

634637
middle_query_pgsql_t::middle_query_pgsql_t(
@@ -668,13 +671,6 @@ void middle_pgsql_t::start()
668671
}
669672
}
670673

671-
void middle_pgsql_t::commit()
672-
{
673-
m_db_copy.sync();
674-
// release the copy thread and its query connection
675-
m_copy_thread->finish();
676-
}
677-
678674
void middle_pgsql_t::stop(thread_pool_t &pool)
679675
{
680676
m_cache.reset();

src/middle-pgsql.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ struct middle_pgsql_t : public middle_t
6060

6161
void start() override;
6262
void stop(thread_pool_t &pool) override;
63-
void commit() override;
6463

6564
void node(osmium::Node const &node) override;
6665
void way(osmium::Way const &way) override;

src/middle-ram.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ struct middle_ram_t : public middle_t, public middle_query_t
9696

9797
void start() override {}
9898
void stop(thread_pool_t &pool) override;
99-
void commit() override {}
10099

101100
void node(osmium::Node const &node) override;
102101
void way(osmium::Way const &way) override;

src/middle.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ struct middle_t
7474

7575
virtual void start() = 0;
7676
virtual void stop(thread_pool_t &pool) = 0;
77-
virtual void commit() = 0;
7877

7978
/// This is called for every added, changed or deleted node.
8079
virtual void node(osmium::Node const &node) = 0;

src/osmdata.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,6 @@ void osmdata_t::postprocess_database() const
445445

446446
void osmdata_t::stop() const
447447
{
448-
/* Commit the transactions, so that multiple processes can
449-
* access the data simultaneously to process the rest in parallel
450-
* as well as see the newly created tables.
451-
*/
452-
m_mid->commit();
453448
for (auto &out : m_outs) {
454449
out->sync();
455450
}

0 commit comments

Comments
 (0)