use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class HCatTable method getConf.
HiveConf getConf() {
if (conf == null) {
LOG.warn("Conf hasn't been set yet. Using defaults.");
conf = new HiveConf();
}
return conf;
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestClientSideAuthorizationProvider method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
int port = MetaStoreUtils.findFreePort();
// Turn off metastore-side authorization
System.setProperty(HiveConf.ConfVars.METASTORE_PRE_EVENT_LISTENERS.varname, "");
MetaStoreUtils.startMetaStore(port, ShimLoader.getHadoopThriftAuthBridge());
clientHiveConf = new HiveConf(this.getClass());
// Turn on client-side authorization
clientHiveConf.setBoolVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
clientHiveConf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_MANAGER.varname, getAuthorizationProvider());
clientHiveConf.set(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER.varname, InjectableDummyAuthenticator.class.getName());
clientHiveConf.set(HiveConf.ConfVars.HIVE_AUTHORIZATION_TABLE_OWNER_GRANTS.varname, "");
clientHiveConf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict");
clientHiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + port);
clientHiveConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTCONNECTIONRETRIES, 3);
clientHiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
clientHiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, "");
clientHiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, "");
ugi = Utils.getUGI();
SessionState.start(new CliSessionState(clientHiveConf));
msc = new HiveMetaStoreClient(clientHiveConf);
driver = new Driver(clientHiveConf);
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestFolderPermissions method setup.
@BeforeClass
public static void setup() throws Exception {
conf = new HiveConf(TestFolderPermissions.class);
conf.setVar(HiveConf.ConfVars.HIVEMAPREDMODE, "nonstrict");
baseSetup();
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestServerSpecificConfig method testSystemPropertyPrecedence.
/**
* Ensure that system properties still get precedence. Config params set as
* -hiveconf on commandline get set as system properties They should have the
* final say
*/
@Test
public void testSystemPropertyPrecedence() {
// Using property defined in HiveConf.ConfVars to test System property
// overriding
final String OVERRIDE_KEY = "hive.conf.restricted.list";
try {
HiveConf.setHiveSiteLocation(oldDefaultHiveSite);
System.setProperty(OVERRIDE_KEY, "from.sysprop");
HiveConf conf = new HiveConf();
// ensure metatore site.xml does not get to override this
assertEquals("from.sysprop", conf.get(OVERRIDE_KEY));
// get HS2 site.xml loaded
new HiveServer2();
conf = new HiveConf();
assertTrue(HiveConf.isLoadHiveServer2Config());
// ensure hiveserver2 site.xml does not get to override this
assertEquals("from.sysprop", conf.get(OVERRIDE_KEY));
} finally {
System.getProperties().remove(OVERRIDE_KEY);
}
}
use of org.apache.hadoop.hive.conf.HiveConf in project hive by apache.
the class TestCreateUdfEntities method setUp.
@Before
public void setUp() throws Exception {
HiveConf conf = new HiveConf(Driver.class);
SessionState.start(conf);
driver = new Driver(conf);
driver.init();
}
Aggregations