@Test(expected = MetaStoreException.class) public void alterTable_shouldWrapTException() throws Exception { doThrow(TException.class).when(metaStoreClient).alter_table(anyString(), anyString(), isNull()); underTest.alterTable(TABLE, schema, 1); }
public void alterTable(String tableName, Schema schema, int version) throws MetaStoreException { try { Table table = metaStoreClient.getTable(databaseName, tableName); Table alteredTable = hiveTableStrategy.alterHiveTable(table, schema, version); metaStoreClient.alter_table(databaseName, tableName, alteredTable); } catch (TException e) { throw new MetaStoreException(e); } }
HiveTableManager { public void alterTable(String tableName, Schema schema, int version) throws MetaStoreException { try { Table table = metaStoreClient.getTable(databaseName, tableName); Table alteredTable = hiveTableStrategy.alterHiveTable(table, schema, version); metaStoreClient.alter_table(databaseName, tableName, alteredTable); } catch (TException e) { throw new MetaStoreException(e); } } }
HiveTableManager { public void alterTable(String tableName, Schema schema, int version) throws MetaStoreException { try { Table table = metaStoreClient.getTable(databaseName, tableName); Table alteredTable = hiveTableStrategy.alterHiveTable(table, schema, version); metaStoreClient.alter_table(databaseName, tableName, alteredTable); } catch (TException e) { throw new MetaStoreException(e); } }  }
HiveTableManager { public void alterTable(String tableName, Schema schema, int version) throws MetaStoreException { try { Table table = metaStoreClient.getTable(databaseName, tableName); Table alteredTable = hiveTableStrategy.alterHiveTable(table, schema, version); metaStoreClient.alter_table(databaseName, tableName, alteredTable); } catch (TException e) { throw new MetaStoreException(e); } }  boolean tableExists(String tableName); Table createTable(String tableName, String partitionColumnName, Schema schema, int version, String owner); void grantPublicSelect(String tableName, String grantor); void alterTable(String tableName, Schema schema, int version); int getSchemaVersion(String tableName); }
HiveTableManager { public void alterTable(String tableName, Schema schema, int version) throws MetaStoreException { try { Table table = metaStoreClient.getTable(databaseName, tableName); Table alteredTable = hiveTableStrategy.alterHiveTable(table, schema, version); metaStoreClient.alter_table(databaseName, tableName, alteredTable); } catch (TException e) { throw new MetaStoreException(e); } }  boolean tableExists(String tableName); Table createTable(String tableName, String partitionColumnName, Schema schema, int version, String owner); void grantPublicSelect(String tableName, String grantor); void alterTable(String tableName, Schema schema, int version); int getSchemaVersion(String tableName);  }