[ 
https://issues.apache.org/jira/browse/YARN-9281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16807527#comment-16807527
 ] 

Adam Antal commented on YARN-9281:
----------------------------------

Hi [~eyang],

I hope you don't mind that I took a look at the patch. I'm not much into js, so 
I focused on the java part. 
Overall looks great (I'm still learning the basics though, so forgive me).

This piece of code is replicated multiple times in 
{{AppCatalogSolrClient.java}}. I think it would be neat, if it was moved to a 
separate function (something like private void commitSolrChanges()).
{noformat}
// Commit Solr changes.
UpdateResponse detailsResponse = solr.add(docs);
if (detailsResponse.getStatus() != 0) {
   throw new IOException("Unable to register docker instance "
   + "with application entry.");
}
solr.commit();
{noformat}

I don't really understand the end of the 
{{TestAppCatalogSolrClient$testUpgradeApp}} testcase:
{noformat}
List<AppEntry> appEntries = spy.listAppEntries();
for (AppEntry entry : appEntries) {
   Service tmp = entry.getYarnfile();
   actual = tmp.getVersion();
}
assertEquals(expected, actual);
{noformat}
We iterate over the appEntries and only the check the last element. Is it 
intended? If yes, then use appEntries.get(appEntries.size() - 1), if no, then 
move the assert into the for cycle to check every element.

Also you can modify the interior of that cycle to 
{noformat}
String tmp = entry.getYarnfile().getVersion();
{noformat}
(and the Service import is not needed anymore in 
{{TestAppCatalogSolrClient.java}}).

> Add express upgrade button to Appcatalog UI
> -------------------------------------------
>
>                 Key: YARN-9281
>                 URL: https://issues.apache.org/jira/browse/YARN-9281
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Eric Yang
>            Assignee: Eric Yang
>            Priority: Major
>         Attachments: YARN-9281.001.patch, YARN-9281.002.patch, 
> YARN-9281.003.patch, YARN-9281.004.patch, YARN-9281.005.patch, 
> YARN-9281.006.patch
>
>
> It would be nice to have ability to upgrade applications deployed by 
> Application catalog from Application catalog UI.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to