Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tickets/DM-43384 #846

Closed
wants to merge 9 commits into from
2 changes: 2 additions & 0 deletions src/ccontrol/UserQueryFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ UserQuery::Ptr UserQueryFactory::newUserQuery(std::string const& aQuery, std::st
// First check for SUBMIT and strip it
std::string query = aQuery;

// &&& need to have WorkerChunkMap info at this point

std::string stripped;
bool async = false;
if (UserQueryType::isSubmit(query, stripped)) {
Expand Down
1 change: 1 addition & 0 deletions src/czar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ add_library(czar OBJECT)

target_sources(czar PRIVATE
Czar.cc
CzarChunkMap.cc
HttpCzarSvc.cc
HttpCzarQueryModule.cc
HttpModule.cc
Expand Down
6 changes: 4 additions & 2 deletions src/czar/Czar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "ccontrol/UserQueryResources.h"
#include "ccontrol/UserQuerySelect.h"
#include "ccontrol/UserQueryType.h"
#include "czar/CzarChunkMap.h"
#include "czar/CzarErrors.h"
#include "czar/HttpSvc.h"
#include "czar/MessageTable.h"
Expand Down Expand Up @@ -138,8 +139,7 @@ Czar::Czar(string const& configFilePath, string const& czarName)
_czarConfig(cconfig::CzarConfig::create(configFilePath, czarName)),
_idCounter(),
_uqFactory(),
_clientToQuery(),
_mutex() {
_clientToQuery() {
// set id counter to milliseconds since the epoch, mod 1 year.
struct timeval tv;
gettimeofday(&tv, nullptr);
Expand All @@ -156,6 +156,8 @@ Czar::Czar(string const& configFilePath, string const& czarName)
// the name of the Czar gets translated into a numeric identifier.
_czarConfig->setId(_uqFactory->userQuerySharedResources()->qMetaCzarId);

_czarChunkMap = CzarChunkMap::create(_uqFactory->userQuerySharedResources()->queryMetadata);

// Tell workers to cancel any queries that were submitted before this restart of Czar.
// Figure out which query (if any) was recorded in Czar database before the restart.
// The id will be used as the high-watermark for queries that need to be cancelled.
Expand Down
5 changes: 5 additions & 0 deletions src/czar/Czar.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class FileMonitor;

namespace lsst::qserv::czar {

class CzarChunkMap;

/// @addtogroup czar

/**
Expand Down Expand Up @@ -179,6 +181,9 @@ class Czar {

/// The HTTP server processing Czar management requests.
std::shared_ptr<HttpSvc> _controlHttpSvc;

/// Map of which chunks on which workers and shared scan order.
std::shared_ptr<CzarChunkMap> _czarChunkMap;
};

} // namespace lsst::qserv::czar
Expand Down
Loading