Examples of FaultyThriftHiveMetastore


Examples of com.facebook.hiveio.common.FaultyThriftHiveMetastore

  private final String PROFILE_ID = "x";

  @Test(expectedExceptions = IOException.class)
  public void testExceptionAfterTooManyRetriesWhenTableDoesNotExist()
    throws Exception {
    HiveMetastores.setTestClient(new FaultyThriftHiveMetastore(
        BackoffRetryTask.NUM_TRIES.getDefaultValue()));
    Configuration conf = new Configuration();
    conf.setLong(BackoffRetryTask.INITIAL_RETRY_DELAY_MSEC.getKey(), 100);
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.getTableDesc().setTableName("doesnt-exist");
View Full Code Here

Examples of com.facebook.hiveio.common.FaultyThriftHiveMetastore

  }

  @Test
  public void testRecoveredFromFailuresAfterRetries()
      throws Exception {
    FaultyThriftHiveMetastore metastore = new FaultyThriftHiveMetastore(
        BackoffRetryTask.NUM_TRIES.getDefaultValue() - 1);

    Configuration conf = new Configuration();
    conf.setLong(BackoffRetryTask.INITIAL_RETRY_DELAY_MSEC.getKey(), 100);
    HiveOutputDescription outputDesc = new HiveOutputDescription();
    outputDesc.getTableDesc().setTableName("foo");
    OutputConf outputConf = new OutputConf(conf, PROFILE_ID);
    outputConf.writeOutputDescription(outputDesc);
    HiveApiOutputFormat outputFormat = new HiveApiOutputFormat();
    outputFormat.setMyProfileId(PROFILE_ID);
    JobConf jobConf = new JobConf(conf);
    TaskAttemptContext taskContext =
        new HackTaskAttemptContext(jobConf, new TaskAttemptID());
    JobContext jobContext = new HackJobContext(jobConf, taskContext.getJobID());

    HiveMetastores.setTestClient(metastore);

    outputFormat.checkOutputSpecs(jobContext);

    assertEquals(
        BackoffRetryTask.NUM_TRIES.getDefaultValue(),
        metastore.getNumCalls());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.