{"action":"created","comment":{"url":"https://api.github.com/repos/telstra/open-kilda/pulls/comments/189574464","pull_request_review_id":121778445,"id":189574464,"diff_hunk":"@@ -483,25 +511,45 @@ private void handleIslEvent(Tuple tuple, IslInfoData discoveredIsl) {\n     //          - services/src/topology .. service/impl/IslServiceImpl .. service/IslService\n     //          - services/src/topology .. messaging/kafka/KafkaMessageConsumer\n     //          - services/src/pce .. NetworkCache .. FlowCache ..\n-    private void sendDiscoveryFailed(String switchId, String portId, Tuple tuple, String correlationId) throws IOException {\n+    private void sendDiscoveryFailed(String switchId, int portId, Tuple tuple, String correlationId)\n+            throws IOException {\n         String discoFail = OFEMessageUtils.createIslFail(switchId, portId, correlationId);\n-//        Values dataVal = new Values(PAYLOAD, discoFail, switchId, portId, OFEMessageUtils.LINK_DOWN);\n-//        collector.emit(topoEngTopic, tuple, dataVal);\n+        //        Values dataVal = new Values(PAYLOAD, discoFail, switchId, portId, OFEMessageUtils.LINK_DOWN);\n+        //        collector.emit(topoEngTopic, tuple, dataVal);\n         collector.emit(topoEngTopic, tuple, new Values(PAYLOAD, discoFail));\n         discovery.handleFailed(switchId, portId);\n         logger.warn(\"LINK: Send ISL discovery failure message={}\", discoFail);\n     }\n \n     private boolean isPortUpOrCached(String state) {\n-        return OFEMessageUtils.PORT_UP.equals(state) || OFEMessageUtils.PORT_ADD.equals(state) ||\n-                PortChangeType.CACHED.getType().equals(state);\n+        return OFEMessageUtils.PORT_UP.equals(state) || OFEMessageUtils.PORT_ADD.equals(state)\n+                || PortChangeType.CACHED.getType().equals(state);\n     }\n \n     private void enableDumpRequestTimer() {\n         long expireDelay = (int) (dumpRequestTimeout * 1000);\n         dumpRequestTimer = new Timer(expireDelay, expireDelay, TimeUnit.MILLISECONDS);\n     }\n \n+    private void handleMovedIsl(Tuple tuple, String srcSwitch, int srcPort, String dstSwitch, int dstPort) {\n+        NetworkEndpoint dstEndpoint = discovery.getLinkDestination(srcSwitch, srcPort);\n+        logger.info(\"Link is moved from {}_{} - {}_{} to endpoint {}_{}\", srcSwitch, srcPort,\n+                dstEndpoint.getSwitchDpId(), dstEndpoint.getPortId(), dstSwitch, dstPort);\n+\n+        PathNode srcNode = new PathNode(srcSwitch, srcPort, 0);\n+        PathNode dstNode = new PathNode(dstEndpoint.getSwitchDpId(), dstEndpoint.getPortId(), 1);\n+        IslInfoData infoData = new IslInfoData(Lists.newArrayList(srcNode, dstNode), IslChangeType.MOVED);\n+        InfoMessage message = new InfoMessage(infoData, System.currentTimeMillis(), UUID.randomUUID().toString());\n+        passToTopologyEngine(tuple, message);\n+\n+        // we should send reverse link as well to modify status in TE\n+        srcNode = new PathNode(dstEndpoint.getSwitchDpId(), dstEndpoint.getPortId(), 0);\n+        dstNode = new PathNode(srcSwitch, srcPort, 1);\n+        IslInfoData reverseLink = new IslInfoData(Lists.newArrayList(srcNode, dstNode), IslChangeType.MOVED);\n+        message = new InfoMessage(reverseLink, System.currentTimeMillis(), UUID.randomUUID().toString());","path":"services/wfm/src/main/java/org/openkilda/wfm/topology/event/OFELinkBolt.java","position":381,"original_position":381,"commit_id":"21d21026acc353f84c2d77ba3a248cffb31ac05d","original_commit_id":"54300f29ad711c9aeac1a179a41df2048be1f2d0","user":{"login":"sergii-iakovenko","id":7511304,"avatar_url":"https://avatars0.githubusercontent.com/u/7511304?v=4","gravatar_id":"","url":"https://api.github.com/users/sergii-iakovenko","html_url":"https://github.com/sergii-iakovenko","followers_url":"https://api.github.com/users/sergii-iakovenko/followers","following_url":"https://api.github.com/users/sergii-iakovenko/following{/other_user}","gists_url":"https://api.github.com/users/sergii-iakovenko/gists{/gist_id}","starred_url":"https://api.github.com/users/sergii-iakovenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergii-iakovenko/subscriptions","organizations_url":"https://api.github.com/users/sergii-iakovenko/orgs","repos_url":"https://api.github.com/users/sergii-iakovenko/repos","events_url":"https://api.github.com/users/sergii-iakovenko/events{/privacy}","received_events_url":"https://api.github.com/users/sergii-iakovenko/received_events","type":"User","site_admin":false},"body":"The recent code has correlationId as an argument in handleIslEvent, so you can/should reuse it.","created_at":"2018-05-21T12:27:33Z","updated_at":"2018-05-21T12:32:48Z","html_url":"https://github.com/telstra/open-kilda/pull/766#discussion_r189574464","pull_request_url":"https://api.github.com/repos/telstra/open-kilda/pulls/766","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/telstra/open-kilda/pulls/comments/189574464"},"html":{"href":"https://github.com/telstra/open-kilda/pull/766#discussion_r189574464"},"pull_request":{"href":"https://api.github.com/repos/telstra/open-kilda/pulls/766"}}},"pull_request":{"url":"https://api.github.com/repos/telstra/open-kilda/pulls/766","id":187502804,"html_url":"https://github.com/telstra/open-kilda/pull/766","diff_url":"https://github.com/telstra/open-kilda/pull/766.diff","patch_url":"https://github.com/telstra/open-kilda/pull/766.patch","issue_url":"https://api.github.com/repos/telstra/open-kilda/issues/766","number":766,"state":"open","locked":false,"title":"#720: Fixed issue with moving back an ISL","user":{"login":"nikitacherevko","id":6116378,"avatar_url":"https://avatars2.githubusercontent.com/u/6116378?v=4","gravatar_id":"","url":"https://api.github.com/users/nikitacherevko","html_url":"https://github.com/nikitacherevko","followers_url":"https://api.github.com/users/nikitacherevko/followers","following_url":"https://api.github.com/users/nikitacherevko/following{/other_user}","gists_url":"https://api.github.com/users/nikitacherevko/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitacherevko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitacherevko/subscriptions","organizations_url":"https://api.github.com/users/nikitacherevko/orgs","repos_url":"https://api.github.com/users/nikitacherevko/repos","events_url":"https://api.github.com/users/nikitacherevko/events{/privacy}","received_events_url":"https://api.github.com/users/nikitacherevko/received_events","type":"User","site_admin":false},"body":"Fixes issue with replugging/moving ISL from one switch/port to another.\r\n\r\nCloses #720 ","created_at":"2018-05-11T15:52:31Z","updated_at":"2018-05-21T12:32:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45d6153029f07bfa8d09720e67210d75c3ad00f1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":935983078,"url":"https://api.github.com/repos/telstra/open-kilda/labels/C/EVENT","name":"C/EVENT","color":"c6caff","default":false},{"id":935986392,"url":"https://api.github.com/repos/telstra/open-kilda/labels/C/TE","name":"C/TE","color":"c0d9f9","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/telstra/open-kilda/pulls/766/commits","review_comments_url":"https://api.github.com/repos/telstra/open-kilda/pulls/766/comments","review_comment_url":"https://api.github.com/repos/telstra/open-kilda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/telstra/open-kilda/issues/766/comments","statuses_url":"https://api.github.com/repos/telstra/open-kilda/statuses/21d21026acc353f84c2d77ba3a248cffb31ac05d","head":{"label":"telstra:issue/isl-moving-back","ref":"issue/isl-moving-back","sha":"21d21026acc353f84c2d77ba3a248cffb31ac05d","user":{"login":"telstra","id":3914896,"avatar_url":"https://avatars2.githubusercontent.com/u/3914896?v=4","gravatar_id":"","url":"https://api.github.com/users/telstra","html_url":"https://github.com/telstra","followers_url":"https://api.github.com/users/telstra/followers","following_url":"https://api.github.com/users/telstra/following{/other_user}","gists_url":"https://api.github.com/users/telstra/gists{/gist_id}","starred_url":"https://api.github.com/users/telstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telstra/subscriptions","organizations_url":"https://api.github.com/users/telstra/orgs","repos_url":"https://api.github.com/users/telstra/repos","events_url":"https://api.github.com/users/telstra/events{/privacy}","received_events_url":"https://api.github.com/users/telstra/received_events","type":"Organization","site_admin":false},"repo":{"id":104974693,"name":"open-kilda","full_name":"telstra/open-kilda","owner":{"login":"telstra","id":3914896,"avatar_url":"https://avatars2.githubusercontent.com/u/3914896?v=4","gravatar_id":"","url":"https://api.github.com/users/telstra","html_url":"https://github.com/telstra","followers_url":"https://api.github.com/users/telstra/followers","following_url":"https://api.github.com/users/telstra/following{/other_user}","gists_url":"https://api.github.com/users/telstra/gists{/gist_id}","starred_url":"https://api.github.com/users/telstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telstra/subscriptions","organizations_url":"https://api.github.com/users/telstra/orgs","repos_url":"https://api.github.com/users/telstra/repos","events_url":"https://api.github.com/users/telstra/events{/privacy}","received_events_url":"https://api.github.com/users/telstra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telstra/open-kilda","description":"OpenKilda is an open-source OpenFlow controller initially designed for use in a global network with high control-plane latency and a heavy emphasis on latency-centric data path optimisation.","fork":false,"url":"https://api.github.com/repos/telstra/open-kilda","forks_url":"https://api.github.com/repos/telstra/open-kilda/forks","keys_url":"https://api.github.com/repos/telstra/open-kilda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telstra/open-kilda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telstra/open-kilda/teams","hooks_url":"https://api.github.com/repos/telstra/open-kilda/hooks","issue_events_url":"https://api.github.com/repos/telstra/open-kilda/issues/events{/number}","events_url":"https://api.github.com/repos/telstra/open-kilda/events","assignees_url":"https://api.github.com/repos/telstra/open-kilda/assignees{/user}","branches_url":"https://api.github.com/repos/telstra/open-kilda/branches{/branch}","tags_url":"https://api.github.com/repos/telstra/open-kilda/tags","blobs_url":"https://api.github.com/repos/telstra/open-kilda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telstra/open-kilda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telstra/open-kilda/git/refs{/sha}","trees_url":"https://api.github.com/repos/telstra/open-kilda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telstra/open-kilda/statuses/{sha}","languages_url":"https://api.github.com/repos/telstra/open-kilda/languages","stargazers_url":"https://api.github.com/repos/telstra/open-kilda/stargazers","contributors_url":"https://api.github.com/repos/telstra/open-kilda/contributors","subscribers_url":"https://api.github.com/repos/telstra/open-kilda/subscribers","subscription_url":"https://api.github.com/repos/telstra/open-kilda/subscription","commits_url":"https://api.github.com/repos/telstra/open-kilda/commits{/sha}","git_commits_url":"https://api.github.com/repos/telstra/open-kilda/git/commits{/sha}","comments_url":"https://api.github.com/repos/telstra/open-kilda/comments{/number}","issue_comment_url":"https://api.github.com/repos/telstra/open-kilda/issues/comments{/number}","contents_url":"https://api.github.com/repos/telstra/open-kilda/contents/{+path}","compare_url":"https://api.github.com/repos/telstra/open-kilda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telstra/open-kilda/merges","archive_url":"https://api.github.com/repos/telstra/open-kilda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telstra/open-kilda/downloads","issues_url":"https://api.github.com/repos/telstra/open-kilda/issues{/number}","pulls_url":"https://api.github.com/repos/telstra/open-kilda/pulls{/number}","milestones_url":"https://api.github.com/repos/telstra/open-kilda/milestones{/number}","notifications_url":"https://api.github.com/repos/telstra/open-kilda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telstra/open-kilda/labels{/name}","releases_url":"https://api.github.com/repos/telstra/open-kilda/releases{/id}","deployments_url":"https://api.github.com/repos/telstra/open-kilda/deployments","created_at":"2017-09-27T05:13:18Z","updated_at":"2018-05-17T15:18:52Z","pushed_at":"2018-05-21T12:24:36Z","git_url":"git://github.com/telstra/open-kilda.git","ssh_url":"git@github.com:telstra/open-kilda.git","clone_url":"https://github.com/telstra/open-kilda.git","svn_url":"https://github.com/telstra/open-kilda","homepage":"","size":38738,"stargazers_count":24,"watchers_count":24,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":188,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":23,"open_issues":188,"watchers":24,"default_branch":"develop"}},"base":{"label":"telstra:develop","ref":"develop","sha":"176d76148014679516678888ba98702e4f0c1ef0","user":{"login":"telstra","id":3914896,"avatar_url":"https://avatars2.githubusercontent.com/u/3914896?v=4","gravatar_id":"","url":"https://api.github.com/users/telstra","html_url":"https://github.com/telstra","followers_url":"https://api.github.com/users/telstra/followers","following_url":"https://api.github.com/users/telstra/following{/other_user}","gists_url":"https://api.github.com/users/telstra/gists{/gist_id}","starred_url":"https://api.github.com/users/telstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telstra/subscriptions","organizations_url":"https://api.github.com/users/telstra/orgs","repos_url":"https://api.github.com/users/telstra/repos","events_url":"https://api.github.com/users/telstra/events{/privacy}","received_events_url":"https://api.github.com/users/telstra/received_events","type":"Organization","site_admin":false},"repo":{"id":104974693,"name":"open-kilda","full_name":"telstra/open-kilda","owner":{"login":"telstra","id":3914896,"avatar_url":"https://avatars2.githubusercontent.com/u/3914896?v=4","gravatar_id":"","url":"https://api.github.com/users/telstra","html_url":"https://github.com/telstra","followers_url":"https://api.github.com/users/telstra/followers","following_url":"https://api.github.com/users/telstra/following{/other_user}","gists_url":"https://api.github.com/users/telstra/gists{/gist_id}","starred_url":"https://api.github.com/users/telstra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/telstra/subscriptions","organizations_url":"https://api.github.com/users/telstra/orgs","repos_url":"https://api.github.com/users/telstra/repos","events_url":"https://api.github.com/users/telstra/events{/privacy}","received_events_url":"https://api.github.com/users/telstra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/telstra/open-kilda","description":"OpenKilda is an open-source OpenFlow controller initially designed for use in a global network with high control-plane latency and a heavy emphasis on latency-centric data path optimisation.","fork":false,"url":"https://api.github.com/repos/telstra/open-kilda","forks_url":"https://api.github.com/repos/telstra/open-kilda/forks","keys_url":"https://api.github.com/repos/telstra/open-kilda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/telstra/open-kilda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/telstra/open-kilda/teams","hooks_url":"https://api.github.com/repos/telstra/open-kilda/hooks","issue_events_url":"https://api.github.com/repos/telstra/open-kilda/issues/events{/number}","events_url":"https://api.github.com/repos/telstra/open-kilda/events","assignees_url":"https://api.github.com/repos/telstra/open-kilda/assignees{/user}","branches_url":"https://api.github.com/repos/telstra/open-kilda/branches{/branch}","tags_url":"https://api.github.com/repos/telstra/open-kilda/tags","blobs_url":"https://api.github.com/repos/telstra/open-kilda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/telstra/open-kilda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/telstra/open-kilda/git/refs{/sha}","trees_url":"https://api.github.com/repos/telstra/open-kilda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/telstra/open-kilda/statuses/{sha}","languages_url":"https://api.github.com/repos/telstra/open-kilda/languages","stargazers_url":"https://api.github.com/repos/telstra/open-kilda/stargazers","contributors_url":"https://api.github.com/repos/telstra/open-kilda/contributors","subscribers_url":"https://api.github.com/repos/telstra/open-kilda/subscribers","subscription_url":"https://api.github.com/repos/telstra/open-kilda/subscription","commits_url":"https://api.github.com/repos/telstra/open-kilda/commits{/sha}","git_commits_url":"https://api.github.com/repos/telstra/open-kilda/git/commits{/sha}","comments_url":"https://api.github.com/repos/telstra/open-kilda/comments{/number}","issue_comment_url":"https://api.github.com/repos/telstra/open-kilda/issues/comments{/number}","contents_url":"https://api.github.com/repos/telstra/open-kilda/contents/{+path}","compare_url":"https://api.github.com/repos/telstra/open-kilda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/telstra/open-kilda/merges","archive_url":"https://api.github.com/repos/telstra/open-kilda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/telstra/open-kilda/downloads","issues_url":"https://api.github.com/repos/telstra/open-kilda/issues{/number}","pulls_url":"https://api.github.com/repos/telstra/open-kilda/pulls{/number}","milestones_url":"https://api.github.com/repos/telstra/open-kilda/milestones{/number}","notifications_url":"https://api.github.com/repos/telstra/open-kilda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/telstra/open-kilda/labels{/name}","releases_url":"https://api.github.com/repos/telstra/open-kilda/releases{/id}","deployments_url":"https://api.github.com/repos/telstra/open-kilda/deployments","created_at":"2017-09-27T05:13:18Z","updated_at":"2018-05-17T15:18:52Z","pushed_at":"2018-05-21T12:24:36Z","git_url":"git://github.com/telstra/open-kilda.git","ssh_url":"git@github.com:telstra/open-kilda.git","clone_url":"https://github.com/telstra/open-kilda.git","svn_url":"https://github.com/telstra/open-kilda","homepage":"","size":38738,"stargazers_count":24,"watchers_count":24,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"archived":false,"open_issues_count":188,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":23,"open_issues":188,"watchers":24,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/telstra/open-kilda/pulls/766"},"html":{"href":"https://github.com/telstra/open-kilda/pull/766"},"issue":{"href":"https://api.github.com/repos/telstra/open-kilda/issues/766"},"comments":{"href":"https://api.github.com/repos/telstra/open-kilda/issues/766/comments"},"review_comments":{"href":"https://api.github.com/repos/telstra/open-kilda/pulls/766/comments"},"review_comment":{"href":"https://api.github.com/repos/telstra/open-kilda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/telstra/open-kilda/pulls/766/commits"},"statuses":{"href":"https://api.github.com/repos/telstra/open-kilda/statuses/21d21026acc353f84c2d77ba3a248cffb31ac05d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sergii-iakovenko"}}