[
https://issues.apache.org/jira/browse/AMBARI-23158?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wei-Chiu Chuang updated AMBARI-23158:
-------------------------------------
Fix Version/s: 3.1.0
(was: 3.0.0)
> Fix NPE in Host Components query.
> ---------------------------------
>
> Key: AMBARI-23158
> URL: https://issues.apache.org/jira/browse/AMBARI-23158
> Project: Ambari
> Issue Type: Bug
> Components: ambari-server
> Reporter: Swapan Shridhar
> Assignee: Swapan Shridhar
> Priority: Critical
> Labels: pull-request-available
> Fix For: 3.1.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> *serviceComponentHostRequest* may not get instantiated if
> *HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID* is null.
> {code:title=/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java}
> private ServiceComponentHostRequest getRequest(Map<String, Object>
> properties) {
> ServiceComponentHostRequest serviceComponentHostRequest = null;
> if (properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID) != null)
> {
> Long hostComponentId =
> properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID) instanceof
> String ?
> Long.parseLong((String)
> properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID)) :
> (Long)
> properties.get(HOST_COMPONENT_HOST_COMPONENT_ID_PROPERTY_ID);
> serviceComponentHostRequest = new ServiceComponentHostRequest(
> (String)
> properties.get(HOST_COMPONENT_CLUSTER_NAME_PROPERTY_ID),
> (String)
> properties.get(HOST_COMPONENT_SERVICE_GROUP_NAME_PROPERTY_ID),
> (String)
> properties.get(HOST_COMPONENT_SERVICE_NAME_PROPERTY_ID),
> hostComponentId,
> (String)
> properties.get(HOST_COMPONENT_COMPONENT_NAME_PROPERTY_ID),
> (String)
> properties.get(HOST_COMPONENT_COMPONENT_TYPE_PROPERTY_ID),
> (String) properties.get(HOST_COMPONENT_HOST_NAME_PROPERTY_ID),
> (String)
> properties.get(HOST_COMPONENT_DESIRED_STATE_PROPERTY_ID));
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]