gpt4 book ai didi

org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager.lock()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 18:53:31 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager.lock()方法的一些代码示例,展示了ZooKeeperHiveLockManager.lock()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZooKeeperHiveLockManager.lock()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager
类名称:ZooKeeperHiveLockManager
方法名:lock

ZooKeeperHiveLockManager.lock介绍

暂无

代码示例

代码示例来源:origin: apache/hive

/**
 * @param key
 *          The object to be locked
 * @param mode
 *          The mode of the lock
 * @param keepAlive
 *          Whether the lock is to be persisted after the statement Acquire the
 *          lock. Return null if a conflicting lock is present.
 **/
@Override
public ZooKeeperHiveLock lock(HiveLockObject key, HiveLockMode mode,
  boolean keepAlive) throws LockException {
 return lock(key, mode, keepAlive, false);
}

代码示例来源:origin: apache/drill

/**
 * @param key
 *          The object to be locked
 * @param mode
 *          The mode of the lock
 * @param keepAlive
 *          Whether the lock is to be persisted after the statement Acquire the
 *          lock. Return null if a conflicting lock is present.
 **/
@Override
public ZooKeeperHiveLock lock(HiveLockObject key, HiveLockMode mode,
  boolean keepAlive) throws LockException {
 return lock(key, mode, keepAlive, false);
}

代码示例来源:origin: apache/hive

lock = lock(lockObject.getObj(), lockObject.getMode(), keepAlive, true);
} catch (LockException e) {
 console.printError("Error in acquireLocks..." );

代码示例来源:origin: apache/drill

lock = lock(lockObject.getObj(), lockObject.getMode(), keepAlive, true);
} catch (LockException e) {
 console.printError("Error in acquireLocks..." );

代码示例来源:origin: apache/hive

@Test
public void testMetrics() throws Exception{
 conf.setVar(HiveConf.ConfVars.HIVE_ZOOKEEPER_QUORUM, "localhost");
 conf.setVar(HiveConf.ConfVars.HIVE_ZOOKEEPER_CLIENT_PORT, String.valueOf(server.getPort()));
 conf.setBoolVar(HiveConf.ConfVars.HIVE_SERVER2_METRICS_ENABLED, true);
 conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, false);
 conf.setVar(HiveConf.ConfVars.HIVE_METRICS_REPORTER, MetricsReporting.JSON_FILE.name() + "," + MetricsReporting.JMX.name());
 MetricsFactory.init(conf);
 CodahaleMetrics metrics = (CodahaleMetrics) MetricsFactory.getInstance();
 HiveLockManagerCtx ctx = new HiveLockManagerCtx(conf);
 ZooKeeperHiveLockManager zMgr= new ZooKeeperHiveLockManager();
 zMgr.setContext(ctx);
 ZooKeeperHiveLock curLock = zMgr.lock(hiveLock, HiveLockMode.SHARED, false);
 String json = metrics.dumpJson();
 MetricsTestUtils.verifyMetricsJson(json, MetricsTestUtils.COUNTER, MetricsConstant.ZOOKEEPER_HIVE_SHAREDLOCKS, 1);
 zMgr.unlock(curLock);
 json = metrics.dumpJson();
 MetricsTestUtils.verifyMetricsJson(json, MetricsTestUtils.COUNTER, MetricsConstant.ZOOKEEPER_HIVE_SHAREDLOCKS, 0);
 zMgr.close();
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

/**
 * @param key
 *          The object to be locked
 * @param mode
 *          The mode of the lock
 * @param keepAlive
 *          Whether the lock is to be persisted after the statement Acquire the
 *          lock. Return null if a conflicting lock is present.
 **/
public ZooKeeperHiveLock lock(HiveLockObject key, HiveLockMode mode,
  boolean keepAlive) throws LockException {
 return lock(key, mode, keepAlive, false);
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

/**
 * @param  key          The object to be locked
 * @param  mode         The mode of the lock
 * @param  keepAlive    Whether the lock is to be persisted after the statement
 * @param  numRetries   number of retries when the lock can not be acquired
 * @param  sleepTime    sleep time between retries
 *
 * Acuire the lock. Return null if a conflicting lock is present.
 **/
public ZooKeeperHiveLock lock(HiveLockObject key, HiveLockMode mode,
  boolean keepAlive, int numRetries, int sleepTime)
 throws LockException {
 return lock(key, mode, keepAlive, numRetries, sleepTime, false);
}

代码示例来源:origin: com.facebook.presto.hive/hive-apache

lock = lock(lockObject.getObj(), lockObject.getMode(), keepAlive, true);
} catch (LockException e) {
 console.printError("Error in acquireLocks..." );

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

lock = lock(lockObject.getObj(), lockObject.getMode(), false,
       numRetries, sleepTime, true);
} catch (LockException e) {

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com