本文整理了Java中org.apache.hive.service.server.HiveServer2.getHiveConf()
方法的一些代码示例,展示了HiveServer2.getHiveConf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HiveServer2.getHiveConf()
方法的具体详情如下:
包路径:org.apache.hive.service.server.HiveServer2
类名称:HiveServer2
方法名:getHiveConf
暂无
代码示例来源:origin: apache/hive
@Override
public void notLeader() {
LOG.info("HS2 instance {} LOST LEADERSHIP. Stopping/Disconnecting tez sessions..", hiveServer2.serviceUri);
hiveServer2.isLeader.set(false);
hiveServer2.closeAndDisallowHiveSessions();
hiveServer2.stopOrDisconnectTezSessions();
LOG.info("Stopped/Disconnected tez sessions.");
// resolve futures used for testing
if (HiveConf.getBoolVar(hiveServer2.getHiveConf(), ConfVars.HIVE_IN_TEST)) {
hiveServer2.notLeaderTestFuture.set(true);
hiveServer2.resetIsLeaderTestFuture();
}
}
}
代码示例来源:origin: apache/hive
@Override
public void isLeader() {
LOG.info("HS2 instance {} became the LEADER. Starting/Reconnecting tez sessions..", hiveServer2.serviceUri);
hiveServer2.isLeader.set(true);
if (parentSession != null) {
SessionState.setCurrentSessionState(parentSession);
}
hiveServer2.startOrReconnectTezSessions();
LOG.info("Started/Reconnected tez sessions.");
hiveServer2.allowClientSessions();
// resolve futures used for testing
if (HiveConf.getBoolVar(hiveServer2.getHiveConf(), ConfVars.HIVE_IN_TEST)) {
hiveServer2.isLeaderTestFuture.set(true);
hiveServer2.resetNotLeaderTestFuture();
}
}
代码示例来源:origin: apache/hive
private void initAndStartWorkloadManager(final WMFullResourcePlan resourcePlan) {
if (!StringUtils.isEmpty(wmQueue)) {
// Initialize workload management.
LOG.info("Initializing workload management");
try {
wm = WorkloadManager.create(wmQueue, getHiveConf(), resourcePlan);
wm.start();
LOG.info("Workload manager initialized.");
} catch (Exception e) {
throw new ServiceException("Unable to instantiate and start Workload Manager", e);
}
} else {
LOG.info("Workload management is not enabled.");
}
}
代码示例来源:origin: apache/hive
private void startOrReconnectTezSessions() {
LOG.info("Starting/Reconnecting tez sessions..");
// TODO: add tez session reconnect after TEZ-3875
WMFullResourcePlan resourcePlan = null;
if (!StringUtils.isEmpty(wmQueue)) {
try {
resourcePlan = sessionHive.getActiveResourcePlan();
} catch (HiveException e) {
if (!HiveConf.getBoolVar(getHiveConf(), ConfVars.HIVE_IN_TEST_SSL)) {
throw new RuntimeException(e);
} else {
resourcePlan = null; // Ignore errors in SSL tests where the connection is misconfigured.
}
}
if (resourcePlan == null && HiveConf.getBoolVar(
getHiveConf(), ConfVars.HIVE_IN_TEST)) {
LOG.info("Creating a default resource plan for test");
resourcePlan = createTestResourcePlan();
}
}
initAndStartTezSessionPoolManager(resourcePlan);
initAndStartWorkloadManager(resourcePlan);
}
代码示例来源:origin: apache/hive
private void initAndStartTezSessionPoolManager(final WMFullResourcePlan resourcePlan) {
// starting Tez session pool in start here to let parent session state initialize on CliService state, to avoid
// SessionState.get() return null during createTezDir
try {
// will be invoked anyway in TezTask. Doing it early to initialize triggers for non-pool tez session.
LOG.info("Initializing tez session pool manager");
tezSessionPoolManager = TezSessionPoolManager.getInstance();
HiveConf hiveConf = getHiveConf();
if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_TEZ_INITIALIZE_DEFAULT_SESSIONS)) {
tezSessionPoolManager.setupPool(hiveConf);
} else {
tezSessionPoolManager.setupNonPool(hiveConf);
}
tezSessionPoolManager.startPool(hiveConf, resourcePlan);
LOG.info("Tez session pool manager initialized.");
} catch (Exception e) {
throw new ServiceException("Unable to setup tez session pool", e);
}
}
代码示例来源:origin: apache/hive
@Override
public synchronized void stop() {
LOG.info("Shutting down HiveServer2");
HiveConf hiveConf = this.getHiveConf();
super.stop();
if (hs2HARegistry != null) {
代码示例来源:origin: apache/hive
HiveConf hiveConf = getHiveConf();
if (!serviceDiscovery || !activePassiveHA) {
allowClientSessions();
代码示例来源:origin: com.klarna/hiverunner
public HiveConf getHiveConf() {
return hiveServer2.getHiveConf();
}
代码示例来源:origin: klarna/HiveRunner
public HiveConf getHiveConf() {
return hiveServer2.getHiveConf();
}
代码示例来源:origin: org.apache.hive/hive-service
@Override
public void notLeader() {
LOG.info("HS2 instance {} LOST LEADERSHIP. Stopping/Disconnecting tez sessions..", hiveServer2.serviceUri);
hiveServer2.isLeader.set(false);
hiveServer2.closeHiveSessions();
hiveServer2.stopOrDisconnectTezSessions();
LOG.info("Stopped/Disconnected tez sessions.");
// resolve futures used for testing
if (HiveConf.getBoolVar(hiveServer2.getHiveConf(), ConfVars.HIVE_IN_TEST)) {
hiveServer2.notLeaderTestFuture.set(true);
hiveServer2.resetIsLeaderTestFuture();
}
}
}
代码示例来源:origin: uber/hudi
static HiveConf getHiveConf() {
return hiveServer.getHiveConf();
}
代码示例来源:origin: org.apache.hive/hive-service
@Override
public void isLeader() {
LOG.info("HS2 instance {} became the LEADER. Starting/Reconnecting tez sessions..", hiveServer2.serviceUri);
hiveServer2.isLeader.set(true);
if (parentSession != null) {
SessionState.setCurrentSessionState(parentSession);
}
hiveServer2.startOrReconnectTezSessions();
LOG.info("Started/Reconnected tez sessions.");
// resolve futures used for testing
if (HiveConf.getBoolVar(hiveServer2.getHiveConf(), ConfVars.HIVE_IN_TEST)) {
hiveServer2.isLeaderTestFuture.set(true);
hiveServer2.resetNotLeaderTestFuture();
}
}
代码示例来源:origin: com.presidentio.but/hive2-unit
public HiveConf getConfig() {
HiveConf hiveConf = new HiveConf(hiveServer.getHiveConf());
hiveConf.addResource("hive-site.xml");
return hiveConf;
}
代码示例来源:origin: org.apache.hive/hive-service
private void initAndStartWorkloadManager(final WMFullResourcePlan resourcePlan) {
if (!StringUtils.isEmpty(wmQueue)) {
// Initialize workload management.
LOG.info("Initializing workload management");
try {
wm = WorkloadManager.create(wmQueue, getHiveConf(), resourcePlan);
wm.start();
LOG.info("Workload manager initialized.");
} catch (Exception e) {
throw new ServiceException("Unable to instantiate and start Workload Manager", e);
}
} else {
LOG.info("Workload management is not enabled.");
}
}
代码示例来源:origin: org.apache.hive/hive-service
private void startOrReconnectTezSessions() {
LOG.info("Starting/Reconnecting tez sessions..");
// TODO: add tez session reconnect after TEZ-3875
WMFullResourcePlan resourcePlan = null;
if (!StringUtils.isEmpty(wmQueue)) {
try {
resourcePlan = sessionHive.getActiveResourcePlan();
} catch (HiveException e) {
if (!HiveConf.getBoolVar(getHiveConf(), ConfVars.HIVE_IN_TEST_SSL)) {
throw new RuntimeException(e);
} else {
resourcePlan = null; // Ignore errors in SSL tests where the connection is misconfigured.
}
}
if (resourcePlan == null && HiveConf.getBoolVar(
getHiveConf(), ConfVars.HIVE_IN_TEST)) {
LOG.info("Creating a default resource plan for test");
resourcePlan = createTestResourcePlan();
}
}
initAndStartTezSessionPoolManager(resourcePlan);
initAndStartWorkloadManager(resourcePlan);
}
代码示例来源:origin: org.apache.hive/hive-service
private void initAndStartTezSessionPoolManager(final WMFullResourcePlan resourcePlan) {
// starting Tez session pool in start here to let parent session state initialize on CliService state, to avoid
// SessionState.get() return null during createTezDir
try {
// will be invoked anyway in TezTask. Doing it early to initialize triggers for non-pool tez session.
LOG.info("Initializing tez session pool manager");
tezSessionPoolManager = TezSessionPoolManager.getInstance();
HiveConf hiveConf = getHiveConf();
if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_TEZ_INITIALIZE_DEFAULT_SESSIONS)) {
tezSessionPoolManager.setupPool(hiveConf);
} else {
tezSessionPoolManager.setupNonPool(hiveConf);
}
tezSessionPoolManager.startPool(hiveConf, resourcePlan);
LOG.info("Tez session pool manager initialized.");
} catch (Exception e) {
throw new ServiceException("Unable to setup tez session pool", e);
}
}
代码示例来源:origin: org.apache.hive/hive-service
@Override
public synchronized void stop() {
LOG.info("Shutting down HiveServer2");
HiveConf hiveConf = this.getHiveConf();
super.stop();
if (hs2HARegistry != null) {
代码示例来源:origin: com.github.hyukjinkwon/hive-service
@Override
public synchronized void stop() {
LOG.info("Shutting down HiveServer2");
HiveConf hiveConf = this.getHiveConf();
super.stop();
代码示例来源:origin: org.spark-project.hive/hive-service
@Override
public synchronized void stop() {
LOG.info("Shutting down HiveServer2");
HiveConf hiveConf = this.getHiveConf();
super.stop();
代码示例来源:origin: uber/hudi
static void clear() throws IOException {
fileSystem.delete(new Path(hiveSyncConfig.basePath), true);
HoodieTableMetaClient
.initTableType(configuration, hiveSyncConfig.basePath, HoodieTableType.COPY_ON_WRITE,
hiveSyncConfig.tableName, HoodieAvroPayload.class.getName());
HoodieHiveClient client = new HoodieHiveClient(hiveSyncConfig, hiveServer.getHiveConf(),
fileSystem);
for (String tableName : createdTablesSet) {
client.updateHiveSQL("drop table if exists " + tableName);
}
createdTablesSet.clear();
client.updateHiveSQL("drop database if exists " + hiveSyncConfig.databaseName);
client.updateHiveSQL("create database " + hiveSyncConfig.databaseName);
}
内容来源于网络,如有侵权,请联系作者删除!