Project

General

Profile

Task #4482

Refactor LsaSegmentStorage

Added by Muktadir Chowdhury over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
01/31/2018
Due date:
% Done:

0%

Estimated time:

Description

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.

#1

Updated by Muktadir Chowdhury over 2 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.

Also available in: Atom PDF