[ 
https://issues.apache.org/jira/browse/RANGER-1794?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Colm O hEigeartaigh updated RANGER-1794:
----------------------------------------
    Fix Version/s: 1.0.0

> The warning information is incorrect in getRangerServiceByService of 
> ServiceMgr class
> -------------------------------------------------------------------------------------
>
>                 Key: RANGER-1794
>                 URL: https://issues.apache.org/jira/browse/RANGER-1794
>             Project: Ranger
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 1.0.0, master
>            Reporter: peng.jianhua
>            Assignee: peng.jianhua
>            Priority: Minor
>              Labels: patch
>             Fix For: 1.0.0
>
>         Attachments: 
> 0001-RANGER-1794-The-warning-information-is-incorrect-in-.patch
>
>
> {code}
> if(! StringUtils.isEmpty(serviceType)) {
>       RangerServiceDef serviceDef = svcStore == null ? null : 
> svcStore.getServiceDefByName(serviceType);
>       if(serviceDef != null) {
>               Class<RangerBaseService> cls = 
> getClassForServiceType(serviceDef);
>               if(cls != null) {
>                       ret = cls.newInstance();
>                       ret.init(serviceDef, service);
>                       if(ret instanceof RangerServiceTag) {
>                               ((RangerServiceTag)ret).setTagStore(tagStore);
>                       }
>               } else {
>                       LOG.warn("ServiceMgr.getRangerServiceByService(" + 
> service + "): could not find service class '" + serviceDef.getImplClass() + 
> "'");
>               }
>       } else {
>               LOG.warn("ServiceMgr.getRangerServiceByService(" + service + 
> "): could not find the service-type '" + serviceType + "'");
>       }
> } else {
>       LOG.warn("ServiceMgr.getRangerServiceByService(" + service + "): could 
> not find the service-type");
> }
> {code}
> The above code should be modified as following:
> {code}
> if(! StringUtils.isEmpty(serviceType)) {
>       RangerServiceDef serviceDef = svcStore == null ? null : 
> svcStore.getServiceDefByName(serviceType);
>       if(serviceDef != null) {
>               Class<RangerBaseService> cls = 
> getClassForServiceType(serviceDef);
>               if(cls != null) {
>                       ret = cls.newInstance();
>                       ret.init(serviceDef, service);
>                       if(ret instanceof RangerServiceTag) {
>                               ((RangerServiceTag)ret).setTagStore(tagStore);
>                       }
>               } else {
>                       LOG.warn("ServiceMgr.getRangerServiceByService(" + 
> service + "): could not find service class '" + serviceDef.getImplClass() + 
> "'");
>               }
>       } else {
>               LOG.warn("ServiceMgr.getRangerServiceByService(" + service + 
> "): could not find the service-def");
>       }
> } else {
>       LOG.warn("ServiceMgr.getRangerServiceByService(" + service + "): could 
> not find the service-type '" + serviceType + "'");
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to