ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colm O hEigeartaigh (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (RANGER-1794) The warning information is incorrect in getRangerServiceByService of ServiceMgr class
Date Mon, 25 Sep 2017 14:45:00 GMT

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

Colm O hEigeartaigh resolved RANGER-1794.
-----------------------------------------
    Resolution: Fixed

> 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)

Mime
View raw message