• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java HiveAuthenticationProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider的典型用法代码示例。如果您正苦于以下问题:Java HiveAuthenticationProvider类的具体用法?Java HiveAuthenticationProvider怎么用?Java HiveAuthenticationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



HiveAuthenticationProvider类属于org.apache.hadoop.hive.ql.security包,在下文中一共展示了HiveAuthenticationProvider类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createHiveAuthorizer

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
@Override
public HiveAuthorizer createHiveAuthorizer(HiveMetastoreClientFactory metastoreClientFactory,
    HiveConf conf, HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx)
        throws HiveAuthzPluginException {
  HiveAuthzSessionContext sessionContext;
  try {
    this.authzConf = HiveAuthzBindingHook.loadAuthzConf(conf);
    sessionContext = applyTestSettings(ctx, conf);
    assertHiveCliAuthDisabled(conf, sessionContext);
  } catch (Exception e) {
    throw new HiveAuthzPluginException(e);
  }
  SentryHiveAccessController accessController =
      getAccessController(conf, authzConf, authenticator, sessionContext);
  SentryHiveAuthorizationValidator authzValidator =
      getAuthzValidator(conf, authzConf, authenticator);

  return new SentryHiveAuthorizer(accessController, authzValidator);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:20,代码来源:SentryAuthorizerFactory.java


示例2: getAccessController

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
/**
 * Get instance of SentryAccessController from configuration
 * Default return DefaultSentryAccessController
 *
 * @param conf
 * @param authzConf
 * @param hiveAuthzBinding
 * @param authenticator
 * @throws HiveAuthzPluginException
 */
public static SentryHiveAccessController getAccessController(HiveConf conf,
    HiveAuthzConf authzConf, HiveAuthenticationProvider authenticator,
    HiveAuthzSessionContext ctx) throws HiveAuthzPluginException {
  Class<? extends SentryHiveAccessController> clazz =
      conf.getClass(HIVE_SENTRY_ACCESS_CONTROLLER, DefaultSentryAccessController.class,
          SentryHiveAccessController.class);

  if (clazz == null) {
    // should not happen as default value is set
    throw new HiveAuthzPluginException("Configuration value " + HIVE_SENTRY_ACCESS_CONTROLLER
        + " is not set to valid SentryAccessController subclass");
  }

  try {
    return new DefaultSentryAccessController(conf, authzConf, authenticator, ctx);
  } catch (Exception e) {
    throw new HiveAuthzPluginException(e);
  }

}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:31,代码来源:SentryAuthorizerFactory.java


示例3: getAuthzValidator

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
/**
 * Get instance of SentryAuthorizationValidator from configuration
 * Default return DefaultSentryAuthorizationValidator
 *
 * @param conf
 * @param authzConf
 * @param authenticator
 * @throws HiveAuthzPluginException
 */
public static SentryHiveAuthorizationValidator getAuthzValidator(HiveConf conf,
    HiveAuthzConf authzConf, HiveAuthenticationProvider authenticator)
    throws HiveAuthzPluginException {
  Class<? extends SentryHiveAuthorizationValidator> clazz =
      conf.getClass(HIVE_SENTRY_AUTHORIZATION_CONTROLLER, DefaultSentryValidator.class,
          SentryHiveAuthorizationValidator.class);

  if (clazz == null) {
    // should not happen as default value is set
    throw new HiveAuthzPluginException("Configuration value "
        + HIVE_SENTRY_AUTHORIZATION_CONTROLLER
        + " is not set to valid SentryAuthorizationValidator subclass");
  }

  try {
    return new DefaultSentryValidator(conf, authzConf, authenticator);
  } catch (Exception e) {
    throw new HiveAuthzPluginException(e);
  }

}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:31,代码来源:SentryAuthorizerFactory.java


示例4: initilize

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
/**
 * initialize authenticator and hiveAuthzBinding.
 */
protected void initilize(HiveConf conf, HiveAuthzConf authzConf,
    HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws Exception {
  Preconditions.checkNotNull(conf, "HiveConf cannot be null");
  Preconditions.checkNotNull(authzConf, "HiveAuthzConf cannot be null");
  Preconditions.checkNotNull(authenticator, "Hive authenticator provider cannot be null");
  Preconditions.checkNotNull(ctx, "HiveAuthzSessionContext cannot be null");

  this.conf = conf;
  this.authzConf = authzConf;
  this.authenticator = authenticator;
  this.ctx = ctx;
  this.serverName =
      Preconditions.checkNotNull(authzConf.get(AuthzConfVars.AUTHZ_SERVER_NAME.getVar()),
          REQUIRED_AUTHZ_SERVER_NAME);
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:19,代码来源:DefaultSentryAccessController.java


示例5: RelaxedSQLStdHiveAccessController

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
public RelaxedSQLStdHiveAccessController(
    HiveMetastoreClientFactory metastoreClientFactory,
    HiveConf conf,
    HiveAuthenticationProvider authenticator,
    HiveAuthzSessionContext ctx) throws HiveAuthzPluginException {
  super(metastoreClientFactory, conf, authenticator, ctx);
}
 
开发者ID:HotelsDotCom,项目名称:beeju,代码行数:8,代码来源:RelaxedSQLStdHiveAccessController.java


示例6: createHiveAuthorizer

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
@Override
public HiveAuthorizer createHiveAuthorizer(
    HiveMetastoreClientFactory metastoreClientFactory,
    HiveConf conf,
    HiveAuthenticationProvider authenticator,
    HiveAuthzSessionContext ctx)
  throws HiveAuthzPluginException {
  RelaxedSQLStdHiveAccessControllerWrapper privilegeManager = new RelaxedSQLStdHiveAccessControllerWrapper(
      metastoreClientFactory, conf, authenticator, ctx);
  return new HiveAuthorizerImpl(privilegeManager,
      new SQLStdHiveAuthorizationValidator(metastoreClientFactory, conf, authenticator, privilegeManager, ctx));
}
 
开发者ID:HotelsDotCom,项目名称:beeju,代码行数:13,代码来源:RelaxedSQLStdHiveAuthorizerFactory.java


示例7: RelaxedSQLStdHiveAccessControllerWrapper

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
public RelaxedSQLStdHiveAccessControllerWrapper(
    HiveMetastoreClientFactory metastoreClientFactory,
    HiveConf conf,
    HiveAuthenticationProvider authenticator,
    HiveAuthzSessionContext ctx) throws HiveAuthzPluginException {
  super(metastoreClientFactory, conf, authenticator, ctx);
  overrideHiveAccessController(
      new RelaxedSQLStdHiveAccessController(metastoreClientFactory, conf, authenticator, ctx));
}
 
开发者ID:HotelsDotCom,项目名称:beeju,代码行数:10,代码来源:RelaxedSQLStdHiveAccessControllerWrapper.java


示例8: HiveAuthorizationHelper

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
public HiveAuthorizationHelper(final IMetaStoreClient mClient, final HiveConf hiveConf, final String user) {
  authzEnabled = hiveConf.getBoolVar(ConfVars.HIVE_AUTHORIZATION_ENABLED);
  if (!authzEnabled) {
    authorizerV2 = null;
    return;
  }

  try {
    final HiveConf hiveConfCopy = new HiveConf(hiveConf);
    hiveConfCopy.set("user.name", user);

    final HiveAuthenticationProvider authenticator = HiveUtils.getAuthenticator(hiveConfCopy,
        HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER);
    SessionState ss = new SessionState(hiveConfCopy, user);
    SessionState.start(ss);

    authenticator.setSessionState(ss);

    HiveAuthorizerFactory authorizerFactory =
        HiveUtils.getAuthorizerFactory(hiveConfCopy, HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER);

    HiveAuthzSessionContext.Builder authzContextBuilder = new HiveAuthzSessionContext.Builder();
    authzContextBuilder.setClientType(CLIENT_TYPE.HIVESERVER2); // Drill is emulating HS2 here

    authorizerV2 = authorizerFactory.createHiveAuthorizer(
        new HiveMetastoreClientFactory() {
          @Override
          public IMetaStoreClient getHiveMetastoreClient() throws HiveAuthzPluginException {
            return mClient;
          }
        },
        hiveConf, authenticator, authzContextBuilder.build());

    authorizerV2.applyAuthorizationConfigPolicy(hiveConfCopy);
  } catch (final HiveException e) {
    throw new DrillRuntimeException("Failed to initialize Hive authorization components: " + e.getMessage(), e);
  }

  logger.trace("Hive authorization enabled");
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:41,代码来源:HiveAuthorizationHelper.java


示例9: HiveAuthorizationHelper

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
public HiveAuthorizationHelper(final IMetaStoreClient mClient, final HiveConf hiveConf, final String user) {
  authzEnabled = hiveConf.getBoolVar(ConfVars.HIVE_AUTHORIZATION_ENABLED);
  if (!authzEnabled) {
    authorizerV2 = null;
    return;
  }

  try {
    final HiveConf hiveConfCopy = new HiveConf(hiveConf);
    hiveConfCopy.set("user.name", user);

    final HiveAuthenticationProvider authenticator = HiveUtils.getAuthenticator(hiveConfCopy,
        HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER);
    SessionState ss = new SessionState(hiveConfCopy, user);
    SessionState.start(ss);

    authenticator.setSessionState(ss);

    HiveAuthorizerFactory authorizerFactory =
        HiveUtils.getAuthorizerFactory(hiveConfCopy, HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER);

    HiveAuthzSessionContext.Builder authzContextBuilder = new HiveAuthzSessionContext.Builder();
    authzContextBuilder.setClientType(CLIENT_TYPE.HIVESERVER2); // Dremio is emulating HS2 here

    authorizerV2 = authorizerFactory.createHiveAuthorizer(
        new HiveMetastoreClientFactory() {
          @Override
          public IMetaStoreClient getHiveMetastoreClient() throws HiveAuthzPluginException {
            return mClient;
          }
        },
        hiveConf, authenticator, authzContextBuilder.build());

    authorizerV2.applyAuthorizationConfigPolicy(hiveConfCopy);
  } catch (final HiveException e) {
    throw new RuntimeException("Failed to initialize Hive authorization components: " + e.getMessage(), e);
  }

  logger.trace("Hive authorization enabled");
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:41,代码来源:HiveAuthorizationHelper.java


示例10: initilize

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
/**
 * initialize authenticator and hiveAuthzBinding.
 */
protected void initilize(HiveConf conf, HiveAuthzConf authzConf,
    HiveAuthenticationProvider authenticator) throws Exception {
  Preconditions.checkNotNull(conf, "HiveConf cannot be null");
  Preconditions.checkNotNull(authzConf, "HiveAuthzConf cannot be null");
  Preconditions.checkNotNull(authenticator, "Hive authenticator provider cannot be null");
  this.conf = conf;
  this.authzConf = authzConf;
  this.authenticator = authenticator;
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:13,代码来源:DefaultSentryValidator.java


示例11: createHiveAuthorizer

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
@Override
public HiveAuthorizer createHiveAuthorizer(
    HiveMetastoreClientFactory metastoreClientFactory, HiveConf conf,
    HiveAuthenticationProvider hiveAuthenticator,
    HiveAuthzSessionContext ctx) throws HiveAuthzPluginException {
  return new SentryHiveAuthorizerImpl(null, null);    }
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:7,代码来源:HiveAuthzBindingSessionHook.java


示例12: DefaultSentryAccessController

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
public DefaultSentryAccessController(HiveConf conf, HiveAuthzConf authzConf,
    HiveAuthenticationProvider authenticator, HiveAuthzSessionContext ctx) throws Exception {
  initilize(conf, authzConf, authenticator, ctx);
  this.hiveHook = HiveHook.HiveServer2;
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:6,代码来源:DefaultSentryAccessController.java


示例13: DefaultSentryValidator

import org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider; //导入依赖的package包/类
public DefaultSentryValidator(HiveConf conf, HiveAuthzConf authzConf,
    HiveAuthenticationProvider authenticator) throws Exception {
  initilize(conf, authzConf, authenticator);
  this.hiveHook = HiveHook.HiveServer2;
}
 
开发者ID:apache,项目名称:incubator-sentry,代码行数:6,代码来源:DefaultSentryValidator.java



注:本文中的org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ModelFunction类代码示例发布时间:2022-05-23
下一篇:
Java RecipesMapExtending类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap