Project

General

Profile

Actions

Feature #2314

closed

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

Added by Junxiao Shi almost 10 years ago. Updated almost 10 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 1 (0 open1 closed)

Blocks NFD - Feature #1999: Strategy for access routerClosedJunxiao Shi

Actions
Actions #1

Updated by Junxiao Shi almost 10 years ago

Actions #2

Updated by Junxiao Shi almost 10 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.

Actions #3

Updated by Junxiao Shi almost 10 years ago

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

Actions #4

Updated by Junxiao Shi almost 10 years ago

  • Status changed from New to In Progress
Actions #5

Updated by Junxiao Shi almost 10 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.

Actions #6

Updated by Junxiao Shi almost 10 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.

Actions #7

Updated by Junxiao Shi almost 10 years ago

  • % Done changed from 70 to 90

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

Actions #8

Updated by Junxiao Shi almost 10 years ago

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

Updated by Junxiao Shi almost 10 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF