### Eclipse Workspace Patch 1.0 #P hive_trunk Index: shims/common-secure/src/main/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java =================================================================== --- shims/common-secure/src/main/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java (revision 1619663) +++ shims/common-secure/src/main/java/org/apache/hadoop/hive/thrift/HadoopThriftAuthBridge20S.java (working copy) @@ -122,8 +122,39 @@ @Override public Map getHadoopSaslProperties(Configuration conf) { // Initialize the SaslRpcServer to ensure QOP parameters are read from conf - SaslRpcServer.init(conf); - return SaslRpcServer.SASL_PROPS; + Class saslPropsResolverClass = null; + try { + saslPropsResolverClass = Class + .forName("org.apache.hadoop.security.SaslPropertiesResolver"); + if (LOG.isDebugEnabled()) { + LOG.debug("Has found SaslPropertiesResolver class"); + } + } catch (Exception e) { + if (LOG.isDebugEnabled()) { + LOG.debug("Could not find the SaslPropertiesResolver class", e); + } + } + + Map saslProperties = null; + if (saslPropsResolverClass != null) { + try { + Object saslPropsResolver = saslPropsResolverClass.getMethod( + "getInstance", Configuration.class).invoke(null, conf); + Method method = saslPropsResolver.getClass().getDeclaredMethod( + "getDefaultProperties"); + method.setAccessible(true); + saslProperties = (Map) method.invoke(saslPropsResolver); + if (LOG.isDebugEnabled()) { + LOG.debug("SASL QOP : "+ saslProperties.get(Sasl.QOP)); + } + } catch (Exception e) { + LOG.error("Could not get SASL properties", e); + } + } else { + SaslRpcServer.init(conf); + saslProperties = SaslRpcServer.SASL_PROPS; + } + return saslProperties; } public static class Client extends HadoopThriftAuthBridge.Client {