catchunks: remove iterative version discovery method
refs: #4556
Change-Id: I22f35ea3c96a9eea32d478b13a52f9b3fba8442f
diff --git a/tests/chunks/discover-version-iterative.t.cpp b/tests/chunks/discover-version-iterative.t.cpp
deleted file mode 100644
index 79c6fb7..0000000
--- a/tests/chunks/discover-version-iterative.t.cpp
+++ /dev/null
@@ -1,233 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2016, Regents of the University of California,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University.
- *
- * This file is part of ndn-tools (Named Data Networking Essential Tools).
- * See AUTHORS.md for complete list of ndn-tools authors and contributors.
- *
- * ndn-tools is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * @author Andrea Tosatto
- */
-
-#include "tools/chunks/catchunks/discover-version-iterative.hpp"
-
-#include "discover-version-fixture.hpp"
-
-namespace ndn {
-namespace chunks {
-namespace tests {
-
-class DiscoverVersionIterativeFixture : public DiscoverVersionFixture,
- protected DiscoverVersionIterativeOptions
-{
-public:
- typedef DiscoverVersionIterativeOptions Options;
-
-public:
- explicit
- DiscoverVersionIterativeFixture(const Options& opt = makeOptionsIterative())
- : chunks::Options(opt)
- , DiscoverVersionFixture(opt)
- , Options(opt)
- {
- setDiscover(make_unique<DiscoverVersionIterative>(Name(name), face, opt));
- }
-
-protected:
- static Options
- makeOptionsIterative()
- {
- Options options;
- options.isVerbose = false;
- options.maxRetriesOnTimeoutOrNack = 3;
- options.maxRetriesAfterVersionFound = 1;
- return options;
- }
-};
-
-
-BOOST_AUTO_TEST_SUITE(Chunks)
-BOOST_AUTO_TEST_SUITE(TestDiscoverVersionIterative)
-
-BOOST_FIXTURE_TEST_CASE(SingleVersionAvailable, DiscoverVersionIterativeFixture)
-{
- discover->run();
- advanceClocks(io, time::nanoseconds(1), 1);
-
- uint64_t version = 1449241767037;
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
- auto lastInterest = face.sentInterests.back();
- BOOST_CHECK_EQUAL(lastInterest.getExclude().size(), 0);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
-
- // Send first segment for the right version
- face.receive(*makeDataWithVersion(version));
- advanceClocks(io, time::nanoseconds(1), 1);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2);
- lastInterest = face.sentInterests.back();
- Exclude expectedExclude;
- expectedExclude.excludeBefore(name::Component::fromVersion(version));
- BOOST_CHECK_EQUAL(lastInterest.getExclude(), expectedExclude);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
-
- // Generate the timeout
- for (int retries = 0; retries < maxRetriesAfterVersionFound; ++retries) {
- advanceClocks(io, interestLifetime, 1);
-
- BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), retries + 3);
- lastInterest = face.sentInterests.back();
- Exclude expectedExclude;
- expectedExclude.excludeBefore(name::Component::fromVersion(version));
- BOOST_CHECK_EQUAL(lastInterest.getExclude(), expectedExclude);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
- }
-
- advanceClocks(io, interestLifetime, 1);
- BOOST_CHECK_EQUAL(isDiscoveryFinished, true);
- BOOST_CHECK_EQUAL(discoveredVersion, version);
- BOOST_CHECK_EQUAL(face.sentInterests.size(), maxRetriesAfterVersionFound + 2);
-}
-
-
-BOOST_FIXTURE_TEST_CASE(NoVersionsAvailable, DiscoverVersionIterativeFixture)
-{
- discover->run();
- advanceClocks(io, time::nanoseconds(1), 1);
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
-
- for (int retries = 0; retries < maxRetriesOnTimeoutOrNack; ++retries) {
- advanceClocks(io, interestLifetime, 1);
- BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2 + retries);
- }
-
- for (auto& lastInterest : face.sentInterests) {
- BOOST_CHECK_EQUAL(lastInterest.getExclude().size(), 0);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
- }
-
- advanceClocks(io, interestLifetime, 1);
- BOOST_CHECK_EQUAL(isDiscoveryFinished, true);
- BOOST_CHECK_EQUAL(face.sentInterests.size(), maxRetriesOnTimeoutOrNack + 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(MultipleVersionsAvailable, DiscoverVersionIterativeFixture)
-{
- // nVersions must be positive
- const uint64_t nVersions = 5;
-
- discover->run();
- advanceClocks(io, time::nanoseconds(1), 1);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
- auto lastInterest = face.sentInterests.back();
- BOOST_CHECK_EQUAL(lastInterest.getExclude().size(), 0);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
-
- for (uint64_t nSentVersions = 0; nSentVersions < nVersions; ++nSentVersions) {
- face.receive(*makeDataWithVersion(nSentVersions));
- advanceClocks(io, time::nanoseconds(1), 1);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2 + nSentVersions);
- lastInterest = face.sentInterests.back();
- Exclude expectedExclude;
- expectedExclude.excludeBefore(name::Component::fromVersion(nSentVersions));
- BOOST_CHECK_EQUAL(lastInterest.getExclude(), expectedExclude);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
- }
-
- for (int retries = 0; retries < maxRetriesAfterVersionFound; ++retries) {
- advanceClocks(io, interestLifetime, 1);
-
- BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2 + retries + nVersions);
- lastInterest = face.sentInterests.back();
- Exclude expectedExclude;
- expectedExclude.excludeBefore(name::Component::fromVersion(nVersions - 1));
- BOOST_CHECK_EQUAL(lastInterest.getExclude(), expectedExclude);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
- }
-
- advanceClocks(io, interestLifetime, 1);
- BOOST_CHECK_EQUAL(isDiscoveryFinished, true);
- BOOST_CHECK_EQUAL(discoveredVersion, nVersions - 1);
- BOOST_CHECK_EQUAL(face.sentInterests.size(), nVersions + maxRetriesAfterVersionFound + 1);
-}
-
-BOOST_FIXTURE_TEST_CASE(MultipleVersionsAvailableDescendent, DiscoverVersionIterativeFixture)
-{
- // nVersions must be positive
- const uint64_t nVersions = 5;
-
- discover->run();
- advanceClocks(io, time::nanoseconds(1), 1);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
- auto lastInterest = face.sentInterests.back();
- BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
- BOOST_CHECK_EQUAL(lastInterest.getExclude().size(), 0);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
-
- for (uint64_t nVersionsToSend = nVersions; nVersionsToSend > 0; --nVersionsToSend) {
- face.receive(*makeDataWithVersion(nVersionsToSend - 1));
- advanceClocks(io, time::nanoseconds(1), 1);
-
- BOOST_CHECK_EQUAL(isDiscoveryFinished, false);
-
- BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 2);
- lastInterest = face.sentInterests.back();
- Exclude expectedExclude;
- expectedExclude.excludeBefore(name::Component::fromVersion(nVersions - 1));
- BOOST_CHECK_EQUAL(lastInterest.getExclude(), expectedExclude);
- BOOST_CHECK_EQUAL(lastInterest.getChildSelector(), 1);
- BOOST_CHECK_EQUAL(lastInterest.getMustBeFresh(), mustBeFresh);
- BOOST_CHECK_EQUAL(lastInterest.getName().equals(name), true);
- }
-
- advanceClocks(io, interestLifetime, maxRetriesAfterVersionFound + 1);
- BOOST_CHECK_EQUAL(isDiscoveryFinished, true);
- BOOST_CHECK_EQUAL(discoveredVersion, nVersions - 1);
- BOOST_CHECK_EQUAL(face.sentInterests.size(), maxRetriesAfterVersionFound + 2);
-}
-
-BOOST_AUTO_TEST_SUITE_END() // TestDiscoverVersionIterative
-BOOST_AUTO_TEST_SUITE_END() // Chunks
-
-} // namespace tests
-} // namespace chunks
-} // namespace ndn
diff --git a/tools/chunks/README.md b/tools/chunks/README.md
index 2bdd8ff..0c76fe8 100644
--- a/tools/chunks/README.md
+++ b/tools/chunks/README.md
@@ -17,13 +17,15 @@
specified prefix and version number. A version component must be present at the
end of the user-specified NDN name.
-* `iterative`: sends a series of interests with ChildSelector set to prefer the
- rightmost child and Exclude selectors, attempting to find a data packet with the
- specified prefix and the latest (the largest in the NDN canonical ordering)
- version number. The version is declared "latest" after a predefined number of
- data retrieval timeouts (default: 1).
+* `realtime` : sends discovery interests to fetch metadata of the solicited content from which
+ the data version will be resolved.
+ The version number of the solicited content is included in the name of returned
+ metadata data packet.
+ For more information about the packet format and naming convention of interest and
+ data packets for realtime version discovery, please refer to:
+[Realtime Data Retrieval (RDR) protocol wiki page](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR)
-The default discovery method is `iterative`.
+The default discovery method is `realtime`.
## Interest pipeline types in ndncatchunks
@@ -70,9 +72,9 @@
To retrieve the latest version of a published file, the following command can be used:
- ndncatchunks -d iterative ndn:/localhost/demo/gpl3
+ ndncatchunks ndn:/localhost/demo/gpl3
-This command will use the iterative method to discover the latest version of the file.
+This command will use the realtime method to discover the version number of the file.
To fetch a specific version of a published file, you can use the `fixed` version discovery method.
In this case the version needs to be supplied as part of the name. For example, if the version
diff --git a/tools/chunks/catchunks/discover-version-iterative.cpp b/tools/chunks/catchunks/discover-version-iterative.cpp
deleted file mode 100644
index adeb48e..0000000
--- a/tools/chunks/catchunks/discover-version-iterative.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2016-2019, Regents of the University of California,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University.
- *
- * This file is part of ndn-tools (Named Data Networking Essential Tools).
- * See AUTHORS.md for complete list of ndn-tools authors and contributors.
- *
- * ndn-tools is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * @author Wentao Shang
- * @author Steve DiBenedetto
- * @author Andrea Tosatto
- * @author Klaus Schneider
- */
-
-#include "discover-version-iterative.hpp"
-
-namespace ndn {
-namespace chunks {
-
-DiscoverVersionIterative::DiscoverVersionIterative(const Name& prefix, Face& face,
- const Options& options)
- : chunks::Options(options)
- , DiscoverVersion(prefix, face)
- , Options(options)
- , m_latestVersion(0)
- , m_foundVersion(false)
-{
-}
-
-void
-DiscoverVersionIterative::run()
-{
- m_latestVersion = 0;
- m_foundVersion = false;
-
- Interest interest(m_prefix);
- interest.setInterestLifetime(interestLifetime);
- interest.setMustBeFresh(mustBeFresh);
- interest.setMinSuffixComponents(3);
- interest.setMaxSuffixComponents(3);
- interest.setChildSelector(1);
-
- expressInterest(interest, maxRetriesOnTimeoutOrNack, maxRetriesOnTimeoutOrNack);
-}
-
-void
-DiscoverVersionIterative::handleData(const Interest& interest, const Data& data)
-{
- size_t versionindex = m_prefix.size();
-
- const Name& name = data.getName();
- Exclude exclude;
-
- if (isVerbose)
- std::cerr << "Data: " << data << std::endl;
-
- BOOST_ASSERT(name.size() > m_prefix.size());
- if (name[versionindex].isVersion()) {
- m_latestVersion = name[versionindex].toVersion();
- m_latestVersionData = make_shared<Data>(data);
- m_foundVersion = true;
-
- exclude.excludeBefore(name[versionindex]);
-
- if (isVerbose)
- std::cerr << "Discovered version = " << m_latestVersion << std::endl;
- }
- else {
- // didn't find a version number at expected index.
- m_strayExcludes.excludeOne(name[versionindex]);
- }
-
- for (const Exclude::Range& range : m_strayExcludes) {
- BOOST_ASSERT(range.isSingular());
- exclude.excludeOne(range.from);
- }
-
- Interest newInterest(interest);
- newInterest.refreshNonce();
- newInterest.setExclude(exclude);
- newInterest.setInterestLifetime(discoveryTimeout);
-
- if (m_foundVersion)
- expressInterest(newInterest, maxRetriesOnTimeoutOrNack, maxRetriesAfterVersionFound);
- else
- expressInterest(interest, maxRetriesOnTimeoutOrNack, maxRetriesOnTimeoutOrNack);
-}
-
-void
-DiscoverVersionIterative::handleTimeout(const Interest& interest, const std::string& reason)
-{
- if (m_foundVersion) {
- // a version has been found and after a timeout error this version can be used as the latest.
- if (isVerbose)
- std::cerr << "Found data with the latest version: " << m_latestVersion << std::endl;
-
- // we discovered at least one version. assume what we have is the latest.
- this->emitSignal(onDiscoverySuccess, Name(interest.getName()).appendVersion(m_latestVersion));
- }
- else {
- DiscoverVersion::handleTimeout(interest, reason);
- }
-}
-
-void
-DiscoverVersionIterative::handleNack(const Interest& interest, const std::string& reason)
-{
- if (m_foundVersion) {
- // a version has been found and after a nack this version can be used as the latest.
- if (isVerbose)
- std::cerr << "Found data with the latest version: " << m_latestVersion << std::endl;
-
- // we discovered at least one version. assume what we have is the latest.
- this->emitSignal(onDiscoverySuccess, Name(interest.getName()).appendVersion(m_latestVersion));
- }
- else {
- DiscoverVersion::handleNack(interest, reason);
- }
-}
-
-} // namespace chunks
-} // namespace ndn
diff --git a/tools/chunks/catchunks/discover-version-iterative.hpp b/tools/chunks/catchunks/discover-version-iterative.hpp
deleted file mode 100644
index 8880a6d..0000000
--- a/tools/chunks/catchunks/discover-version-iterative.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2016-2019, Regents of the University of California,
- * Colorado State University,
- * University Pierre & Marie Curie, Sorbonne University.
- *
- * This file is part of ndn-tools (Named Data Networking Essential Tools).
- * See AUTHORS.md for complete list of ndn-tools authors and contributors.
- *
- * ndn-tools is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * ndn-tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * ndn-tools, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
- *
- * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
- *
- * @author Wentao Shang
- * @author Steve DiBenedetto
- * @author Andrea Tosatto
- * @author Klaus Schneider
- */
-
-#ifndef NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
-#define NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
-
-#include "discover-version.hpp"
-
-namespace ndn {
-namespace chunks {
-
-/**
- * @brief Options for discover version iterative DiscoverVersionIterative
- *
- * The canonical name to use is DiscoverVersionIterative::Options
- */
-class DiscoverVersionIterativeOptions : public virtual Options
-{
-public:
- explicit
- DiscoverVersionIterativeOptions(const Options& opts = Options())
- : Options(opts)
- {
- }
-
-public:
- int maxRetriesAfterVersionFound{0}; ///< how many times to retry after a discoveryTimeout
- time::milliseconds discoveryTimeout{300}; ///< timeout for version discovery
-};
-
-/**
- * @brief Service for discovering the latest Data version in the iterative way
- *
- * Identifies the latest retrievable version published under the specified namespace
- * (as specified by the Version marker).
- *
- * DiscoverVersionIterative declares the largest discovered version to be the latest after some
- * Interest timeouts (i.e. failed retrieval after exclusion and retransmission). The number of
- * timeouts are specified by the value of maxRetriesAfterVersionFound inside the iterative options.
- *
- * The received name component after version can be an invalid segment number, this component will
- * be excluded in the next interests. In the unlikely case that there are too many excluded
- * components such that the Interest cannot fit in ndn::MAX_NDN_PACKET_SIZE, the discovery
- * procedure will throw Face::Error.
- *
- * DiscoverVersionIterative's user is notified once after identifying the latest retrievable
- * version or on failure to find any version Data.
- */
-class DiscoverVersionIterative : public DiscoverVersion, protected DiscoverVersionIterativeOptions
-{
-public:
- typedef DiscoverVersionIterativeOptions Options;
-
-public:
- /**
- * @brief create a DiscoverVersionIterative service
- */
- DiscoverVersionIterative(const Name& prefix, Face& face, const Options& options);
-
- /**
- * @brief identify the latest Data version published.
- */
- void
- run() final;
-
-private:
- void
- handleData(const Interest& interest, const Data& data) final;
-
- void
- handleTimeout(const Interest& interest, const std::string& reason) final;
-
- void
- handleNack(const Interest& interest, const std::string& reason) final;
-
-private:
- uint64_t m_latestVersion;
- shared_ptr<const Data> m_latestVersionData;
- Exclude m_strayExcludes;
- bool m_foundVersion;
-};
-
-} // namespace chunks
-} // namespace ndn
-
-#endif // NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
diff --git a/tools/chunks/catchunks/ndncatchunks.cpp b/tools/chunks/catchunks/ndncatchunks.cpp
index 2224f48..92d5401 100644
--- a/tools/chunks/catchunks/ndncatchunks.cpp
+++ b/tools/chunks/catchunks/ndncatchunks.cpp
@@ -33,7 +33,6 @@
#include "aimd-rtt-estimator.hpp"
#include "consumer.hpp"
#include "discover-version-fixed.hpp"
-#include "discover-version-iterative.hpp"
#include "discover-version-realtime.hpp"
#include "pipeline-interests-aimd.hpp"
#include "pipeline-interests-fixed-window.hpp"
@@ -51,11 +50,10 @@
{
std::string programName(argv[0]);
Options options;
- std::string discoverType("iterative");
+ std::string discoverType("realtime");
std::string pipelineType("aimd");
size_t maxPipelineSize(1);
- int maxRetriesAfterVersionFound(0);
- int64_t discoveryTimeoutMs(300);
+ int64_t discoveryTimeoutMs(DEFAULT_INTEREST_LIFETIME.count());
std::string uri;
// congestion control parameters, CWA refers to conservative window adaptation,
@@ -71,7 +69,7 @@
basicDesc.add_options()
("help,h", "print this help message and exit")
("discover-version,d", po::value<std::string>(&discoverType)->default_value(discoverType),
- "version discovery algorithm to use; valid values are: 'fixed', 'iterative', 'realtime'")
+ "version discovery algorithm to use; valid values are: 'fixed', 'realtime'")
("pipeline-type,p", po::value<std::string>(&pipelineType)->default_value(pipelineType),
"type of Interest pipeline to use; valid values are: 'fixed', 'aimd'")
("fresh,f", po::bool_switch(&options.mustBeFresh), "only return fresh content")
@@ -84,14 +82,10 @@
("version,V", "print program version and exit")
;
- po::options_description iterDiscoveryDesc("Iterative version discovery options");
- iterDiscoveryDesc.add_options()
- ("retries-iterative,i", po::value<int>(&maxRetriesAfterVersionFound)->default_value(maxRetriesAfterVersionFound),
- "number of timeouts that have to occur in order to confirm a discovered Data "
- "version as the latest one")
+ po::options_description realDiscoveryDesc("Realtime version discovery options");
+ realDiscoveryDesc.add_options()
("discovery-timeout,t", po::value<int64_t>(&discoveryTimeoutMs)->default_value(discoveryTimeoutMs),
- "discovery timeout (in milliseconds)")
- ;
+ "discovery timeout (in milliseconds)");
po::options_description fixedPipeDesc("Fixed pipeline options");
fixedPipeDesc.add_options()
@@ -136,7 +130,7 @@
;
po::options_description visibleDesc;
- visibleDesc.add(basicDesc).add(iterDiscoveryDesc).add(fixedPipeDesc).add(aimdPipeDesc);
+ visibleDesc.add(basicDesc).add(realDiscoveryDesc).add(fixedPipeDesc).add(aimdPipeDesc);
po::options_description hiddenDesc;
hiddenDesc.add_options()
@@ -196,11 +190,6 @@
return 2;
}
- if (maxRetriesAfterVersionFound < 0 || maxRetriesAfterVersionFound > 1024) {
- std::cerr << "ERROR: retries iterative value must be between 0 and 1024" << std::endl;
- return 2;
- }
-
if (discoveryTimeoutMs < 0) {
std::cerr << "ERROR: timeout cannot be negative" << std::endl;
return 2;
@@ -224,14 +213,9 @@
if (discoverType == "fixed") {
discover = make_unique<DiscoverVersionFixed>(prefix, face, options);
}
- else if (discoverType == "iterative") {
- DiscoverVersionIterative::Options optionsIterative(options);
- optionsIterative.maxRetriesAfterVersionFound = maxRetriesAfterVersionFound;
- optionsIterative.discoveryTimeout = time::milliseconds(discoveryTimeoutMs);
- discover = make_unique<DiscoverVersionIterative>(prefix, face, optionsIterative);
- }
else if (discoverType == "realtime") {
DiscoverVersionRealtime::Options optionsRealtime(options);
+ optionsRealtime.discoveryTimeout = time::milliseconds(discoveryTimeoutMs);
discover = make_unique<DiscoverVersionRealtime>(prefix, face, optionsRealtime);
}
else {