ranger-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm O hEigeartaigh <cohei...@apache.org>
Subject Re: Review Request 62430: The warning information is incorrect in getRangerServiceByService of ServiceMgr class
Date Wed, 20 Sep 2017 14:56:56 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62430/#review185796
-----------------------------------------------------------



I would change the first line to also include the serviceType. Something like "could not find
the service-def for the service-type '" + serviceType + "'"
Secondly, I don't understand the need for the second change, the ServiceType is empty here
so why do we need to log it?

- Colm O hEigeartaigh


On Sept. 20, 2017, 8:10 a.m., pengjianhua wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62430/
> -----------------------------------------------------------
> 
> (Updated Sept. 20, 2017, 8:10 a.m.)
> 
> 
> Review request for ranger, Alok Lal, Ankita Sinha, Don Bosco Durai, Colm O hEigeartaigh,
Gautam Borad, Madhan Neethiraj, Ramesh Mani, Selvamohan Neethiraj, Velmurugan Periasamy, and
Qiang Zhang.
> 
> 
> Bugs: RANGER-1794
>     https://issues.apache.org/jira/browse/RANGER-1794
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> 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");
> }
> The above code should be modified as following:
> 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 + "'");
> }
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceMgr.java 722a5662 
> 
> 
> Diff: https://reviews.apache.org/r/62430/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> pengjianhua
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message