20 #ifndef PSYNC_FULL_PRODUCER_HPP
21 #define PSYNC_FULL_PRODUCER_HPP
28 #include <ndn-cxx/util/segment-fetcher.hpp>
61 ndn::KeyChain& keyChain,
62 size_t expectedNumEntries,
63 const ndn::Name& syncPrefix,
64 const ndn::Name& userPrefix,
85 publishName(
const ndn::Name& prefix, std::optional<uint64_t> seq = std::nullopt);
113 onSyncInterest(
const ndn::Name& prefixName,
const ndn::Interest& interest);
126 sendSyncData(
const ndn::Name& name,
const ndn::Block& block);
144 onSyncData(
const ndn::Interest& interest,
const ndn::ConstBufferPtr& bufferPtr);
155 satisfyPendingInterests();
161 deletePendingInterests(
const ndn::Name& interestName);
170 isFutureHash(
const ndn::Name& prefix,
const std::set<uint32_t>& negative);
172 #ifdef PSYNC_WITH_TESTS
174 size_t nIbfDecodeFailuresAboveThreshold = 0;
175 size_t nIbfDecodeFailuresBelowThreshold = 0;
179 struct PendingEntryInfo
182 ndn::scheduler::ScopedEventId expirationEvent;
185 std::map<ndn::Name, PendingEntryInfo> m_pendingEntries;
186 ndn::time::milliseconds m_syncInterestLifetime;
188 ndn::scheduler::ScopedEventId m_scheduledSyncInterestId;
189 std::uniform_int_distribution<> m_jitter{100, 500};
190 ndn::Name m_outstandingInterestName;
191 ndn::ScopedRegisteredPrefixHandle m_registeredPrefix;
192 std::shared_ptr<ndn::util::SegmentFetcher> m_fetcher;
193 uint64_t m_incomingFace = 0;
#define PSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE
Full sync logic to synchronize with other nodes where all nodes wants to get all names prefixes synce...
FullProducer(ndn::Face &face, ndn::KeyChain &keyChain, size_t expectedNumEntries, const ndn::Name &syncPrefix, const ndn::Name &userPrefix, UpdateCallback onUpdateCallBack, ndn::time::milliseconds syncInterestLifetime=SYNC_INTEREST_LIFETIME, ndn::time::milliseconds syncReplyFreshness=SYNC_REPLY_FRESHNESS, CompressionScheme ibltCompression=CompressionScheme::DEFAULT, CompressionScheme contentCompression=CompressionScheme::DEFAULT)
Constructor.
void publishName(const ndn::Name &prefix, std::optional< uint64_t > seq=std::nullopt)
Publish name to let others know.
Base class for PartialProducer and FullProducer.
Invertible Bloom Lookup Table (Invertible Bloom Filter)
constexpr ndn::time::milliseconds SYNC_INTEREST_LIFETIME
constexpr ndn::time::milliseconds SYNC_REPLY_FRESHNESS
std::function< void(const std::vector< MissingDataInfo > &)> UpdateCallback