Project

General

Profile

Feature #2314

Measurements::findLongestPrefixMatch(pit::Entry) and MeasurementsAccessor::findLongestPrefixMatch

Added by Junxiao Shi almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tables
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
1.50 h

Description

Implement:

  • Measurements::findLongestPrefixMatch(const pit::Entry&)
  • MeasurementsAccessor::findLongestPrefixMatch(const Name&)
  • MeasurementsAccessor::findLongestPrefixMatch(const pit::Entry&)

so that Strategy can perform longest prefix match lookup on Measurements table efficiently.


Related issues

Blocks NFD - Feature #1999: Strategy for access routerClosed

History

#1 Updated by Junxiao Shi almost 5 years ago

#2 Updated by Junxiao Shi almost 5 years ago

  • Subject changed from Measurements::findLongestPrefixMatch(pit::Entr) and MeasurementsAccessor::findLongestPrefixMatch to Measurements::findLongestPrefixMatch(pit::Entry) and MeasurementsAccessor::findLongestPrefixMatch
  • Estimated time changed from 2.00 h to 1.50 h

One related question: sometimes strategy needs to find a longest prefix match that satisfy certain condition, such as the existence of a certain type of StrategyInfo.

Which design is better?

  • add a predicate parameter to findLongestPrefixMatch functions
  • add findLongestPrefixMatch(const measurements::Entry&) overload; if the strategy thinks the initial match doesn't satisfy the requirement, it could call this overload to find a longest prefix match of the parent of passed Entry

The first design is cleaner, but it's hard to pass information from the predicate to the caller.

For example, if the predicate calls getStrategyInfo<T>, the caller (who calls findLongestPrefixMatch) will have to call getStrategyInfo<T> again.

#3 Updated by Junxiao Shi over 4 years ago

20150107 conference call decides to use the first design in note-2. Alex hopes the common expression will be optimized by compiler.

#4 Updated by Junxiao Shi over 4 years ago

  • Status changed from New to In Progress

#5 Updated by Junxiao Shi over 4 years ago

  • % Done changed from 0 to 50

http://gerrit.named-data.net/1600 accepts predicate in Measurements::findLongestPrefixMatch.

The next commit will expose findLongestPrefixMatch operation to MeasurementsAccessor.

#6 Updated by Junxiao Shi over 4 years ago

  • % Done changed from 50 to 70

http://gerrit.named-data.net/1606 adds findLongestPrefixMatch and findExactMatch to MeasurementsAccessor.

However, I realize that I forgot to add Measurements::findLongestPrefixMatch(pit::Entry), which shall come before this Change.

#7 Updated by Junxiao Shi over 4 years ago

  • % Done changed from 70 to 90

http://gerrit.named-data.net/1607 adds Measurements::findLongestPrefixMatch(pit::Entry).

#8 Updated by Junxiao Shi over 4 years ago

  • Status changed from In Progress to Code review
  • % Done changed from 90 to 100

#9 Updated by Junxiao Shi over 4 years ago

  • Status changed from Code review to Closed

Also available in: Atom PDF