You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2014/04/17 17:28:22 UTC
svn commit: r1588286 - in /hive/trunk:
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java
Author: hashutosh
Date: Thu Apr 17 15:28:21 2014
New Revision: 1588286
URL: http://svn.apache.org/r1588286
Log:
HIVE-6903 : Change default value of hive.metastore.execute.setugi to true (Ashutosh Chauhan via Thejas Nair)
Modified:
hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java
Modified: hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
URL: http://svn.apache.org/viewvc/hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java?rev=1588286&r1=1588285&r2=1588286&view=diff
==============================================================================
--- hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java (original)
+++ hive/trunk/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java Thu Apr 17 15:28:21 2014
@@ -350,7 +350,7 @@ public class HiveConf extends Configurat
METASTORE_AUTHORIZATION_STORAGE_AUTH_CHECKS("hive.metastore.authorization.storage.checks", false),
METASTORE_EVENT_CLEAN_FREQ("hive.metastore.event.clean.freq",0L),
METASTORE_EVENT_EXPIRY_DURATION("hive.metastore.event.expiry.duration",0L),
- METASTORE_EXECUTE_SET_UGI("hive.metastore.execute.setugi", false),
+ METASTORE_EXECUTE_SET_UGI("hive.metastore.execute.setugi", true),
METASTORE_PARTITION_NAME_WHITELIST_PATTERN(
"hive.metastore.partition.name.whitelist.pattern", ""),
// Whether to enable integral JDO pushdown. For partition columns storing integers
Modified: hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java
URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java?rev=1588286&r1=1588285&r2=1588286&view=diff
==============================================================================
--- hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java (original)
+++ hive/trunk/metastore/src/java/org/apache/hadoop/hive/metastore/TUGIBasedProcessor.java Thu Apr 17 15:28:21 2014
@@ -20,7 +20,6 @@ package org.apache.hadoop.hive.metastore
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.net.Socket;
import java.security.PrivilegedExceptionAction;
import java.util.List;
@@ -59,7 +58,6 @@ public class TUGIBasedProcessor<I extend
functions;
private final HadoopShims shim;
- @SuppressWarnings("unchecked")
public TUGIBasedProcessor(I iface) throws SecurityException, NoSuchFieldException,
IllegalArgumentException, IllegalAccessException, NoSuchMethodException,
InvocationTargetException {
@@ -69,6 +67,7 @@ public class TUGIBasedProcessor<I extend
shim = ShimLoader.getHadoopShims();
}
+ @SuppressWarnings("unchecked")
@Override
public boolean process(final TProtocol in, final TProtocol out) throws TException {
setIpAddress(in);
@@ -90,7 +89,7 @@ public class TUGIBasedProcessor<I extend
// Store ugi in transport if the rpc is set_ugi
if (msg.name.equalsIgnoreCase("set_ugi")){
try {
- handleSetUGI(ugiTrans, fn, msg, in, out);
+ handleSetUGI(ugiTrans, (set_ugi<Iface>)fn, msg, in, out);
} catch (TException e) {
throw e;
} catch (Exception e) {
@@ -105,6 +104,7 @@ public class TUGIBasedProcessor<I extend
return true;
} else { // Found ugi, perform doAs().
PrivilegedExceptionAction<Void> pvea = new PrivilegedExceptionAction<Void>() {
+ @Override
public Void run() {
try {
fn.process(msg.seqid,in, out, iface);
@@ -133,7 +133,7 @@ public class TUGIBasedProcessor<I extend
}
private void handleSetUGI(TUGIContainingTransport ugiTrans,
- ProcessFunction<Iface, ? extends TBase> fn, TMessage msg, TProtocol iprot, TProtocol oprot)
+ set_ugi<Iface> fn, TMessage msg, TProtocol iprot, TProtocol oprot)
throws TException, SecurityException, NoSuchMethodException, IllegalArgumentException,
IllegalAccessException, InvocationTargetException{
@@ -143,10 +143,7 @@ public class TUGIBasedProcessor<I extend
"allowed. Current ugi is: " + clientUgi.getUserName()));
}
- // TODO get rid of following reflection after THRIFT-1465 is fixed.
- Method method = fn.getClass().getDeclaredMethod("getEmptyArgsInstance", new Class<?>[0]);
- method.setAccessible(true);
- set_ugi_args args = (set_ugi_args)method.invoke(fn, new Object[0]);
+ set_ugi_args args = fn.getEmptyArgsInstance();
try {
args.read(iprot);
} catch (TProtocolException e) {
@@ -160,10 +157,7 @@ public class TUGIBasedProcessor<I extend
return;
}
iprot.readMessageEnd();
- // TODO get rid of following reflection after THRIFT-1465 is fixed.
- method = fn.getClass().getDeclaredMethod("getResult", Iface.class, set_ugi_args.class);
- method.setAccessible(true);
- set_ugi_result result = (set_ugi_result)method.invoke(fn, iface,args);
+ set_ugi_result result = fn.getResult(iface, args);
List<String> principals = result.getSuccess();
// Store the ugi in transport and then continue as usual.
ugiTrans.setClientUGI(shim.createRemoteUser(principals.remove(principals.size()-1),