Index: metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java (revision 1422149) +++ metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java (working copy) @@ -23,12 +23,10 @@ import java.lang.reflect.Method; import java.net.Socket; import java.security.PrivilegedExceptionAction; -import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface; -import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Processor; import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.set_ugi_args; import org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.set_ugi_result; import org.apache.hadoop.hive.shims.HadoopShims; @@ -53,10 +51,11 @@ * Note that old clients will never call set_ugi() and thus ugi will never be received on server * side, in which case server exhibits previous behavior and continues as usual. */ +@SuppressWarnings("rawtypes") public class TUGIBasedProcessor extends TSetIpAddressProcessor { private final I iface; - private final Map>> + private final Map> functions; private final HadoopShims shim; @@ -66,11 +65,7 @@ InvocationTargetException { super(iface); this.iface = iface; - // TODO get rid of following reflection after THRIFT-1465 is fixed. - Method map = Processor.class.getDeclaredMethod("getProcessMap",Map.class); - map.setAccessible(true); - this.functions = (Map>>) - map.invoke(null, new HashMap>>()); + this.functions = getProcessMapView(); shim = ShimLoader.getHadoopShims(); } @@ -79,7 +74,7 @@ setIpAddress(in); final TMessage msg = in.readMessageBegin(); - final ProcessFunction> fn = functions.get(msg.name); + final ProcessFunction fn = functions.get(msg.name); if (fn == null) { TProtocolUtil.skip(in, TType.STRUCT); in.readMessageEnd(); @@ -138,7 +133,7 @@ } private void handleSetUGI(TUGIContainingTransport ugiTrans, - ProcessFunction> fn, TMessage msg, TProtocol iprot, TProtocol oprot) + ProcessFunction fn, TMessage msg, TProtocol iprot, TProtocol oprot) throws TException, SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException{