/** * Returns the MetaStoreClient for this MetaStoreService. * * @return The client connected to this service * @throws MetaException if any Exception occurs during client configuration */ public IMetaStoreClient getClient() throws MetaException { return new HiveMetaStoreClient(configuration); }
@Override protected HiveMetaStoreClient createClient() throws Exception { return new HiveMetaStoreClient(conf); } }
public void init(Configuration conf) throws MetaException { if (msc == null) { // the only reason we are using new conf here is to override EXPRESSION_PROXY_CLASS Configuration metastoreConf = MetastoreConf.newMetastoreConf(new Configuration(conf)); metastoreConf.set(MetastoreConf.ConfVars.EXPRESSION_PROXY_CLASS.getVarname(), MsckPartitionExpressionProxy.class.getCanonicalName()); setConf(metastoreConf); this.msc = new HiveMetaStoreClient(metastoreConf); } }
@Override protected HiveMetaStoreClient createClient() throws Exception { try { return new HiveMetaStoreClient(conf); } catch (Throwable e) { System.err.println("Unable to open the metastore"); System.err.println(StringUtils.stringifyException(e)); throw new Exception(e); } } }
protected HiveMetaStoreClient createClient(Configuration metaStoreConf) throws Exception { try { return new HiveMetaStoreClient(metaStoreConf); } catch (Throwable e) { System.err.println("Unable to open the metastore"); System.err.println(StringUtils.stringifyException(e)); throw new Exception(e); } }
public static void main(String[] args) throws Exception { SmokeTest test = new SmokeTest(); conf = MetastoreConf.newMetastoreConf(); IMetaStoreClient client = new HiveMetaStoreClient(conf); test.runTest(client); } }
@Override protected void setUp() throws Exception { super.setUp(); hiveConf = new HiveConf(this.getClass()); try { client = new HiveMetaStoreClient(hiveConf); initTable(); } catch (Throwable e) { LOG.error("Unable to open the metastore", e); throw new Exception(e); } }
@Override protected void setUp() throws Exception { super.setUp(); try { client = new HiveMetaStoreClient(new HiveConf(this.getClass())); } catch (Throwable e) { System.err.println("Unable to open the metastore"); System.err.println(StringUtils.stringifyException(e)); throw new Exception(e); } }
@AfterClass public static void tearDown() throws Exception { LOG.info("Shutting down metastore."); HiveMetaStoreClient hmsc = new HiveMetaStoreClient(conf); hmsc.dropDatabase(dbName, true, true, true); }
private static HiveMetaStoreClient createClient() throws MetaException { MetastoreConf.setVar(conf, ConfVars.THRIFT_URIS, "thrift://localhost:" + port); MetastoreConf.setBoolVar(conf, ConfVars.EXECUTE_SET_UGI, false); return new HiveMetaStoreClient(conf); }
@Override protected HiveMetaStoreClient createClient() throws Exception { MetastoreConf.setVar(conf, ConfVars.THRIFT_URIS, "thrift://localhost:" + port); MetastoreConf.setBoolVar(conf, ConfVars.EXECUTE_SET_UGI, false); return new HiveMetaStoreClient(conf); } }
@Test public void testMetaConfDuplicateNotification() throws Exception { HiveMetaStoreClient closingClient = new HiveMetaStoreClient(conf, null); closingClient.setMetaConf(metaConfKey, metaConfVal); int beforeCloseNotificationEventCounts = DummyListener.notifyList.size(); closingClient.close(); Thread.sleep(2 * 1000); int afterCloseNotificationEventCounts = DummyListener.notifyList.size(); // Setting key to same value, should not trigger configChange event during shutdown assertEquals(beforeCloseNotificationEventCounts, afterCloseNotificationEventCounts); }
@Before public void setup() throws Exception { conf = new HiveConf(); TxnDbUtil.setConfValues(conf); TxnDbUtil.cleanDb(conf); ms = new HiveMetaStoreClient(conf); txnHandler = TxnUtils.getTxnStore(conf); tmpdir = new File(Files.createTempDirectory("compactor_test_table_").toString()); }
@BeforeClass public static void setupBeforeClass() throws Exception { System.setProperty(ConfVars.PARTITION_NAME_WHITELIST_PATTERN.toString(), partitionValidationPattern); conf = MetastoreConf.newMetastoreConf(); MetaStoreTestUtils.setConfForStandloneMode(conf); msc = new HiveMetaStoreClient(conf); }
public static void dropDB(HiveConf conf, String databaseName) throws HiveException, MetaException { IMetaStoreClient client = new HiveMetaStoreClient(conf); try { for (String table : client.listTableNamesByFilter(databaseName, "", (short) -1)) { client.dropTable(databaseName, table, true, true); } client.dropDatabase(databaseName); } catch (TException e) { client.close(); } }
@Before public void setUp() throws Exception { conf = MetastoreConf.newMetastoreConf(); System.setProperty(ConfVars.EVENT_LISTENERS.toString(), IpAddressListener.class.getName()); MetaStoreTestUtils.setConfForStandloneMode(conf); MetaStoreTestUtils.startMetaStoreWithRetry(HadoopThriftAuthBridge.getBridge(), conf); msc = new HiveMetaStoreClient(conf); }
@Before public void setUp() throws Exception { MetaStoreTestUtils.setConfForStandloneMode(conf); TxnDbUtil.setConfValues(conf); TxnDbUtil.prepDb(conf); client = new HiveMetaStoreClient(conf); String connectionStr = MetastoreConf.getVar(conf, MetastoreConf.ConfVars.CONNECT_URL_KEY); conn = DriverManager.getConnection(connectionStr); }
@Before public void setUp() throws MetaException { conf = MetastoreConf.newMetastoreConf(); MetaStoreTestUtils.setConfForStandloneMode(conf); MetastoreConf.setBoolVar(conf, MetastoreConf.ConfVars.AGGREGATE_STATS_CACHE_ENABLED, false); // Get new client client = new HiveMetaStoreClient(conf); }
@Before public void setUp() throws Exception { if (driver == null) { setUpHiveConf(); driver = DriverFactory.newDriver(hiveConf); client = new HiveMetaStoreClient(hiveConf); SessionState.start(new CliSessionState(hiveConf)); } }
@BeforeClass public static void setUp() throws Exception { HiveMetaStore.TEST_TIMEOUT_ENABLED = true; conf = MetastoreConf.newMetastoreConf(); MetastoreConf.setClass(conf, ConfVars.EXPRESSION_PROXY_CLASS, MockPartitionExpressionForMetastore.class, PartitionExpressionProxy.class); MetastoreConf.setTimeVar(conf, ConfVars.CLIENT_SOCKET_TIMEOUT, 1000, TimeUnit.MILLISECONDS); MetaStoreTestUtils.setConfForStandloneMode(conf); warehouse = new Warehouse(conf); client = new HiveMetaStoreClient(conf); }