Skip to content

Commit

Permalink
Project import generated by Copybara.
Browse files Browse the repository at this point in the history
FolderOrigin-RevId: /usr/local/google/home/gdennis/copybara/temp/folder-destination12425091601521030069/.
  • Loading branch information
GGN Engprod Team authored and greg-dennis committed May 24, 2023
1 parent e3e693d commit ca65713
Show file tree
Hide file tree
Showing 7 changed files with 44,091 additions and 44,062 deletions.
4 changes: 4 additions & 0 deletions binding/portgraph/combos.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func genNodeCombos(m map[*AbstractNode][]*ConcreteNode, absNode2Node2NumEdges ma
for _, w := range absNode2Node2NumEdges[keys[j]] {
jWeight += w
}
// If weight is the same, sort by Desc (alphabetically).
if iWeight == jWeight {
return keys[i].Desc < keys[j].Desc
}
return iWeight > jWeight
})
go func() {
Expand Down
15 changes: 15 additions & 0 deletions binding/portgraph/portgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ func (e *AbstractEdge) String() string {
return fmt.Sprintf("%q -> %q", e.Src.Desc, e.Dst.Desc)
}

// alphabeticallyFirstPort returns the port in the edge that comes first alphabetically.
// This is for sorting purposes only.
func (e *AbstractEdge) alphabeticallyFirstPort() *AbstractPort {
if e.Dst == nil {
return e.Src
}
if e.Src.Desc < e.Dst.Desc {
return e.Src
}
return e.Dst
}

// ConcreteEdge represents a link from an source ConcretePort to a destination ConcretePort.
type ConcreteEdge struct {
Src, Dst *ConcretePort
Expand Down Expand Up @@ -607,6 +619,9 @@ func (s *solver) assignEdges(abs2ConNode map[*AbstractNode]*ConcreteNode) map[*A
if ej.Dst != nil {
ejWeight += len(ej.Dst.Constraints)
}
if eiWeight == ejWeight {
return ei.alphabeticallyFirstPort().Desc < ej.alphabeticallyFirstPort().Desc
}
return eiWeight > ejWeight
})

Expand Down
32 changes: 12 additions & 20 deletions gnmi/oc/networkinstance/networkinstance-0.go
Original file line number Diff line number Diff line change
Expand Up @@ -17951,23 +17951,19 @@ func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeerPathAny) Sta
// Instantiating module: "openconfig-network-instance"
// Path from parent: "state/control-plane-vnis"
// Path from root: "/network-instances/network-instance/connection-points/connection-point/endpoints/endpoint/vxlan/endpoint-peers/endpoint-peer/state/control-plane-vnis"
func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer_ControlPlaneVnisPath) State() ygnmi.SingletonQuery[string] {
return ygnmi.NewLeafSingletonQuery[string](
func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer_ControlPlaneVnisPath) State() ygnmi.SingletonQuery[[]uint32] {
return ygnmi.NewLeafSingletonQuery[[]uint32](
"NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer",
true,
true,
false,
ygnmi.NewNodePath(
[]string{"state", "control-plane-vnis"},
nil,
n.parent,
),
func(gs ygot.ValidatedGoStruct) (string, bool) {
func(gs ygot.ValidatedGoStruct) ([]uint32, bool) {
ret := gs.(*oc.NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer).ControlPlaneVnis
if ret == nil {
var zero string
return zero, false
}
return *ret, true
return ret, !reflect.ValueOf(ret).IsZero()
},
func() ygot.ValidatedGoStruct {
return new(oc.NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer)
Expand All @@ -17988,23 +17984,19 @@ func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer_ControlPlan
// Instantiating module: "openconfig-network-instance"
// Path from parent: "state/control-plane-vnis"
// Path from root: "/network-instances/network-instance/connection-points/connection-point/endpoints/endpoint/vxlan/endpoint-peers/endpoint-peer/state/control-plane-vnis"
func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer_ControlPlaneVnisPathAny) State() ygnmi.WildcardQuery[string] {
return ygnmi.NewLeafWildcardQuery[string](
func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer_ControlPlaneVnisPathAny) State() ygnmi.WildcardQuery[[]uint32] {
return ygnmi.NewLeafWildcardQuery[[]uint32](
"NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer",
true,
true,
false,
ygnmi.NewNodePath(
[]string{"state", "control-plane-vnis"},
nil,
n.parent,
),
func(gs ygot.ValidatedGoStruct) (string, bool) {
func(gs ygot.ValidatedGoStruct) ([]uint32, bool) {
ret := gs.(*oc.NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer).ControlPlaneVnis
if ret == nil {
var zero string
return zero, false
}
return *ret, true
return ret, !reflect.ValueOf(ret).IsZero()
},
func() ygot.ValidatedGoStruct {
return new(oc.NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeer)
Expand Down Expand Up @@ -18439,7 +18431,7 @@ type NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeerPathAny struct {
*ygnmi.NodePath
}

// ControlPlaneVnis (leaf): The control-plane VNIs are all of the VNIs that are discovered by the
// ControlPlaneVnis (leaf-list): The control-plane VNIs are all of the VNIs that are discovered by the
// control-plane behind this peer VTEP
//
// Defining module: "openconfig-evpn"
Expand All @@ -18457,7 +18449,7 @@ func (n *NetworkInstance_ConnectionPoint_Endpoint_Vxlan_EndpointPeerPath) Contro
}
}

// ControlPlaneVnis (leaf): The control-plane VNIs are all of the VNIs that are discovered by the
// ControlPlaneVnis (leaf-list): The control-plane VNIs are all of the VNIs that are discovered by the
// control-plane behind this peer VTEP
//
// Defining module: "openconfig-evpn"
Expand Down
Loading

0 comments on commit ca65713

Please sign in to comment.