Swapan Shridhar created AMBARI-23905:
----------------------------------------
Summary: Better handling of legacy stacks in
StackServiceDirectory.java while preparing "advisorClassName".
Key: AMBARI-23905
URL: https://issues.apache.org/jira/browse/AMBARI-23905
Project: Ambari
Issue Type: Task
Components: ambari-server
Reporter: Swapan Shridhar
Assignee: Swapan Shridhar
Fix For: 3.0.0
https://github.com/apache/ambari/pull/1296 added code where we give different
treatment while forming "advisorClassName" based on whether the stack is coming
out of 3.0 Mpacks or is the old supported stacks. The current fix has
shortcoming as there can be other stacks also like "IOP" and any other 3rd
party one.
{code}
1. List<String> legacyStackNames = new ArrayList<>(Arrays.asList("HDP",
"HDF")); // Old stacks.
2. String advisorClassName = "";
3. if (legacyStackNames.contains(stackName)) {
4. advisorClassName = stackName + versionString + serviceName +
"ServiceAdvisor";
5. } else {
6. // Mpack world and its corresponding Stacks, where we shouldn't have
7. // stackName + versionString prefixed.
8. advisorClassName = serviceName + "ServiceAdvisor";
9. }
10.
{code}
Thus, we should avoid hardcoding and should do better handling while figuring
old old stack and new stack (coming from Mpack).
CC [~jluniya]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)