@Test public void testCreate() throws TException { HiveConf hiveConf = new HiveConf(); HiveMetaStoreClientFactory factory = new HiveMetaStoreClientFactory(hiveConf); hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, ""); hiveConf.set(HIVE_METASTORE_TOKEN_SIGNATURE, ""); IMetaStoreClient msc = factory.create(); String dbName = "test_db"; String description = "test database"; String location = "file:/tmp/" + dbName; Database db = new Database(dbName, description, location, null); msc.dropDatabase(dbName, true, true); msc.createDatabase(db); db = msc.getDatabase(dbName); Assert.assertEquals(db.getName(), dbName); Assert.assertEquals(db.getDescription(), description); Assert.assertEquals(db.getLocationUri(), location); }
@Override public IMetaStoreClient create() { try { return createMetaStoreClient(); } catch (MetaException e) { throw new RuntimeException("Unable to create " + IMetaStoreClient.class.getSimpleName(), e); } }
HiveMetaStoreClientFactory extends BasePooledObjectFactory<IMetaStoreClient> { @Override public IMetaStoreClient create() { try { return createMetaStoreClient(); } catch (MetaException e) { throw new RuntimeException("Unable to create " + IMetaStoreClient.class.getSimpleName(), e); } } }
HiveMetaStoreClientFactory extends BasePooledObjectFactory<IMetaStoreClient> { @Override public IMetaStoreClient create() { try { return createMetaStoreClient(); } catch (MetaException e) { throw new RuntimeException("Unable to create " + IMetaStoreClient.class.getSimpleName(), e); } } HiveMetaStoreClientFactory(Optional<String> hcatURI);  HiveMetaStoreClientFactory(HiveConf hiveConf);  HiveMetaStoreClientFactory(); }
HiveMetaStoreClientFactory extends BasePooledObjectFactory<IMetaStoreClient> { @Override public IMetaStoreClient create() { try { return createMetaStoreClient(); } catch (MetaException e) { throw new RuntimeException("Unable to create " + IMetaStoreClient.class.getSimpleName(), e); } } HiveMetaStoreClientFactory(Optional<String> hcatURI);  HiveMetaStoreClientFactory(HiveConf hiveConf);  HiveMetaStoreClientFactory(); @Override IMetaStoreClient create(); @Override PooledObject<IMetaStoreClient> wrap(IMetaStoreClient client); @Override void destroyObject(PooledObject<IMetaStoreClient> client); }
HiveMetaStoreClientFactory extends BasePooledObjectFactory<IMetaStoreClient> { @Override public IMetaStoreClient create() { try { return createMetaStoreClient(); } catch (MetaException e) { throw new RuntimeException("Unable to create " + IMetaStoreClient.class.getSimpleName(), e); } } HiveMetaStoreClientFactory(Optional<String> hcatURI);  HiveMetaStoreClientFactory(HiveConf hiveConf);  HiveMetaStoreClientFactory(); @Override IMetaStoreClient create(); @Override PooledObject<IMetaStoreClient> wrap(IMetaStoreClient client); @Override void destroyObject(PooledObject<IMetaStoreClient> client); static final String HIVE_METASTORE_TOKEN_SIGNATURE; }