當前位置: 首頁>>代碼示例>>Java>>正文


Java HiveConf.setVar方法代碼示例

本文整理匯總了Java中org.apache.hadoop.hive.conf.HiveConf.setVar方法的典型用法代碼示例。如果您正苦於以下問題:Java HiveConf.setVar方法的具體用法?Java HiveConf.setVar怎麽用?Java HiveConf.setVar使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.hive.conf.HiveConf的用法示例。


在下文中一共展示了HiveConf.setVar方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: get

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
@Override
public CloseableMetaStoreClient get() {
  LOG.debug("Creating tunnel: {}:? -> {} -> {}:{}", localHost, sshRoute, remoteHost, remotePort);
  try {
    TunnelConnectionManager tunnelConnectionManager = tunnelConnectionManagerFactory.create(sshRoute, localHost,
        FIRST_AVAILABLE_PORT, remoteHost, remotePort);
    int localPort = tunnelConnectionManager.getTunnel(remoteHost, remotePort).getAssignedLocalPort();
    tunnelConnectionManager.open();
    LOG.debug("Tunnel created: {}:{} -> {} -> {}:{}", localHost, localPort, sshRoute, remoteHost, remotePort);

    localPort = tunnelConnectionManager.getTunnel(remoteHost, remotePort).getAssignedLocalPort();
    HiveConf localHiveConf = new HiveConf(hiveConf);
    String proxyMetaStoreUris = "thrift://" + localHost + ":" + localPort;
    localHiveConf.setVar(ConfVars.METASTOREURIS, proxyMetaStoreUris);
    LOG.info("Metastore URI {} is being proxied to {}", hiveConf.getVar(ConfVars.METASTOREURIS), proxyMetaStoreUris);
    InvocationHandler handler = new TunnellingMetaStoreClientInvocationHandler(
        metaStoreClientFactory.newInstance(localHiveConf, name), tunnelConnectionManager);
    return (CloseableMetaStoreClient) Proxy.newProxyInstance(getClass().getClassLoader(), INTERFACES, handler);
  } catch (Exception e) {
    String message = String.format("Unable to establish SSH tunnel: '%s:?' -> '%s' -> '%s:%s'", localHost, sshRoute,
        remoteHost, remotePort);
    throw new MetaStoreClientException(message, e);
  }
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:25,代碼來源:TunnellingMetaStoreClientSupplier.java

示例2: TestHiveWriter

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
public TestHiveWriter() throws Exception {
  partVals = new ArrayList<String>(2);
  partVals.add(PART1_VALUE);
  partVals.add(PART2_VALUE);

  metaStoreURI = null;

  int callTimeoutPoolSize = 1;
  callTimeoutPool = Executors.newFixedThreadPool(callTimeoutPoolSize,
          new ThreadFactoryBuilder().setNameFormat("hiveWriterTest").build());

  // 1) Start metastore
  conf = new HiveConf(this.getClass());
  TestUtil.setConfValues(conf);
  if (metaStoreURI != null) {
    conf.setVar(HiveConf.ConfVars.METASTOREURIS, metaStoreURI);
  }

  // 2) Setup Hive client
  SessionState.start(new CliSessionState(conf));
  driver = new Driver(conf);

}
 
開發者ID:moueimei,項目名稱:flume-release-1.7.0,代碼行數:24,代碼來源:TestHiveWriter.java

示例3: prepare

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
@Before
public void prepare() throws Exception {
  when(metaStoreClientSupplier.get()).thenReturn(mockMetaStoreClient);
  when(replicaCatalog.getName()).thenReturn(NAME);

  hiveConf = new HiveConf();
  hiveConf.setVar(ConfVars.METASTOREURIS, REPLICA_META_STORE_URIS);
  replica = newReplica(ReplicationMode.FULL);
  tableLocation = temporaryFolder.newFolder("table_location").toURI().toString();

  sourceTable = newTable();
  existingPartition = newPartition("one", "two");

  ColumnStatisticsObj columnStatisticsObj1 = new ColumnStatisticsObj(COLUMN_A, "string",
      new ColumnStatisticsData(_Fields.LONG_STATS, new LongColumnStatsData(0, 1)));
  ColumnStatisticsObj columnStatisticsObj2 = new ColumnStatisticsObj(COLUMN_B, "string",
      new ColumnStatisticsData(_Fields.LONG_STATS, new LongColumnStatsData(1, 2)));
  columnStatisticsObjs = Arrays.asList(columnStatisticsObj1, columnStatisticsObj2);
  ColumnStatisticsDesc statsDesc = new ColumnStatisticsDesc(true, DB_NAME, TABLE_NAME);
  columnStatistics = new ColumnStatistics(statsDesc, columnStatisticsObjs);

  tableAndStatistics = new TableAndStatistics(sourceTable, columnStatistics);

  existingReplicaTable = new Table(sourceTable);

  when(mockReplicaLocationManager.getTableLocation()).thenReturn(new Path(tableLocation));
  when(mockReplicaLocationManager.getPartitionBaseLocation()).thenReturn(new Path(tableLocation));

  when(mockMetaStoreClient.getTable(DB_NAME, TABLE_NAME)).thenReturn(existingReplicaTable);
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:31,代碼來源:ReplicaTest.java

示例4: createLocalHiveConf

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
private HiveConf createLocalHiveConf(
    TunnelConnectionManager tunnelConnectionManager,
    String localHost,
    String remoteHost,
    int remotePort,
    HiveConf hiveConf) {
  int localPort = tunnelConnectionManager.getTunnel(remoteHost, remotePort).getAssignedLocalPort();
  String proxyMetaStoreUris = "thrift://" + localHost + ":" + localPort;
  HiveConf localHiveConf = new HiveConf(hiveConf);
  localHiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, proxyMetaStoreUris);
  return localHiveConf;
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:13,代碼來源:TunnelingMetaStoreClientFactory.java

示例5: applyAuthorizationConfigPolicy

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
@Override
public void applyAuthorizationConfigPolicy(HiveConf hiveConf) throws HiveAuthzPluginException {
  super.applyAuthorizationConfigPolicy(hiveConf);
  hiveConf.setVar(ConfVars.HIVE_AUTHORIZATION_TABLE_OWNER_GRANTS, "");
}
 
開發者ID:HotelsDotCom,項目名稱:beeju,代碼行數:6,代碼來源:RelaxedSQLStdHiveAccessController.java

示例6: newInstanceCannotConnectThrowsMetaStoreClientException

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
@Test(expected = MetaStoreClientException.class)
public void newInstanceCannotConnectThrowsMetaStoreClientException() throws Exception {
  HiveConf conf = new HiveConf();
  conf.setVar(ConfVars.METASTOREURIS, "thrift://ghost:1234");
  factory.newInstance(conf, "name");
}
 
開發者ID:HotelsDotCom,項目名稱:circus-train,代碼行數:7,代碼來源:ThriftMetaStoreClientFactoryTest.java

示例7: getWaggleDanceClient

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
private HiveMetaStoreClient getWaggleDanceClient() throws MetaException {
  HiveConf conf = new HiveConf();
  conf.setVar(ConfVars.METASTOREURIS, getWaggleDanceThriftUri());
  conf.setBoolVar(ConfVars.METASTORE_EXECUTE_SET_UGI, true);
  return new HiveMetaStoreClient(conf);
}
 
開發者ID:HotelsDotCom,項目名稱:waggle-dance,代碼行數:7,代碼來源:WaggleDanceIntegrationTest.java

示例8: setConfValues

import org.apache.hadoop.hive.conf.HiveConf; //導入方法依賴的package包/類
/**
 * Set up the configuration so it will use the DbTxnManager, concurrency will be set to true,
 * and the JDBC configs will be set for putting the transaction and lock info in the embedded
 * metastore.
 * @param conf HiveConf to add these values to.
 */
public static void setConfValues(HiveConf conf) {
  conf.setVar(HiveConf.ConfVars.HIVE_TXN_MANAGER, txnMgr);
  conf.setBoolVar(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY, true);
  conf.set("fs.raw.impl", RawFileSystem.class.getName());
}
 
開發者ID:moueimei,項目名稱:flume-release-1.7.0,代碼行數:12,代碼來源:TestUtil.java


注:本文中的org.apache.hadoop.hive.conf.HiveConf.setVar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。