Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4964 add information about lacp connection status for lag ports #5040

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

durgakako
Copy link
Collaborator

No description provided.

* @param logicalPortNumber the switch
*
*/
@ApiOperation(value = "Read all LACP status on specific switch", response = LacpStatusResponse.class)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like description should be Read LACP status on specific port of the switch
Also, as long as you don't allow ports list or range as an input, you should return LacpStatusResponse, not List

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.


@Override
@Property(LOGICAL_PORT_NUMBER_PROPERTY)
public abstract void setLogicalPortNumber(int logicalPortNumber);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me, that using primitives make this field effectively mandatory non-null. Is that so for all cases here that they always have some value? Or is it possible that some of the ints or booleans are not set (are null)?

assertTrue(lacpPartner.isPresent());

lacpPartner = lacpPartnerRepository.findBySwitchIdAndLogicalPortNumber(TEST_SWITCH_ID_2, LOGICAL_PORT_NUMBER_1);
assertTrue(lacpPartner.isPresent());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think isPresent is not enough. If the repo returns a random result for all the calls, this test passes, but that's not ok. Please add more specific assertions.

@@ -81,3 +81,6 @@ databaseChangeLog:
- include:
relativeToChangelogFile: true
file: 023-add-lacp-reply-into-lag-class.yaml
- include:
relativeToChangelogFile: true
file: 025-add-lacp-partner-class.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure when migration 024 will be merged so please change your migration name to 024

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to 024

@@ -0,0 +1,39 @@
/* Copyright 2017 Telstra Open Source
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2023

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

System.exit(handleLaunchException(e));
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you move main method from the end of the file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its formatted by IntelliJ, Updated.

@@ -80,6 +95,10 @@ private void createSpout(TopologyBuilder builder) {
declareKafkaSpout(builder, topologyConfig.getKafkaTopoConnectedDevicesTopic(), CONNECTED_DEVICES_SPOUT_ID);
}

private void createLacpSpout(TopologyBuilder builder) {
declareKafkaSpout(builder, topologyConfig.getKafkaLacpTopic(), LACP_SPOUT_ID);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to add LACP_SPOUT_ID into input of RouterBolt. It should be

    private void createRouterBolt(TopologyBuilder builder, PersistenceManager persistenceManager) {
        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);
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

* <code>SwitchConnectedDeviceFrame.UNIQUE_INDEX_PROPERTY</code>
*/
public static String createMessageKey(LacpInfoData data) {
return String.format("%s_%s_arp", data.getSwitchId(), data.getLogicalPortNumber());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your key has postfix arp but it should be lacp

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

/**
* 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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last sentence should be removed because Lacp DB frame has no UNIQUE_INDEX_PROPERTY

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add information about LACP connection status for LAG ports
5 participants