logic: remove some leftover code

Change-Id: I6e98ac216ce49f078e59c55efd856ce8e03d0b71
This commit is contained in:
Davide Pesavento committed 2020-01-23 23:10:24 -05:00
1 parent dd000762d6
commit 27416441b3
2 files changed
+13 -46

No files matched your search

+6 -10
View File
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2019 University of California, Los Angeles
* Copyright (c) 2012-2020 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -290,7 +290,6 @@ Logic::updateSeqNo(const SeqNo& seqNo, const Name& updatePrefix)
insertToDiffLog(commit, previousRoot);
satisfyPendingSyncInterests(prefix, commit);
// formAndSendExcludeInterest(prefix, *commit, previousRoot);
}
}
}
@@ -455,7 +454,7 @@ Logic::processSyncInterest(const Interest& interest, bool isTimedProcessing/*=fa
return;
}
DiffStateContainer::iterator stateIter = m_log.find(digest);
auto stateIter = m_log.find(digest);
// If the digest of incoming interest can be found from the log
if (stateIter != m_log.end()) {
_LOG_DEBUG_ID("It is ok, you are so close");
@@ -490,9 +489,7 @@ Logic::processResetInterest(const Interest& interest)
}
void
Logic::processSyncData(const Name& name,
ConstBufferPtr digest,
const Block& syncReplyBlock)
Logic::processSyncData(const Name& name, ConstBufferPtr digest, const Block& syncReply)
{
_LOG_DEBUG_ID(">> Logic::processSyncData");
DiffStatePtr commit = make_shared<DiffState>();
@@ -502,7 +499,7 @@ Logic::processSyncData(const Name& name,
m_interestTable.erase(digest); // Remove satisfied interest from PIT
State reply;
reply.wireDecode(syncReplyBlock);
reply.wireDecode(syncReply);
std::vector<MissingDataInfo> v;
BOOST_FOREACH(ConstLeafPtr leaf, reply.getLeaves().get<ordered>()) {
@@ -778,16 +775,15 @@ Logic::processRecoveryInterest(const Interest& interest)
Name name = interest.getName();
ConstBufferPtr digest = make_shared<ndn::Buffer>(name.get(-1).value(), name.get(-1).value_size());
ConstBufferPtr rootDigest = m_state.getRootDigest();
DiffStateContainer::iterator stateIter = m_log.find(digest);
auto stateIter = m_log.find(digest);
if (stateIter != m_log.end() || *digest == *EMPTY_DIGEST || *rootDigest == *digest) {
_LOG_DEBUG_ID("I can help you recover");
sendSyncData(m_defaultUserPrefix, name, m_state);
return;
}
_LOG_DEBUG_ID("<< Logic::processRecoveryInterest");
}
+7 -36
View File
@@ -1,6 +1,6 @@
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
/*
* Copyright (c) 2012-2019 University of California, Los Angeles
* Copyright (c) 2012-2020 University of California, Los Angeles
*
* This file is part of ChronoSync, synchronization library for distributed realtime
* applications for NDN.
@@ -365,24 +365,21 @@ private:
* This method extracts state update information from Sync Reply and applies
* it to the Sync Tree and re-express Sync Interest.
*
* @param name The data name of the Sync Reply.
* @param digest The digest in the data name.
* @param syncReplyBlock The content of the Sync Reply.
* @param name The data name of the Sync Reply.
* @param digest The digest in the data name.
* @param syncReply The content of the Sync Reply.
*/
void
processSyncData(const Name& name,
ConstBufferPtr digest,
const Block& syncReplyBlock);
processSyncData(const Name& name, ConstBufferPtr digest, const Block& syncReply);
/**
* @brief Insert state diff into log
*
* @param diff The diff .
* @param diff The diff.
* @param previousRoot The root digest before state changes.
*/
void
insertToDiffLog(DiffStatePtr diff,
ConstBufferPtr previousRoot);
insertToDiffLog(DiffStatePtr diff, ConstBufferPtr previousRoot);
/**
* @brief Reply to all pending Sync Interests with a particular commit (or diff)
@@ -457,32 +454,6 @@ private:
void
onRecoveryTimeout(const Interest& interest);
// /**
// * @brief Helper method to send Exclude Interest
// *
// * @param interest The interest whose exclude filter will be augmented
// * @param data The data whose implicit digest will be inserted into exclude filter
// */
// void
// sendExcludeInterest(const Interest& interest, const Data& data);
// /**
// * @brief Helper method to form the exclude Interest and calls sendExcludeInterest
// *
// * @param interest The interest whose exclude filter will be augmented
// * @param nodePrefix The prefix of the sender node
// * @param commit The commit whose contents will be used to obtain the implicit
// digest to be excluded
// * @param previousRoot The digest to be included in the interest
// */
// void
// formAndSendExcludeInterest(const Name& nodePrefix,
// const State& commit,
// ConstBufferPtr previousRoot);
void
cleanupPendingInterest(const ndn::PendingInterestId* pendingInterestId);
public:
static const ndn::Name DEFAULT_NAME;
static const ndn::Name EMPTY_NAME;