Skip to content

Commit 213798e

Browse files
committed
NO SUBCHUNK MATERIALIZATION: cleanup at workers
1 parent 250b43a commit 213798e

File tree

16 files changed

+21
-1144
lines changed

16 files changed

+21
-1144
lines changed

src/wbase/Task.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ Task::~Task() {
221221

222222
vector<Task::Ptr> Task::createTasks(shared_ptr<proto::TaskMsg> const& taskMsg,
223223
shared_ptr<wbase::FileChannelShared> const& sendChannel,
224-
shared_ptr<wdb::ChunkResourceMgr> const& chunkResourceMgr,
225224
mysql::MySqlConfig const& mySqlConfig,
226225
shared_ptr<wcontrol::SqlConnMgr> const& sqlConnMgr,
227226
shared_ptr<wpublish::QueriesAndChunks> const& queriesAndChunks,
@@ -259,8 +258,8 @@ vector<Task::Ptr> Task::createTasks(shared_ptr<proto::TaskMsg> const& taskMsg,
259258
}
260259
for (auto task : vect) {
261260
// newQueryRunner sets the `_taskQueryRunner` pointer in `task`.
262-
task->setTaskQueryRunner(wdb::QueryRunner::newQueryRunner(task, chunkResourceMgr, mySqlConfig,
263-
sqlConnMgr, queriesAndChunks));
261+
task->setTaskQueryRunner(
262+
wdb::QueryRunner::newQueryRunner(task, mySqlConfig, sqlConnMgr, queriesAndChunks));
264263
}
265264
sendChannel->setTaskCount(vect.size());
266265

src/wbase/Task.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ class FileChannelShared;
6060
namespace lsst::qserv::wcontrol {
6161
class SqlConnMgr;
6262
}
63-
namespace lsst::qserv::wdb {
64-
class ChunkResourceMgr;
65-
}
6663
namespace lsst::qserv::wpublish {
6764
class QueriesAndChunks;
6865
class QueryStatistics;
@@ -165,7 +162,6 @@ class Task : public util::CommandForThreadPool {
165162
/// Read 'taskMsg' to generate a vector of one or more task objects all using the same 'sendChannel'
166163
static std::vector<Ptr> createTasks(std::shared_ptr<proto::TaskMsg> const& taskMsg,
167164
std::shared_ptr<wbase::FileChannelShared> const& sendChannel,
168-
std::shared_ptr<wdb::ChunkResourceMgr> const& chunkResourceMgr,
169165
mysql::MySqlConfig const& mySqlConfig,
170166
std::shared_ptr<wcontrol::SqlConnMgr> const& sqlConnMgr,
171167
std::shared_ptr<wpublish::QueriesAndChunks> const& queriesAndChunks,

src/wcontrol/Foreman.cc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@
4444
#include "wcontrol/ResourceMonitor.h"
4545
#include "wcontrol/SqlConnMgr.h"
4646
#include "wcontrol/WorkerStats.h"
47-
#include "wdb/ChunkResource.h"
48-
#include "wdb/SQLBackend.h"
4947
#include "wpublish/QueriesAndChunks.h"
5048

5149
using namespace std;
@@ -90,13 +88,6 @@ Foreman::Foreman(Scheduler::Ptr const& scheduler, unsigned int poolSize, unsigne
9088
_resourceMonitor(make_shared<ResourceMonitor>()),
9189
_io_service(),
9290
_httpServer(qhttp::Server::create(_io_service, 0 /* grab the first available port */)) {
93-
// Make the chunk resource mgr
94-
// Creating backend makes a connection to the database for making temporary tables.
95-
// It will delete temporary tables that it can identify as being created by a worker.
96-
// Previous instances of the worker will terminate when they try to use or create temporary tables.
97-
// Previous instances of the worker should be terminated before a new worker is started.
98-
_chunkResourceMgr = wdb::ChunkResourceMgr::newMgr(make_shared<wdb::SQLBackend>(_mySqlConfig));
99-
10091
assert(_scheduler); // Cannot operate without scheduler.
10192

10293
LOGS(_log, LOG_LVL_DEBUG, "poolSize=" << poolSize << " maxPoolThreads=" << maxPoolThreads);

src/wcontrol/Foreman.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class Server;
5959
} // namespace lsst::qserv::qhttp
6060

6161
namespace lsst::qserv::wdb {
62-
class ChunkResourceMgr;
6362
class QueryRunner;
6463
} // namespace lsst::qserv::wdb
6564

@@ -93,7 +92,6 @@ class Scheduler : public wbase::TaskScheduler, public util::CommandQueue {
9392
};
9493

9594
/// Foreman is used to maintain a thread pool and schedule Tasks for the thread pool.
96-
/// It also manages sub-chunk tables with the ChunkResourceMgr.
9795
/// The schedulers may limit the number of threads they will use from the thread pool.
9896
class Foreman : public wbase::MsgProcessor {
9997
public:
@@ -117,7 +115,6 @@ class Foreman : public wbase::MsgProcessor {
117115
Foreman(Foreman const&) = delete;
118116
Foreman& operator=(Foreman const&) = delete;
119117

120-
std::shared_ptr<wdb::ChunkResourceMgr> const& chunkResourceMgr() const { return _chunkResourceMgr; }
121118
mysql::MySqlConfig const& mySqlConfig() const { return _mySqlConfig; }
122119
std::shared_ptr<wpublish::QueriesAndChunks> const& queriesAndChunks() const { return _queries; }
123120
std::shared_ptr<wpublish::ChunkInventory> const& chunkInventory() const { return _chunkInventory; }
@@ -139,8 +136,6 @@ class Foreman : public wbase::MsgProcessor {
139136
virtual nlohmann::json statusToJson(wbase::TaskSelector const& taskSelector) override;
140137

141138
private:
142-
std::shared_ptr<wdb::ChunkResourceMgr> _chunkResourceMgr;
143-
144139
util::ThreadPool::Ptr _pool;
145140
Scheduler::Ptr _scheduler;
146141

src/wdb/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ add_library(wdb SHARED)
22
add_dependencies(wdb proto)
33

44
target_sources(wdb PRIVATE
5-
ChunkResource.cc
65
QueryRunner.cc
76
QuerySql.cc
8-
SQLBackend.cc
97
)
108

119
target_include_directories(wdb PRIVATE
@@ -38,7 +36,6 @@ FUNCTION(wdb_tests)
3836
ENDFUNCTION()
3937

4038
wdb_tests(
41-
testChunkResource
4239
testQueryRunner
4340
testQuerySql
4441
)

0 commit comments

Comments
 (0)