Search in sources :

Example 46 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestPlainSaslHelper method testDoAsSetting.

/**
   * Test setting {@link HiveConf.ConfVars}} config parameter
   *   HIVE_SERVER2_ENABLE_DOAS for unsecure mode
   */
public void testDoAsSetting() {
    HiveConf hconf = new HiveConf();
    hconf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER, "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory");
    assertTrue("default value of hive server2 doAs should be true", hconf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS));
    CLIService cliService = new CLIService(null);
    cliService.init(hconf);
    ThriftCLIService tcliService = new ThriftBinaryCLIService(cliService, null);
    tcliService.init(hconf);
    TProcessorFactory procFactory = PlainSaslHelper.getPlainProcessorFactory(tcliService);
    assertEquals("doAs enabled processor for unsecure mode", procFactory.getProcessor(null).getClass(), TSetIpAddressProcessor.class);
}
Also used : ThriftBinaryCLIService(org.apache.hive.service.cli.thrift.ThriftBinaryCLIService) ThriftCLIService(org.apache.hive.service.cli.thrift.ThriftCLIService) HiveConf(org.apache.hadoop.hive.conf.HiveConf) ThriftCLIService(org.apache.hive.service.cli.thrift.ThriftCLIService) CLIService(org.apache.hive.service.cli.CLIService) ThriftBinaryCLIService(org.apache.hive.service.cli.thrift.ThriftBinaryCLIService) TProcessorFactory(org.apache.thrift.TProcessorFactory)

Example 47 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestChainFilter method setup.

@Before
public void setup() {
    conf = new HiveConf();
    factory = new ChainFilterFactory(factory1, factory2, factory3);
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Before(org.junit.Before)

Example 48 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestCustomQueryFilter method setup.

@Before
public void setup() {
    conf = new HiveConf();
    conf.set("hive.root.logger", "DEBUG,console");
    factory = new CustomQueryFilterFactory();
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Before(org.junit.Before)

Example 49 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestGroupFilter method setup.

@Before
public void setup() {
    conf = new HiveConf();
    conf.set("hive.root.logger", "DEBUG,console");
    factory = new GroupFilterFactory();
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Before(org.junit.Before)

Example 50 with HiveConf

use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.

the class TestLdapUtils method testCreateCandidatePrincipalsForUserDn.

@Test
public void testCreateCandidatePrincipalsForUserDn() {
    HiveConf conf = new HiveConf();
    String userDn = "cn=user1,ou=CORP,dc=mycompany,dc=com";
    List<String> expected = Arrays.asList(userDn);
    List<String> actual = LdapUtils.createCandidatePrincipals(conf, userDn);
    assertEquals(expected, actual);
}
Also used : HiveConf(org.apache.hadoop.hive.conf.HiveConf) Test(org.junit.Test)

Aggregations

HiveConf (org.apache.hadoop.hive.conf.HiveConf)404 BeforeClass (org.junit.BeforeClass)73 Test (org.junit.Test)66 Path (org.apache.hadoop.fs.Path)54 Before (org.junit.Before)50 Driver (org.apache.hadoop.hive.ql.Driver)46 CliSessionState (org.apache.hadoop.hive.cli.CliSessionState)44 IOException (java.io.IOException)39 ArrayList (java.util.ArrayList)37 File (java.io.File)31 HashMap (java.util.HashMap)26 FileSystem (org.apache.hadoop.fs.FileSystem)26 SessionState (org.apache.hadoop.hive.ql.session.SessionState)22 LinkedHashMap (java.util.LinkedHashMap)17 List (java.util.List)16 HiveException (org.apache.hadoop.hive.ql.metadata.HiveException)15 MiniHS2 (org.apache.hive.jdbc.miniHS2.MiniHS2)14 Map (java.util.Map)12 HiveMetaStoreClient (org.apache.hadoop.hive.metastore.HiveMetaStoreClient)12 MetaException (org.apache.hadoop.hive.metastore.api.MetaException)12