diff options
author | Tor Egge <Tor.Egge@broadpark.no> | 2020-10-16 13:23:25 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@broadpark.no> | 2020-10-16 13:51:26 +0200 |
commit | 74328b3e224d5a439f409a9c864cf4c8c3ef2b5f (patch) | |
tree | 8237a1e9c3e035418f000994435b7d309761d6c3 /searchcore/src/apps/proton | |
parent | 621fae9dd249a0e5e713cf037f0d215adcbdae13 (diff) |
Remove search::StateFile and search::StateBuf.
Diffstat (limited to 'searchcore/src/apps/proton')
-rw-r--r-- | searchcore/src/apps/proton/proton.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index c2067f744a8..51e34f09e22 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -2,7 +2,6 @@ #include <vespa/searchcore/proton/server/proton.h> #include <vespa/storage/storageserver/storagenode.h> -#include <vespa/searchlib/util/statefile.h> #include <vespa/metrics/metricmanager.h> #include <vespa/vespalib/util/signalhandler.h> #include <vespa/vespalib/util/programoptions.h> @@ -50,25 +49,6 @@ App::setupSignals() SIG::TERM.hook(); } -namespace { - -vespalib::string -getStateString(search::StateFile &stateFile) -{ - std::vector<char> buf; - stateFile.readState(buf); - if (!buf.empty() && buf[buf.size() - 1] == '\n') - buf.resize(buf.size() - 1); - return vespalib::string(buf.begin(), buf.end()); -} - -bool stateIsDown(const vespalib::string &stateString) -{ - return strstr(stateString.c_str(), "state=down") != nullptr; -} - -} - Params App::parseParams() { @@ -164,7 +144,6 @@ App::Main() LOG(debug, "identity: '%s'", params.identity.c_str()); LOG(debug, "serviceidentity: '%s'", params.serviceidentity.c_str()); LOG(debug, "subscribeTimeout: '%" PRIu64 "'", params.subscribeTimeout); - std::unique_ptr<search::StateFile> stateFile; protonUP = std::make_unique<proton::Proton>(params.identity, _argc > 0 ? _argv[0] : "proton", std::chrono::milliseconds(params.subscribeTimeout)); proton::Proton & proton = *protonUP; proton::BootstrapConfig::SP configSnapshot = proton.init(); @@ -174,13 +153,6 @@ App::Main() const ProtonConfig &protonConfig = configSnapshot->getProtonConfig(); vespalib::string basedir = protonConfig.basedir; vespalib::mkdir(basedir, true); - // TODO: Test that we can write to new file in directory - stateFile = std::make_unique<search::StateFile>(basedir + "/state"); - int stateGen = stateFile->getGen(); - vespalib::string stateString = getStateString(*stateFile); - if (stateIsDown(stateString)) { - LOG(error, "proton state string is %s", stateString.c_str()); - } if ( ! params.serviceidentity.empty()) { proton.getMetricManager().init(params.serviceidentity, proton.getThreadPool()); } else { @@ -202,13 +174,6 @@ App::Main() storage::ResumeGuard guard(spiProton->getNode().pause()); spiProton->updateConfig(); } - if (stateGen != stateFile->getGen()) { - stateGen = stateFile->getGen(); - stateString = getStateString(*stateFile); - if (stateIsDown(stateString)) { - LOG(error, "proton state string is %s", stateString.c_str()); - } - } } // Ensure metric manager and state server are shut down before we start tearing // down any service layer components that they may end up transitively using. |