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

Diverse flow create implementation #1932

Merged
merged 7 commits into from
Mar 1, 2019
Merged

Conversation

IlyaMoiseev
Copy link
Collaborator

@IlyaMoiseev IlyaMoiseev commented Jan 25, 2019

#1231 Create diverse flow support


This change is Reviewable

Copy link
Collaborator Author

@IlyaMoiseev IlyaMoiseev left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 27 files reviewed, 1 unresolved discussion (waiting on @nikitacherevko, @sergii-iakovenko, @surabujin, and @timofei-durakov)


services/src/northbound/src/main/java/org/openkilda/northbound/service/impl/FlowServiceImpl.java, line 189 at r1 (raw file):

        logger.info("Create flow: {}", input);

        FlowCreateRequest payload = new FlowCreateRequest(new FlowDto(input), input.getDiverseFlowId());

This is messy solution.
We have new "diverseFlowId" property in FlowPayload, as an input for diverse feature enabling. But it isn't part of system Flow model.
To pass this property into system I choose adding them to FlowActionRequest instead mapping into FlowDto.
Yours opinions?

@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch 4 times, most recently from 60055c1 to 839e5b8 Compare January 29, 2019 11:39
@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch from 94a0517 to ce0613d Compare February 6, 2019 06:56
Copy link
Collaborator

@sergii-iakovenko sergii-iakovenko left a comment

Choose a reason for hiding this comment

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

Reviewed 21 of 27 files at r1, 1 of 1 files at r2, 1 of 1 files at r3, 9 of 9 files at r4.
Reviewable status: 25 of 32 files reviewed, 3 unresolved discussions (waiting on @IlyaMoiseev, @nikitacherevko, @nikitamarchenko, @sergii-iakovenko, @surabujin, and @timofei-durakov)


services/src/kilda-core/kilda-persistence-neo4j/src/main/java/org/openkilda/persistence/repositories/impl/Neo4jFlowRepository.java, line 183 at r4 (raw file):

    @Override
    public Optional<String> getOrCreateFlowGroupId(String flowId) {
        return findFlowPairById(flowId)

It makes sense to wrap find and create operations in a transaction here.


services/src/messaging/src/main/java/org/openkilda/messaging/payload/flow/FlowPayload.java, line 95 at r4 (raw file):

                       @JsonProperty("description") String description,
                       @JsonProperty("last-updated") String lastUpdated,
                       @JsonProperty("diverse-flowid") String diverseFlowId,

FlowPayload is used as the response payload for GET, PUT and POST operations. So why do we need to return the diverse-flowid flag there?


services/src/northbound/src/main/java/org/openkilda/northbound/service/impl/FlowServiceImpl.java, line 189 at r1 (raw file):

Previously, IlyaMoiseev (Ilya Moiseev) wrote…

This is messy solution.
We have new "diverseFlowId" property in FlowPayload, as an input for diverse feature enabling. But it isn't part of system Flow model.
To pass this property into system I choose adding them to FlowActionRequest instead mapping into FlowDto.
Yours opinions?

Agree, FlowDto must not contain operation details. I think the solution would look better if you created custom payloads (CreateFlowPayload, Update..., etc) by inheriting FlowPayload.

Copy link
Collaborator

@sergii-iakovenko sergii-iakovenko left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r5.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @IlyaMoiseev, @nikitacherevko, @nikitamarchenko, @surabujin, and @timofei-durakov)

@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch 2 times, most recently from 10f6039 to 7a74af8 Compare February 11, 2019 08:57
Copy link
Collaborator Author

@IlyaMoiseev IlyaMoiseev left a comment

Choose a reason for hiding this comment

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

Reviewable status: 27 of 35 files reviewed, 3 unresolved discussions (waiting on @nikitacherevko, @nikitamarchenko, @sergii-iakovenko, @surabujin, and @timofei-durakov)


services/src/kilda-core/kilda-persistence-neo4j/src/main/java/org/openkilda/persistence/repositories/impl/Neo4jFlowRepository.java, line 183 at r4 (raw file):

Previously, sergii-iakovenko (Sergii Iakovenko) wrote…

It makes sense to wrap find and create operations in a transaction here.

Ok, moved


services/src/messaging/src/main/java/org/openkilda/messaging/payload/flow/FlowPayload.java, line 95 at r4 (raw file):

Previously, sergii-iakovenko (Sergii Iakovenko) wrote…

FlowPayload is used as the response payload for GET, PUT and POST operations. So why do we need to return the diverse-flowid flag there?

Moved this field into subclasses


services/src/northbound/src/main/java/org/openkilda/northbound/service/impl/FlowServiceImpl.java, line 189 at r1 (raw file):

Previously, sergii-iakovenko (Sergii Iakovenko) wrote…

Agree, FlowDto must not contain operation details. I think the solution would look better if you created custom payloads (CreateFlowPayload, Update..., etc) by inheriting FlowPayload.

Reasonable, moved this field into payload subclasses

@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch 2 times, most recently from 2b3f2f5 to 7032b2a Compare February 20, 2019 12:53
Copy link
Collaborator

@timofei-durakov timofei-durakov left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 9 files at r6, 10 of 10 files at r7, 5 of 5 files at r8.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @nikitamarchenko, @sergii-iakovenko, and @surabujin)

@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch from 7032b2a to b2a8697 Compare February 27, 2019 10:25
Copy link
Collaborator

@Settis Settis left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r9.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @IlyaMoiseev, @nikitamarchenko, @sergii-iakovenko, and @surabujin)


services/src/kilda-pce/src/test/java/org/openkilda/pce/impl/InMemoryPathComputerTest.java, line 494 at r9 (raw file):

                .bandwidth(10)
                .srcSwitch(Switch.builder().switchId(new SwitchId("00:0A")).build())
                .destSwitch(Switch.builder().switchId(new SwitchId("00:0D")).build())

Is it make sense to use switchRepository.findById(new SwitchId("00:0D")).get() here?
The same with the line above.

Copy link
Collaborator

@nikitamarchenko nikitamarchenko left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @IlyaMoiseev, @nikitamarchenko, @sergii-iakovenko, and @surabujin)

@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch from b2a8697 to 2d18663 Compare February 28, 2019 06:12
@IlyaMoiseev IlyaMoiseev force-pushed the feat/diverse-flows-impl branch from 2d18663 to fe88bc6 Compare February 28, 2019 10:40
IlyaMoiseev and others added 5 commits February 28, 2019 15:09

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Add functional tests to verify flow diversity
Copy link
Collaborator

@nikitamarchenko nikitamarchenko left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 9 files at r6, 1 of 1 files at r10, 11 of 11 files at r11.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @IlyaMoiseev, @sergii-iakovenko, and @surabujin)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Return paths in flow group for diversity flow
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.

None yet

7 participants