Skip to content

Commit

Permalink
#4964 LACP status - Updated based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Jan 31, 2023
1 parent 4a2c83a commit ffeebda
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2017 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ public ConnectedDevicesTopology(LaunchEnvironment env) {
super(env, "connecteddevices-topology", ConnectedDevicesTopologyConfig.class);
}

/**
* Main method to run topology.
*/
public static void main(String[] args) {
try {
LaunchEnvironment env = new LaunchEnvironment(args);
(new ConnectedDevicesTopology(env)).setup();
} catch (Exception e) {
System.exit(handleLaunchException(e));
}
}

/**
* Creating topology.
*/
Expand Down Expand Up @@ -81,6 +69,7 @@ private void createRouterBolt(TopologyBuilder builder, PersistenceManager persis
RouterBolt routerBolt = new RouterBolt(persistenceManager, ZooKeeperSpout.SPOUT_ID);
declareBolt(builder, routerBolt, ROUTER_BOLT_ID)
.shuffleGrouping(CONNECTED_DEVICES_SPOUT_ID)
.shuffleGrouping(LACP_SPOUT_ID)
.allGrouping(ZooKeeperSpout.SPOUT_ID);
}

Expand Down Expand Up @@ -110,4 +99,16 @@ private void createZkBolt(TopologyBuilder builder) {
protected String getZkTopoName() {
return "connecteddevices";
}

/**
* Main method to run topology.
*/
public static void main(String[] args) {
try {
LaunchEnvironment env = new LaunchEnvironment(args);
(new ConnectedDevicesTopology(env)).setup();
} catch (Exception e) {
System.exit(handleLaunchException(e));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ public static String createMessageKey(ArpInfoData data) {
/**
* This key is needed to balance load on Packet Bolt. If you see that some packet bolts have high load, and
* some have low load, try to extend this key. Maximum extension is equal to
* <code>SwitchConnectedDeviceFrame.UNIQUE_INDEX_PROPERTY</code>
*/
public static String createMessageKey(LacpInfoData data) {
return String.format("%s_%s_arp", data.getSwitchId(), data.getLogicalPortNumber());
return String.format("%s_%s_lacp", data.getSwitchId(), data.getLogicalPortNumber());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public PortRepository createPortRepository() {

@Override
public LacpPartnerRepository createLacpPartnerRepository() {
throw new IllegalStateException("Repository not implemented on hibernate layer");
throw new IllegalStateException("The Repository is not implemented on hibernate layer");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -87,6 +87,11 @@ public Optional<LacpPartner> findBySwitchIdAndLogicalPortNumber(SwitchId switchI
.has(LacpPartnerFrame.SWITCH_ID_PROPERTY, SwitchIdConverter.INSTANCE.toGraphProperty(switchId))
.has(LacpPartnerFrame.LOGICAL_PORT_NUMBER_PROPERTY, logicalPortNumber))
.toListExplicit(LacpPartnerFrame.class);
if (lacpPartnerFrames.size() > 1) {
log.error(String.format("More then one LACP status fields for switch %s on port %s",
switchId, logicalPortNumber));
}

return lacpPartnerFrames.isEmpty() ? Optional.empty() : Optional.of(lacpPartnerFrames.get(0))
.map(LacpPartner::new);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2021 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,9 @@ private void validateSwitchProperties(SwitchId switchId, SwitchProperties update
if (!flowsWitchEnabledLldp.isEmpty()) {
throw new IllegalSwitchPropertiesException(
format("Illegal switch properties combination for switch %s. "
+ "Detect Connected Devices feature is turn on for following flows [%s]. "
+ "For correct work of this feature switch property 'multiTable' must be set to 'true' "
+ "Please disable detecting of connected devices via LLDP for each flow before set "
+ "Detect Connected Devices feature via LLDP is turned on for following flows [%s]."
+ "For correct work of this feature, switch property 'multiTable' must be set to 'true' "
+ "Please disable detecting of connected devices via LLDP for each flow before setting "
+ "'multiTable' property to 'false'",
switchId, String.join(", ", flowsWitchEnabledLldp)));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ public CompletableFuture<List<LagPortResponse>> getLagPorts(@PathVariable("switc
*
* @param switchId the switch
*/
@ApiOperation(value = "Read all LACP status on specific switch", response = LacpStatusResponse.class)
@ApiOperation(value = "Read all LACP status values/fields, on a specific switch",
response = LacpStatusResponse.class)
@GetMapping(value = "/{switch_id}/lacpstatus")
@ResponseStatus(HttpStatus.OK)
public CompletableFuture<List<LacpStatusResponse>> getLacpStatus(@PathVariable("switch_id") SwitchId switchId) {
Expand All @@ -235,7 +236,8 @@ public CompletableFuture<List<LacpStatusResponse>> getLacpStatus(@PathVariable("
* @param logicalPortNumber the switch
*
*/
@ApiOperation(value = "Read LACP status on specific port of the switch", response = LacpStatusResponse.class)
@ApiOperation(value = "Read LACP status values/fields, on a specific port of the switch",
response = LacpStatusResponse.class)
@GetMapping(value = "/{switch_id}/lacp/{logical_port_number}")
@ResponseStatus(HttpStatus.OK)
public CompletableFuture<LacpStatusResponse> getLacpStatus(@PathVariable("switch_id") SwitchId switchId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2022 Telstra Open Source
/* Copyright 2023 Telstra Open Source
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit ffeebda

Please sign in to comment.