repo: initialize storage (e.g., rebuild index)
Change-Id: Iba8d5db1ecfb67c085f7f6355726a41b3f48aafa
Refs: #1831
diff --git a/src/repo.cpp b/src/repo.cpp
index 346fa23..02c80da 100644
--- a/src/repo.cpp
+++ b/src/repo.cpp
@@ -128,6 +128,17 @@
}
void
+Repo::initializeStorage()
+{
+ // Rebuild storage if storage checkpoin exists
+ ndn::time::steady_clock::TimePoint start = ndn::time::steady_clock::now();
+ m_storageHandle.initialize();
+ ndn::time::steady_clock::TimePoint end = ndn::time::steady_clock::now();
+ ndn::time::milliseconds cost = ndn::time::duration_cast<ndn::time::milliseconds>(end - start);
+ std::cerr << "initialize storage cost: " << cost << "ms" << std::endl;
+}
+
+void
Repo::enableListening()
{
// Enable "listening" on Data prefixes