Task #4482

Refactor LsaSegmentStorage

Added by Muktadir Chowdhury almost 3 years ago. Updated 7 months ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


The way LsaSegmentStorage has been implemented is inefficient for deleting LSA segments that belongs to the same Data packet. Currently each LSA segments is a separate element in a std::unorederd_map where segment name is the key. So if we need to delete LSA segments of a same LSA Data, then we need to walkthrough the map to find those segments one by one which is in O(n).

Instead we can do the following:
(1) Have a class called LsaData, which has member variable Seq No and a list of lsa segments, .e.g std::vectorndn::Data
(2) Have another class called LsaSegmentStorage, which have a hashmap of LsaData indexed by LsaKeyName (///), e.g. std:unordered_map
Each element in the container represents a list of segments that belongs to the same LSA Data.


Updated by Muktadir Chowdhury almost 3 years ago

Davide suggested to explore the possibility of using InMemoryStorage from ndn-cxx.
Alex replied it is possible but we need to write a custom policy for removing an element from the InMemoryStorage.


Updated by Ashlesh Gawande 7 months ago

  • Status changed from New to Closed
  • Start date deleted (01/31/2018)

Completed in #4788.

Also available in: Atom PDF