storage: Making use of SkipList-based index
Change-Id: I360af97ae794da383fe00aaad8ab3c417c5167d3
Refs: #1695, #1434
diff --git a/src/handles/write-handle.cpp b/src/handles/write-handle.cpp
index 07a5664..65098bf 100644
--- a/src/handles/write-handle.cpp
+++ b/src/handles/write-handle.cpp
@@ -26,8 +26,9 @@
static const ndn::time::milliseconds NOEND_TIMEOUT(10000);
static const ndn::time::milliseconds PROCESS_DELETE_TIME(10000);
-WriteHandle::WriteHandle(Face& face, StorageHandle& storageHandle, KeyChain& keyChain,
- Scheduler& scheduler, ValidatorConfig& validator)
+WriteHandle::WriteHandle(Face& face, RepoStorage& storageHandle, KeyChain& keyChain,
+ Scheduler& scheduler,// RepoStorage& storeindex,
+ ValidatorConfig& validator)
: BaseHandle(face, storageHandle, keyChain, scheduler)
, m_validator(validator)
, m_retryTime(RETRY_TIMEOUT)
@@ -51,12 +52,6 @@
bind(&WriteHandle::onValidationFailed, this, _1, _2));
}
-void
-WriteHandle::onRegisterSuccess(const Name& prefix)
-{
- std::cerr << "Successfully registered prefix " << prefix << std::endl;
-}
-
// onRegisterFailed.
void
WriteHandle::onRegisterFailed(const Name& prefix, const std::string& reason)
@@ -127,6 +122,8 @@
if (response.getInsertNum() == 0) {
getStorageHandle().insertData(*data);
+ // getStorageHandle().insertEntry(*data);
+ // getStoreIndex().insert(*data);
response.setInsertNum(1);
}
@@ -200,15 +197,15 @@
{
Name insertPrefix;
insertPrefix.append(prefix).append("insert");
- getFace().setInterestFilter(insertPrefix,
+ ndn::InterestFilter filter_insert(insertPrefix);
+ getFace().setInterestFilter(filter_insert,
bind(&WriteHandle::onInterest, this, _1, _2),
- bind(&WriteHandle::onRegisterSuccess, this, _1),
bind(&WriteHandle::onRegisterFailed, this, _1, _2));
Name insertCheckPrefix;
insertCheckPrefix.append(prefix).append("insert check");
- getFace().setInterestFilter(insertCheckPrefix,
+ ndn::InterestFilter filter_insertCheck(insertCheckPrefix);
+ getFace().setInterestFilter(filter_insertCheck,
bind(&WriteHandle::onCheckInterest, this, _1, _2),
- bind(&WriteHandle::onRegisterSuccess, this, _1),
bind(&WriteHandle::onRegisterFailed, this, _1, _2));
}