Project

General

Profile

Actions

Task #4482

closed

Refactor LsaSegmentStorage

Added by Muktadir Chowdhury about 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
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.

Actions

Also available in: Atom PDF