public HiveConf getConfigurationFromFiles(final String configFiles) { final HiveConf hiveConfig = new HiveConf(); if (StringUtils.isNotBlank(configFiles)) { for (final String configFile : configFiles.split(",")) { hiveConfig.addResource(new Path(configFile.trim())); } } return hiveConfig; }
public HiveConf getConfigurationFromFiles(final String configFiles) { final HiveConf hiveConfig = new HiveConf(); if (StringUtils.isNotBlank(configFiles)) { for (final String configFile : configFiles.split(",")) { hiveConfig.addResource(new Path(configFile.trim())); } } return hiveConfig; }
public static void main(String[] args) throws Exception { HiveConf conf = new HiveConf(); conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml"))); conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName()); conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true); SessionState.start(new CliSessionState(conf)); new CliDriver().processLine(args[0]); }
addResource(getConfVarInputStream()); addResource(hiveSiteURL); addResource(hivemetastoreSiteUrl); addResource(hiveServer2SiteUrl);
conf.addResource(f); if (conf.getResource(f) == null) { throw new Exception("Unable to find required config file: " + f); conf.addResource(f);
QueryState queryState = new QueryState.Builder().build(); HiveConf conf = queryState.getConf(); conf.addResource("hive-site.xml"); ArrayList<String> results = new ArrayList<String>(); ArrayList<String> temp = new ArrayList<String>();
private void setupMiniCluster(HadoopShims shims, String confDir) throws IOException { String uriString = fs.getUri().toString(); if (clusterType.getCoreClusterType() == CoreClusterType.TEZ) { if (confDir != null && !confDir.isEmpty()) { conf.addResource(new URL("file://" + new File(confDir).toURI().getPath() + "/tez-site.xml")); } int numTrackers = 2; if (EnumSet.of(MiniClusterType.llap_local, MiniClusterType.tez_local).contains(clusterType)) { mr = shims.getLocalMiniTezCluster(conf, clusterType == MiniClusterType.llap_local); } else { mr = shims.getMiniTezCluster(conf, numTrackers, uriString, EnumSet.of(MiniClusterType.llap, MiniClusterType.llap_local).contains(clusterType)); } } else if (clusterType == MiniClusterType.miniSparkOnYarn) { mr = shims.getMiniSparkCluster(conf, 2, uriString, 1); } else if (clusterType == MiniClusterType.mr) { mr = shims.getMiniMrCluster(conf, 2, uriString, 1); } }
public HiveConf getConfigurationFromFiles(final String configFiles) { final HiveConf hiveConfig = new HiveConf(); if (StringUtils.isNotBlank(configFiles)) { for (final String configFile : configFiles.split(",")) { hiveConfig.addResource(new Path(configFile.trim())); } } return hiveConfig; }
public CliTableManager() throws Exception { HiveConf conf=new HiveConf(); File f=new File(ConfUtil.getHiveConfDir()+File.separator+"hive-site.xml"); log.debug("hive conf file:"+f.toString()); if(f.exists()){ conf.addResource(f.toURI().toURL()); } client=new HiveMetaStoreClient(conf); }
public HiveConf getConfig() { HiveConf hiveConf = new HiveConf(hiveServer.getHiveConf()); hiveConf.addResource("hive-site.xml"); return hiveConf; }
public static void main(String[] args) throws Exception { // parse the params final HiveSyncConfig cfg = new HiveSyncConfig(); JCommander cmd = new JCommander(cfg, args); if (cfg.help || args.length == 0) { cmd.usage(); System.exit(1); } FileSystem fs = FSUtils.getFs(cfg.basePath, new Configuration()); HiveConf hiveConf = new HiveConf(); hiveConf.addResource(fs.getConf()); new HiveSyncTool(cfg, hiveConf, fs).syncHoodieTable(); } }
public HiveMetaStore(Configuration conf, HdfsSinkConnectorConfig connectorConfig) throws HiveMetaStoreException { HiveConf hiveConf = new HiveConf(conf, HiveConf.class); String hiveConfDir = connectorConfig.getString(HdfsSinkConnectorConfig.HIVE_CONF_DIR_CONFIG); String hiveMetaStoreURIs = connectorConfig.getString(HdfsSinkConnectorConfig.HIVE_METASTORE_URIS_CONFIG); if (hiveMetaStoreURIs.isEmpty()) { log.warn("hive.metastore.uris empty, an embedded Hive metastore will be " + "created in the directory the connector is started. " + "You need to start Hive in that specific directory to query the data."); } if (!hiveConfDir.equals("")) { String hiveSitePath = hiveConfDir + "/hive-site.xml"; File hiveSite = new File(hiveSitePath); if (!hiveSite.exists()) { log.warn("hive-site.xml does not exist in provided Hive configuration directory {}.", hiveConf); } hiveConf.addResource(new Path(hiveSitePath)); } hiveConf.set("hive.metastore.uris", hiveMetaStoreURIs); try { client = HCatUtil.getHiveMetastoreClient(hiveConf); } catch (IOException | MetaException e) { throw new HiveMetaStoreException(e); } }
public static void main(String[] args) throws Exception { HiveConf conf = new HiveConf(); conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml"))); conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName()); conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true); SessionState.start(new CliSessionState(conf)); new CliDriver().processLine(args[0]); }
public static void main(String[] args) throws Exception { HiveConf conf = new HiveConf(); conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml"))); conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName()); conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true); SessionState.start(new CliSessionState(conf)); new CliDriver().processLine(args[0]); }
public static void main(String[] args) throws Exception { HiveConf conf = new HiveConf(); conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml"))); conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName()); conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true); SessionState.start(new CliSessionState(conf)); new CliDriver().processLine(args[0]); }
public static void main(String[] args) throws Exception { HiveConf conf = new HiveConf(); conf.addResource(new Path("file:///", System.getProperty("oozie.action.conf.xml"))); conf.setVar(ConfVars.SEMANTIC_ANALYZER_HOOK, HCatSemanticAnalyzer.class.getName()); conf.setBoolVar(ConfVars.METASTORE_USE_THRIFT_SASL, true); SessionState.start(new CliSessionState(conf)); new CliDriver().processLine(args[0]); }
/** * Test custom. * * @throws LensException the lens exception */ @Test public void testCustom() throws LensException { conf.addResource(TestUserConfigLoader.class.getResourceAsStream("/user/custom.xml")); UserConfigLoaderFactory.init(conf); Assert.assertEquals(UserConfigLoaderFactory.getUserConfig("user1"), FooBarConfigLoader.CONST_HASH_MAP); } }
@BeforeClass public static void connect() throws MetaException { if (JdbcConnector.testActive(JdbcConnector.TEST_HCATALOG, "Test HCatalog ")) { String hiveConfDir = JdbcConnector.getProperty(JdbcConnector.HIVE_CONF_DIR, "Hive conf directory "); String hadoopConfDir = JdbcConnector.getProperty(JdbcConnector.HADOOP_CONF_DIR, "Hadoop conf directory "); conf = new HiveConf(); String fileSep = System.getProperty("file.separator"); conf.addResource(new Path(hadoopConfDir + fileSep + "core-site.xml")); conf.addResource(new Path(hadoopConfDir + fileSep + "hdfs-site.xml")); conf.addResource(new Path(hadoopConfDir + fileSep + "yarn-site.xml")); conf.addResource(new Path(hadoopConfDir + fileSep + "mapred-site.xml")); conf.addResource(new Path(hiveConfDir + fileSep + "hive-site.xml")); client = new HiveMetaStoreClient(conf); } }
/** * Test fixed. * * @throws LensException the lens exception */ @Test public void testFixed() throws LensException { conf.addResource(TestUserConfigLoader.class.getResourceAsStream("/user/fixed.xml")); UserConfigLoaderFactory.init(conf); HashMap<String, String> expected = new HashMap<String, String>() { { put(LensConfConstants.SESSION_CLUSTER_USER, "lensuser"); } }; Assert.assertEquals(UserConfigLoaderFactory.getUserConfig("user1"), expected); }
@BeforeTest public void beforeTest() throws LensException { initializeConfig(config); esDriverConfig = new ESDriverConfig(config); driver.configure(config, "es", "es1"); mockClientES = (MockClientES) driver.getESClient(); HiveConf conf = new HiveConf(); conf.addResource(config); SessionState.start(conf); }