Skip to content

Commit

Permalink
(30/N): Remove data field inside thrift::PrefixEntry
Browse files Browse the repository at this point in the history
Summary:
As titled. We no longer parse and use `data` field after `MetricVector` related code path has been removed.

Clean up.

Reviewed By: shih-hao-tseng

Differential Revision: D41807698

fbshipit-source-id: 65f0908c0d3a2c37cc02162e542e65b74fced55d
  • Loading branch information
Xiang Xu authored and facebook-github-bot committed Dec 7, 2022
1 parent 7ba8ff3 commit 35458df
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 34 deletions.
3 changes: 0 additions & 3 deletions openr/common/LsdbUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,6 @@ createPrefixEntry(
thrift::PrefixEntry prefixEntry;
prefixEntry.prefix() = prefix;
prefixEntry.type() = type;
if (not data.empty()) {
prefixEntry.data() = data;
}
prefixEntry.forwardingType() = forwardingType;
prefixEntry.forwardingAlgorithm() = forwardingAlgorithm;
prefixEntry.minNexthop().from_optional(minNexthop);
Expand Down
16 changes: 1 addition & 15 deletions openr/if/Types.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,14 @@ struct PrefixEntry {
*/
2: Network.PrefixType type (deprecated);

/**
* TODO: remove later when openr -> bgp route redistribution is gone
* Optional additional metadata. Encoding depends on PrefixType
*/
3: optional binary data (deprecated);

/**
* Default mode of forwarding for prefix is IP. If `forwardingType` is
* set to SR_MPLS, then packet will be encapsulated via IP -> MPLS route will
* be programmed at LERs and LSR (middle-hops) will perform label switching
* while preserving the label until packet reaches destination
*/
4: OpenrConfig.PrefixForwardingType forwardingType = OpenrConfig.PrefixForwardingType.IP;

/**
* Default forwarding (route computation) algorithm is shortest path ECMP.
* Open/R implements 2-shortest path edge disjoint algorithm for forwarding.
Expand Down Expand Up @@ -431,15 +426,6 @@ typedef map<string, AdjacencyDatabase> (
cpp.type = "std::unordered_map<std::string, openr::thrift::AdjacencyDatabase>",
) AdjDbs

/**
* @deprecated - Map of node name to adjacency database. This is deprecated
* in favor of `received-routes` and `advertised-routes` and should go away
* once area migration is complete.
*/
typedef map<string, PrefixDatabase> (
cpp.type = "std::unordered_map<std::string, openr::thrift::PrefixDatabase>",
) PrefixDbs

/**
* Represents complete route database that is or should be programmed in
* underlying platform.
Expand Down
5 changes: 0 additions & 5 deletions openr/py/openr/cli/tests/decision/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@
},
"route": {
"area_stack": [],
"data": null,
"forwardingAlgorithm": 0,
"forwardingType": 0,
"metrics": {
Expand Down Expand Up @@ -586,7 +585,6 @@
},
"route": {
"area_stack": [],
"data": null,
"forwardingAlgorithm": 0,
"forwardingType": 0,
"metrics": {
Expand Down Expand Up @@ -629,7 +627,6 @@
},
"route": {
"area_stack": [],
"data": null,
"forwardingAlgorithm": 0,
"forwardingType": 0,
"metrics": {
Expand Down Expand Up @@ -665,7 +662,6 @@
"prefixEntries": [
{
"area_stack": [],
"data": null,
"forwardingAlgorithm": 0,
"forwardingType": 0,
"metrics": {
Expand All @@ -685,7 +681,6 @@
},
{
"area_stack": [],
"data": null,
"forwardingAlgorithm": 0,
"forwardingType": 0,
"metrics": {
Expand Down
4 changes: 0 additions & 4 deletions openr/py/openr/cli/tests/prefixmgr/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
prefixLength=0,
),
type=PrefixType.BGP,
data=b"b''",
forwardingType=PrefixForwardingType.SR_MPLS,
forwardingAlgorithm=PrefixForwardingAlgorithm.SP_ECMP,
minNexthop=24,
Expand Down Expand Up @@ -69,7 +68,6 @@
prefixLength=0,
),
type=PrefixType.BGP,
data=b"b''",
forwardingType=PrefixForwardingType.SR_MPLS,
forwardingAlgorithm=PrefixForwardingAlgorithm.SP_ECMP,
minNexthop=24,
Expand Down Expand Up @@ -149,7 +147,6 @@
"64900",
"65301"
],
"data": "b''",
"forwardingAlgorithm": 0,
"forwardingType": 1,
"metrics": {
Expand Down Expand Up @@ -192,7 +189,6 @@
"64900",
"65301"
],
"data": "b''",
"forwardingAlgorithm": 0,
"forwardingType": 1,
"metrics": {
Expand Down
2 changes: 1 addition & 1 deletion openr/py/openr/cli/utils/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def iter_dbs(
parse prefix/adj databases
@param: container - container to store the generated data and returns
@param: dbs - decision_types.PrefixDbs or decision_types.AdjDbs
@param: dbs - decision_types.AdjDbs
@param: nodes - set: the set of nodes for parsing
@param: parse_func - function: the parsing function
"""
Expand Down
6 changes: 0 additions & 6 deletions openr/py/openr/cli/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ def _update(prefix_entry_dict, prefix_entry):
prefix_entry_dict.update(
{
"prefix": ipnetwork.sprint_prefix(prefix_entry.prefix),
"data": str(prefix_entry.data)
if prefix_entry.data is not None
else None,
"metrics": thrift_to_dict(prefix_entry.metrics),
"tags": list(prefix_entry.tags if prefix_entry.tags else []),
}
Expand All @@ -384,9 +381,6 @@ def _update(prefix_entry_dict, prefix_entry):
prefix_entry_dict.update(
{
"prefix": ipnetwork.sprint_prefix(prefix_entry.prefix),
"data": str(prefix_entry.data)
if prefix_entry.data is not None
else None,
"metrics": thrift_py_to_dict(prefix_entry.metrics),
"tags": list(prefix_entry.tags if prefix_entry.tags else []),
}
Expand Down

0 comments on commit 35458df

Please sign in to comment.