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

STORM-1129: Use topology name instead of id in UI calls. #854

Closed
wants to merge 1 commit into from

Conversation

priyank5485
Copy link
Contributor

Note that all-topologies-summary has been used to get topology id from a topology name. That involves a few calls to zookeeper which is not ideal. However, UI does not seem to take any significant performance hit. If needed we can handle it possibly using one of the options below. Since its a separate performance issue we can handle it in a separate JIRA.

  1. Have nimbus thrift server cache summary for topologies so it does not hit zookeeper every time we try to get topology id from name.
  2. Update nimbus thrift api with a method that takes options and use that to do only the minimal necessary interaction with zookeeper for a given option.

@jerrypeng
Copy link
Contributor

Topology names are not unique. Users can submit topologies with the same name, but the their auto generated topology ids will be unique. I am not sure this is the right way to go about this

@revans2
Copy link
Contributor

revans2 commented Nov 4, 2015

@jerrypeng they can submit topologies with the same name, but not at the same time. You can only have one "foo" topology running at any point in time.

@priyank5485
Copy link
Contributor Author

@jerrypeng We have a check and it throws the following exception.

Exception in thread "main" java.lang.RuntimeException: Topology with name wordcount already exists on cluster
at backtype.storm.StormSubmitter.submitTopologyAs(StormSubmitter.java:231)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:275)
at backtype.storm.StormSubmitter.submitTopologyWithProgressBar(StormSubmitter.java:311)
at backtype.storm.StormSubmitter.submitTopologyWithProgressBar(StormSubmitter.java:292)
at storm.starter.WordCountTopology.main(WordCountTopology.java:94)

@revans2 Thanks for chiming in.

@harshach
Copy link
Contributor

harshach commented Nov 4, 2015

@jerrypeng topology names are unique

@Parth-Brahmbhatt
Copy link
Contributor

+1.

@jerrypeng
Copy link
Contributor

thanks for the explanation and clarification everybody

@revans2
Copy link
Contributor

revans2 commented Nov 4, 2015

This is a non-backwards compatible change to the REST API and I really would prefer to maintain compatibility if at all possible. It seems fairly simple to make the REST API work with the name or the id. We call get-id-from-name all over the place, it seems fairly simple to check to see if there is a topology with that as the ID, if not check to see if there is a topology with it as the name.

