/** * Closes the client releasing any {@link IMetaStoreClient meta store} connections held. Does not notify any open * transactions (TODO: perhaps it should?) */ @Override public void close() throws IOException { metaStoreClient.close(); LOG.debug("Closed client."); connected = false; }
public static void closeHiveClientQuietly(IMetaStoreClient client) { try { if (client != null) client.close(); } catch (Exception e) { LOG.debug("Error closing metastore client. Ignored the error.", e); } }
@After public void tearDown() throws Exception { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } client = null; }
@After public void tearDown() throws Exception { try { if (client != null) { client.close(); } } finally { client = null; } }
@After public void tearDown() throws Exception { try { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } } finally { client = null; } }
@After public void tearDown() throws Exception { try { if (client != null) { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } } } finally { client = null; } }
@After public void tearDown() throws Exception { try { if (client != null) { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } } } finally { client = null; } }
@After public void tearDown() throws Exception { try { if (client != null) { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } } } finally { client = null; } }
@After public void tearDown() throws Exception { try { if (client != null) { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } } } finally { client = null; } }
@After public void tearDown() throws Exception { try { if (client != null) { try { client.close(); } catch (Exception e) { // HIVE-19729: Shallow the exceptions based on the discussion in the Jira } } } finally { client = null; } }
@Test public void closeSucceeds() throws IOException { helper.close(); verify(mockClient).close(); }
@After public void cleanup() { msClient.close(); driver.close(); }
@After public void dropCatalog() throws TException { MetaStoreTestUtils.dropCatalogCascade(catalogCapableClient, catName); catalogCapableClient.close(); }
@After public void cleanup() throws Exception { msClient.close(); driver.close(); }
@After public void cleanup() throws Exception { msClient.close(); driver.close(); }
@Test public void testCloseClosesClient() throws Exception { client.close(); assertThat(client.isConnected(), is(false)); verify(mockMetaStoreClient).close(); }
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(); } }
@Override protected IMetaStoreClient getClient() throws Exception { // Separate client to create the catalog catalogCapableClient = new HiveMetaStoreClient(conf); catLocation = MetaStoreTestUtils.getTestWarehouseDir(catName); Catalog cat = new CatalogBuilder() .setName(catName) .setLocation(catLocation) .build(); catalogCapableClient.createCatalog(cat); catalogCapableClient.close(); MetastoreConf.setVar(conf, MetastoreConf.ConfVars.CATALOG_DEFAULT, catName); return new HiveMetaStoreClientPreCatalog(conf); }
@Test(timeout=40000) public void testSimpleUpdateWithThreads() throws Exception { StatsUpdaterThread su = createUpdater(); su.startWorkers(); IMetaStoreClient msClient = new HiveMetaStoreClient(hiveConf); executeQuery("create table simple_stats (i int, s string)"); executeQuery("insert into simple_stats (i, s) values (1, 'test')"); verifyAndUnsetColStats("simple_stats", Lists.newArrayList("i"), msClient); assertTrue(su.runOneIteration()); su.waitForQueuedCommands(); verifyStatsUpToDate("simple_stats", Lists.newArrayList("i"), msClient, true); msClient.close(); }