Package org.apache.hadoop.hive.conf

Examples of org.apache.hadoop.hive.conf.HiveConf


   * @param ctx  The lock manager context (containing the Hive configuration file)
   * Start the ZooKeeper client based on the zookeeper cluster specified in the conf.
   **/
  public void setContext(HiveLockManagerCtx ctx) throws LockException {
    this.ctx = ctx;
    HiveConf conf = ctx.getConf();
    sessionTimeout = conf.getIntVar(HiveConf.ConfVars.HIVE_ZOOKEEPER_SESSION_TIMEOUT);
    quorumServers = ZooKeeperHiveLockManager.getQuorumServers(conf);

    sleepTime = conf.getIntVar(HiveConf.ConfVars.HIVE_LOCK_SLEEP_BETWEEN_RETRIES) * 1000;
    numRetriesForLock = conf.getIntVar(HiveConf.ConfVars.HIVE_LOCK_NUMRETRIES);
    numRetriesForUnLock = conf.getIntVar(HiveConf.ConfVars.HIVE_UNLOCK_NUMRETRIES);

    try {
      renewZookeeperInstance(sessionTimeout, quorumServers);
      parent = conf.getVar(HiveConf.ConfVars.HIVE_ZOOKEEPER_NAMESPACE);

      try {
        zooKeeper.create("/" +  parent, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
      } catch (KeeperException e) {
        // ignore if the parent already exists
View Full Code Here


    String historyDirectory = System.getProperty("user.home");
    if ((new File(historyDirectory)).exists()) {
      File historyFile = new File(historyDirectory + File.separator + ".hivehistory");
      historyFile.delete();
    }
    HiveConf configuration = new HiveConf();
    CliSessionState ss = new CliSessionState(configuration);
    CliSessionState.start(ss);
    String[] args = {};
    PrintStream oldOut = System.out;
    ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
View Full Code Here

  /**
   * Test commands exit and quit
   */
  public void testQuit() throws Exception {

    CliSessionState ss = new CliSessionState(new HiveConf());
    ss.err = System.err;
    ss.out = System.out;

    NoExitSecurityManager newSecurityManager = new NoExitSecurityManager();
    try {
View Full Code Here

  /**
   * test remote execCommand
   */
  public void testRemoteCall() throws Exception {
    MyCliSessionState ss = new MyCliSessionState(new HiveConf(),
        org.apache.hadoop.hive.cli.TestCliDriverMethods.MyCliSessionState.ClientResult.RETURN_OK);
    ss.err = System.err;
    ByteArrayOutputStream data = new ByteArrayOutputStream();
    ss.out = new PrintStream(data);
    MyCliSessionState.start(ss);
View Full Code Here

    }
  }

  @Override
  public void refresh() {
    HiveConf conf = ctx.getConf();
    sleepTime = conf.getIntVar(HiveConf.ConfVars.HIVE_LOCK_SLEEP_BETWEEN_RETRIES) * 1000;
    numRetriesForLock = conf.getIntVar(HiveConf.ConfVars.HIVE_LOCK_NUMRETRIES);
    numRetriesForUnLock = conf.getIntVar(HiveConf.ConfVars.HIVE_UNLOCK_NUMRETRIES);
  }
View Full Code Here

  /**
   * test remote Exception
   */
  public void testServerException() throws Exception {
    MyCliSessionState ss = new MyCliSessionState(
        new HiveConf(),
        org.apache.hadoop.hive.cli.TestCliDriverMethods.MyCliSessionState.ClientResult.RETURN_SERVER_EXCEPTION);
    ByteArrayOutputStream data = new ByteArrayOutputStream();
    ss.err = new PrintStream(data);
    ss.out = System.out;
    MyCliSessionState.start(ss);
View Full Code Here

  /**
   * test remote Exception
   */
  public void testServerTException() throws Exception {
    MyCliSessionState ss = new MyCliSessionState(
        new HiveConf(),
        org.apache.hadoop.hive.cli.TestCliDriverMethods.MyCliSessionState.ClientResult.RETURN_T_EXCEPTION);
    ByteArrayOutputStream data = new ByteArrayOutputStream();
    ss.err = new PrintStream(data);
    ss.out = System.out;
    MyCliSessionState.start(ss);
View Full Code Here

  /**
   * test remote Exception
   */
  public void testProcessSelectDatabase() throws Exception {
    CliSessionState sessinState = new CliSessionState(new HiveConf());
    CliSessionState.start(sessinState);
    ByteArrayOutputStream data = new ByteArrayOutputStream();
    sessinState.err = new PrintStream(data);
    sessinState.database = "database";
    CliDriver driver = new CliDriver();
View Full Code Here

    homeFile.getParentFile().mkdirs();
    homeFile.createNewFile();
    FileUtils.write(homeFile, "-- init hive file for test ");
    setEnv("HIVE_HOME", homeFile.getParentFile().getParentFile().getAbsolutePath());
    setEnv("HIVE_CONF_DIR", homeFile.getParentFile().getAbsolutePath());
    CliSessionState sessionState = new CliSessionState(new HiveConf());

    ByteArrayOutputStream data = new ByteArrayOutputStream();
    NoExitSecurityManager securityManager = new NoExitSecurityManager();

    sessionState.err = new PrintStream(data);
View Full Code Here

  }

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {

    HiveConf hiveConf = new HiveConf(TestHCatLoaderComplexSchema.class);
    hiveConf.set(HiveConf.ConfVars.PREEXECHOOKS.varname, "");
    hiveConf.set(HiveConf.ConfVars.POSTEXECHOOKS.varname, "");
    hiveConf.set(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    driver = new Driver(hiveConf);
    SessionState.start(new CliSessionState(hiveConf));
    //props = new Properties();
    //props.setProperty("fs.default.name", cluster.getProperties().getProperty("fs.default.name"));
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.conf.HiveConf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.