(thrift/with-configured-nimbus-connection nimbus
(GET "/api/v1/topology/:name" [:as {:keys [cookies servlet-request scheme]} name & m]
(let [id (get-id-from-name name)]
(populate-context! servlet-request)
Copy link
Contributor

Choose a reason for hiding this comment

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

We have to populate the context before ever talking to nimbus. get-id-from-name talks to nimbus and could potentially authenticate with the wrong user to nimbus. This needs to be fixed everywhere.

@revans2
Copy link
Contributor

revans2 commented Nov 4, 2015

@priyank5485 for the most part this change looks good to me, but there are a few serious bugs/incompatibilities that need to be fixed before this can go in.

@Parth-Brahmbhatt
Copy link
Contributor

I agree with @revans2 , lets maintain backward compatibility.

@priyank5485
Copy link
Contributor Author

@revans2 @Parth-Brahmbhatt @jerrypeng @harshach Thanks all for the feedback. Other than the changes here there are some commits to apache/master after creation of this PR which added some more apis in UI using topology id making this PR unmergeable. I will sort all of that out and update the PR.

@revans2
Copy link
Contributor

revans2 commented Nov 5, 2015

@priyank5485 thanks for doing this. I think it is going to make the UI much more usable. Essentially giving us perma-links to a topology.

@wuchong
Copy link
Member

wuchong commented Nov 6, 2015

+1

In Alibaba, we implement our monitor system using topology name instead of id. And it is very useful , as users often resubmit topology several times , and they do not need to find the new topology page link.

But we should maintain backward compatibility. maybe we can deal with topology-id arg in function get-id-from-name

@harshach
Copy link
Contributor

@priyank5485 sorry for the delay. can you please upmerge this patch and open up another PR for 1.x-branch as well.

@priyank5485
Copy link
Contributor Author

@harshach @revans2 I have addressed the comments and raised a PR #1277 against the 1.x branch as I could not test my branch off of master due to another issue. Can you please review the PR against 1.x branch? I will port the same to master by updating this PR.

d2r pushed a commit to d2r/storm that referenced this pull request Oct 16, 2018
We are closing stale Pull Requests to make the list more manageable.

Please re-open any Pull Request that has been closed in error.

Closes apache#608
Closes apache#639
Closes apache#640
Closes apache#648
Closes apache#662
Closes apache#668
Closes apache#692
Closes apache#705
Closes apache#724
Closes apache#728
Closes apache#730
Closes apache#753
Closes apache#803
Closes apache#854
Closes apache#922
Closes apache#986
Closes apache#992
Closes apache#1019
Closes apache#1040
Closes apache#1041
Closes apache#1043
Closes apache#1046
Closes apache#1051
Closes apache#1078
Closes apache#1146
Closes apache#1164
Closes apache#1165
Closes apache#1178
Closes apache#1213
Closes apache#1225
Closes apache#1258
Closes apache#1259
Closes apache#1268
Closes apache#1272
Closes apache#1277
Closes apache#1278
Closes apache#1288
Closes apache#1296
Closes apache#1328
Closes apache#1342
Closes apache#1353
Closes apache#1370
Closes apache#1376
Closes apache#1391
Closes apache#1395
Closes apache#1399
Closes apache#1406
Closes apache#1410
Closes apache#1422
Closes apache#1427
Closes apache#1443
Closes apache#1462
Closes apache#1468
Closes apache#1483
Closes apache#1506
Closes apache#1509
Closes apache#1515
Closes apache#1520
Closes apache#1521
Closes apache#1525
Closes apache#1527
Closes apache#1544
Closes apache#1550
Closes apache#1566
Closes apache#1569
Closes apache#1570
Closes apache#1575
Closes apache#1580
Closes apache#1584
Closes apache#1591
Closes apache#1600
Closes apache#1611
Closes apache#1613
Closes apache#1639
Closes apache#1703
Closes apache#1711
Closes apache#1719
Closes apache#1737
Closes apache#1760
Closes apache#1767
Closes apache#1768
Closes apache#1785
Closes apache#1799
Closes apache#1822
Closes apache#1824
Closes apache#1844
Closes apache#1874
Closes apache#1918
Closes apache#1928
Closes apache#1937
Closes apache#1942
Closes apache#1951
Closes apache#1957
Closes apache#1963
Closes apache#1964
Closes apache#1965
Closes apache#1967
Closes apache#1968
Closes apache#1971
Closes apache#1985
Closes apache#1986
Closes apache#1998
Closes apache#2031
Closes apache#2032
Closes apache#2071
Closes apache#2076
Closes apache#2108
Closes apache#2119
Closes apache#2128
Closes apache#2142
Closes apache#2174
Closes apache#2206
Closes apache#2297
Closes apache#2322
Closes apache#2332
Closes apache#2341
Closes apache#2377
Closes apache#2414
Closes apache#2469
d2r pushed a commit to d2r/storm that referenced this pull request Oct 16, 2018
We are closing stale Pull Requests to make the list more manageable.

Please re-open any Pull Request that has been closed in error.

Closes apache#608
Closes apache#639
Closes apache#640
Closes apache#648
Closes apache#662
Closes apache#668
Closes apache#692
Closes apache#705
Closes apache#724
Closes apache#728
Closes apache#730
Closes apache#753
Closes apache#803
Closes apache#854
Closes apache#922
Closes apache#986
Closes apache#992
Closes apache#1019
Closes apache#1040
Closes apache#1041
Closes apache#1043
Closes apache#1046
Closes apache#1051
Closes apache#1078
Closes apache#1146
Closes apache#1164
Closes apache#1165
Closes apache#1178
Closes apache#1213
Closes apache#1225
Closes apache#1258
Closes apache#1259
Closes apache#1268
Closes apache#1272
Closes apache#1277
Closes apache#1278
Closes apache#1288
Closes apache#1296
Closes apache#1328
Closes apache#1342
Closes apache#1353
Closes apache#1370
Closes apache#1376
Closes apache#1391
Closes apache#1395
Closes apache#1399
Closes apache#1406
Closes apache#1410
Closes apache#1422
Closes apache#1427
Closes apache#1443
Closes apache#1462
Closes apache#1468
Closes apache#1483
Closes apache#1506
Closes apache#1509
Closes apache#1515
Closes apache#1520
Closes apache#1521
Closes apache#1525
Closes apache#1527
Closes apache#1544
Closes apache#1550
Closes apache#1566
Closes apache#1569
Closes apache#1570
Closes apache#1575
Closes apache#1580
Closes apache#1584
Closes apache#1591
Closes apache#1600
Closes apache#1611
Closes apache#1613
Closes apache#1639
Closes apache#1703
Closes apache#1711
Closes apache#1719
Closes apache#1737
Closes apache#1760
Closes apache#1767
Closes apache#1768
Closes apache#1785
Closes apache#1799
Closes apache#1822
Closes apache#1824
Closes apache#1844
Closes apache#1874
Closes apache#1918
Closes apache#1928
Closes apache#1937
Closes apache#1942
Closes apache#1951
Closes apache#1957
Closes apache#1963
Closes apache#1964
Closes apache#1965
Closes apache#1967
Closes apache#1968
Closes apache#1971
Closes apache#1985
Closes apache#1986
Closes apache#1998
Closes apache#2031
Closes apache#2032
Closes apache#2071
Closes apache#2076
Closes apache#2108
Closes apache#2119
Closes apache#2128
Closes apache#2142
Closes apache#2174
Closes apache#2206
Closes apache#2297
Closes apache#2322
Closes apache#2332
Closes apache#2341
Closes apache#2377
Closes apache#2414
Closes apache#2469
@asfgit asfgit closed this in #2880 Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants