Skip to content

Commit

Permalink
Eliminated the replication worker "technology" parameters
Browse files Browse the repository at this point in the history
The parameter is no longer needed after refacttoring and simplifying
a design and implementation of the worker service.
  • Loading branch information
iagaponenko committed Nov 18, 2024
1 parent 36dc72a commit 562ed4f
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 22 deletions.
6 changes: 2 additions & 4 deletions src/replica/config/ConfigTestData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ map<string, set<string>> ConfigTestData::parameters() {
{"xrootd",
{"auto-notify", "request-timeout-sec", "host", "port", "allow-reconnect", "reconnect-timeout"}},
{"worker",
{"technology",
"num-threads",
{"num-threads",
"num-svc-processing-threads",
"num-fs-processing-threads",
"fs-buf-size-bytes",
Expand Down Expand Up @@ -113,8 +112,7 @@ json ConfigTestData::data() {
{"request-timeout-sec", 400},
{"allow-reconnect", 0},
{"reconnect-timeout", 500}});
generalObj["worker"] = json::object({{"technology", "POSIX"},
{"num-threads", 3},
generalObj["worker"] = json::object({{"num-threads", 3},
{"num-svc-processing-threads", 4},
{"num-fs-processing-threads", 5},
{"fs-buf-size-bytes", 1024},
Expand Down
7 changes: 1 addition & 6 deletions src/replica/config/ConfigurationSchema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,7 @@ json const ConfigurationSchema::_schemaJson = json::object(
" (if the server is not up, or if it's not reachable for some reason)"},
{"default", 3600}}}}},
{"worker",
{{"technology",
{{"description",
"The name of a technology for implementing replica management requests at workers."},
{"restricted", {{"type", "set"}, {"values", json::array({"FS", "POSIX", "TEST"})}}},
{"default", "FS"}}},
{"num-threads",
{{"num-threads",
{{"description",
"The number of threads managed by BOOST ASIO. Must be greater than 0."
" Note that setting too many threads may result in a significant memory footprint"
Expand Down
1 change: 0 additions & 1 deletion src/replica/proto/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,6 @@ message ProtocolServiceResponse {
RUNNING = 2;
}
required ServiceState service_state = 3;
required string technology = 4;

/// When the service started (milliseconds since UNIX Epoch)
required uint64 start_time = 5;
Expand Down
2 changes: 0 additions & 2 deletions src/replica/requests/ServiceManagementRequestBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ void ServiceState::set(ProtocolServiceResponse const& message) {
throw runtime_error("ServiceState::" + string(__func__) +
" service state found in protocol is unknown");
}
technology = message.technology();
startTime = message.start_time();

numNewRequests = message.num_new_requests();
Expand All @@ -121,7 +120,6 @@ ostream& operator<<(ostream& os, ServiceState const& ss) {
os << "ServiceState:\n"
<< "\n Summary:\n\n"
<< " service state: " << ss.state2string() << "\n"
<< " technology: " << ss.technology << "\n"
<< " start time [ms]: " << ss.startTime << " (" << secondsAgo << " seconds ago)\n"
<< " total new requests: " << ss.numNewRequests << "\n"
<< " total in-progress requests: " << ss.numInProgressRequests << "\n"
Expand Down
3 changes: 0 additions & 3 deletions src/replica/requests/ServiceManagementRequestBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ struct ServiceState {
enum State { SUSPEND_IN_PROGRESS = 0, SUSPENDED = 1, RUNNING = 2 };
State state;

/// The back-end technology
std::string technology;

/// When the service started (milliseconds since UNIX Epoch)
uint64_t startTime;

Expand Down
5 changes: 0 additions & 5 deletions src/replica/tests/testConfiguration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ BOOST_AUTO_TEST_CASE(ConfigurationTestReadingGeneralParameters) {

BOOST_CHECK(config->get<size_t>("database", "services-pool-size") == 2);

BOOST_CHECK(config->get<string>("worker", "technology") == "POSIX");
BOOST_CHECK(config->get<size_t>("worker", "num-threads") == 3);
BOOST_CHECK(config->get<size_t>("worker", "num-svc-processing-threads") == 4);
BOOST_CHECK(config->get<size_t>("worker", "num-fs-processing-threads") == 5);
Expand Down Expand Up @@ -322,10 +321,6 @@ BOOST_AUTO_TEST_CASE(ConfigurationTestModifyingGeneralParameters) {
BOOST_REQUIRE_NO_THROW(config->set<size_t>("database", "services-pool-size", 3));
BOOST_CHECK(config->get<size_t>("database", "services-pool-size") == 3);

BOOST_CHECK_THROW(config->set<string>("worker", "technology", ""), std::invalid_argument);
BOOST_REQUIRE_NO_THROW(config->set<string>("worker", "technology", "FS"));
BOOST_CHECK(config->get<string>("worker", "technology") == "FS");

BOOST_CHECK_THROW(config->set<size_t>("worker", "num-threads", 0), std::invalid_argument);
BOOST_REQUIRE_NO_THROW(config->set<size_t>("worker", "num-threads", 4));
BOOST_CHECK(config->get<size_t>("worker", "num-threads") == 4);
Expand Down
1 change: 0 additions & 1 deletion src/replica/worker/WorkerProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ void WorkerProcessor::setServiceResponse(ProtocolServiceResponse& response, stri
replica::Lock lock(_mtx, _context(__func__));

response.set_status(status);
response.set_technology("FS");
response.set_start_time(_startTime);

switch (state()) {
Expand Down

0 comments on commit 562ed4f

Please sign in to comment.