Package org.apache.hadoop.hive.conf

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


    private HiveConf configure() throws Exception {
        TestUtils.delete(new File("/tmp/hive"));

        Configuration cfg = new Configuration();
        HiveConf conf = new HiveConf(cfg, HiveConf.class);
        refreshConfig(conf);

        HdpBootstrap.hackHadoopStagingOnWin();

        // work-around for NTFS FS
        // set permissive permissions since otherwise, on some OS it fails
        if (TestUtils.isWindows()) {
            conf.set("fs.file.impl", NTFSLocalFileSystem.class.getName());
            conf.set("hive.scratch.dir.permission", "650");
            conf.setVar(ConfVars.SCRATCHDIRPERMISSION, "650");
            conf.set("hive.server2.enable.doAs", "false");
            conf.set("hive.execution.engine", "mr");
            //conf.set("hadoop.bin.path", getClass().getClassLoader().getResource("hadoop.cmd").getPath());
            System.setProperty("path.separator", ";");
            conf.setVar(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER,
                    DummyHiveAuthenticationProvider.class.getName());
        }
        else {
            conf.set("hive.scratch.dir.permission", "777");
            conf.setVar(ConfVars.SCRATCHDIRPERMISSION, "777");
        }

        int random = new Random().nextInt();

        conf.set("hive.metastore.warehouse.dir", "/tmp/hive/warehouse" + random);
        conf.set("hive.metastore.metadb.dir", "/tmp/hive/metastore_db" + random);
        conf.set("hive.exec.scratchdir", "/tmp/hive");
        conf.set("fs.permissions.umask-mode", "022");
        conf.set("javax.jdo.option.ConnectionURL", "jdbc:derby:;databaseName=/tmp/hive/metastore_db" + random + ";create=true");
        conf.set("hive.metastore.local", "true");
        conf.set("hive.aux.jars.path", "");
        conf.set("hive.added.jars.path", "");
        conf.set("hive.added.files.path", "");
        conf.set("hive.added.archives.path", "");
        conf.set("fs.default.name", "file:///");

        // clear mapred.job.tracker - Hadoop defaults to 'local' if not defined. Hive however expects this to be set to 'local' - if it's not, it does a remote execution (i.e. no child JVM)
        Field field = Configuration.class.getDeclaredField("properties");
        field.setAccessible(true);
        Properties props = (Properties) field.get(conf);
        props.remove("mapred.job.tracker");
        props.remove("mapreduce.framework.name");
        props.setProperty("fs.default.name", "file:///");

        // intercept SessionState to clean the threadlocal
        Field tss = SessionState.class.getDeclaredField("tss");
        tss.setAccessible(true);
        tss.set(null, new InterceptingThreadLocal());

        return new HiveConf(conf);
    }
View Full Code Here


  @Override
  public void afterPropertiesSet() throws Exception {

    Configuration cfg = ConfigurationUtils.createFrom(configuration, properties);

    conf = new HiveConf(cfg, HiveServerHandler.class);

    ServerUtils.cleanUpScratchDir(conf);
    TServerTransport serverTransport = new TServerSocket(port);

    // Hive 0.8.0
View Full Code Here

    assertEquals(1, splits.length);

    // the the validate input method
    ArrayList<FileStatus> fileList = new ArrayList<FileStatus>(3);
    assertEquals(false,
        ((InputFormatChecker) in).validateInput(fs, new HiveConf(), fileList));
    fileList.add(fs.getFileStatus(testFilePath));
    assertEquals(true,
        ((InputFormatChecker) in).validateInput(fs, new HiveConf(), fileList));
    fileList.add(fs.getFileStatus(workDir));
    assertEquals(false,
        ((InputFormatChecker) in).validateInput(fs, new HiveConf(), fileList));


    // read the whole file
    org.apache.hadoop.mapred.RecordReader reader =
        in.getRecordReader(splits[0], conf, Reporter.NULL);
View Full Code Here

      throw new RuntimeException(
        "The table schema must be defined as colname type, colname type.  All types are hive types");

  // create basic configuration for hdfs and hive
  conf = new Configuration();
  hiveConf = new HiveConf(conf, SessionState.class);

  // parse the table_schema string
  List<String> types = HiveRCSchemaUtil.parseSchemaTypes(table_schema);
  List<String> cols = HiveRCSchemaUtil.parseSchema(pcols, table_schema);
View Full Code Here

    isServerRunning = true;

    securityManager = System.getSecurityManager();
    System.setSecurityManager(new NoExitSecurityManager());

    howlConf = new HiveConf(this.getClass());
    howlConf.set("hive.metastore.local", "false");
    howlConf.setVar(HiveConf.ConfVars.METASTOREURIS, "thrift://localhost:" + msPort);
    howlConf.setIntVar(HiveConf.ConfVars.METASTORETHRIFTRETRIES, 3);

    howlConf.set(HiveConf.ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HowlSemanticAnalyzer.class.getName());
View Full Code Here

  private Driver howlDriver;

  @Override
  protected void setUp() throws Exception {

    HiveConf howlConf = new HiveConf(this.getClass());
    howlConf.set(ConfVars.PREEXECHOOKS.varname, "");
    howlConf.set(ConfVars.POSTEXECHOOKS.varname, "");
    howlConf.set(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");

    howlConf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HowlSemanticAnalyzer.class.getName());
    howlDriver = new Driver(howlConf);
    SessionState.start(new CliSessionState(howlConf));
  }
View Full Code Here

  private HiveMetaStoreClient msc;

  @Override
  protected void setUp() throws Exception {

    HiveConf howlConf = new HiveConf(this.getClass());
    howlConf.set(ConfVars.PREEXECHOOKS.varname, "");
    howlConf.set(ConfVars.POSTEXECHOOKS.varname, "");
    howlConf.set(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");

    HiveConf hiveConf = new HiveConf(howlConf,this.getClass());
    hiveDriver = new Driver(hiveConf);

    howlConf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HowlSemanticAnalyzer.class.getName());
    howlDriver = new Driver(howlConf);
View Full Code Here

  private HiveMetaStoreClient msc;

  @Override
  protected void setUp() throws Exception {

    howlConf = new HiveConf(this.getClass());
    howlConf.set(ConfVars.PREEXECHOOKS.varname, "");
    howlConf.set(ConfVars.POSTEXECHOOKS.varname, "");
    howlConf.set(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    howlConf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname, HowlSemanticAnalyzer.class.getName());
    howlDriver = new Driver(howlConf);
View Full Code Here

  }

  @Override
  protected void setUp() throws Exception {
    if (driver == null){
      HiveConf hiveConf = new HiveConf(this.getClass());
      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();
View Full Code Here

      setupHasRun = true;
    }else{
      return;
    }

    HiveConf hiveConf = new HiveConf(this.getClass());
    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"));
    fullFileNameBasic = cluster.getProperties().getProperty("fs.default.name") + basicFile;
View Full Code Here

TOP

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

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.