public void createTable(Table tbl, EnvironmentContext envContext) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { if (!tbl.isSetCatName()) { tbl.setCatName(getDefaultCatalog(conf)); } HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { // Subclasses can override this step (for example, for temporary tables) create_table_with_environment_context(tbl, envContext); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { try { hook.rollbackCreateTable(tbl); } catch (Exception e){ LOG.error("Create rollback failed with", e); } } } }
hook.preDropTable(tbl); drop_table_with_environment_context(catName, dbname, name, deleteData, envContext); if (hook != null) { hook.commitDropTable(tbl, deleteData || (envContext != null && "TRUE".equals(envContext.getProperties().get("ifPurge")))); hook.rollbackDropTable(tbl);
public void createTable(Table tbl, EnvironmentContext envContext) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { // Subclasses can override this step (for example, for temporary tables) create_table_with_environment_context(tbl, envContext); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { try { hook.rollbackCreateTable(tbl); } catch (Exception e){ LOG.error("Create rollback failed with", e); } } } }
hook.preDropTable(table); client.drop_table_with_environment_context(dbNameWithCatalog, table.getTableName(), deleteData, null); hook.commitDropTable(table, deleteData); success = true; } finally { if (!success) { hook.rollbackDropTable(table);
@Override public void createTableWithConstraints(Table tbl, List<SQLPrimaryKey> primaryKeys, List<SQLForeignKey> foreignKeys, List<SQLUniqueConstraint> uniqueConstraints, List<SQLNotNullConstraint> notNullConstraints, List<SQLDefaultConstraint> defaultConstraints, List<SQLCheckConstraint> checkConstraints) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { // Subclasses can override this step (for example, for temporary tables) client.create_table_with_constraints(tbl, primaryKeys, foreignKeys, uniqueConstraints, notNullConstraints, defaultConstraints, checkConstraints); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { hook.rollbackCreateTable(tbl); } } }
continue; hook.preDropTable(table); continue; hook.commitDropTable(table, deleteData); continue; hook.rollbackDropTable(table);
hook.preCreateTable(tbl); uniqueConstraints, notNullConstraints, defaultConstraints, checkConstraints); if (hook != null) { hook.commitCreateTable(tbl); hook.rollbackCreateTable(tbl);
hook.preDropTable(tbl); drop_table_with_environment_context(dbname, name, deleteData, envContext); if (hook != null) { hook.commitDropTable(tbl, deleteData || (envContext != null && "TRUE".equals(envContext.getProperties().get("ifPurge")))); hook.rollbackDropTable(tbl);
public void createTable(Table tbl, EnvironmentContext envContext) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { client.create_table_with_environment_context(tbl, envContext); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { hook.rollbackCreateTable(tbl); } } }
hook.preDropTable(tbl); client.drop_table(dbname, name, deleteData); if (hook != null) { hook.commitDropTable(tbl, deleteData); hook.rollbackDropTable(tbl);
public void createTable(Table tbl, EnvironmentContext envContext) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { // Subclasses can override this step (for example, for temporary tables) create_table_with_environment_context(tbl, envContext); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { hook.rollbackCreateTable(tbl); } } }
hook.preDropTable(tbl); client.drop_table_with_environment_context(dbname, name, deleteData, envContext); if (hook != null) { hook.commitDropTable(tbl, deleteData); hook.rollbackDropTable(tbl);
public void createTable(Table tbl, EnvironmentContext envContext) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { // Subclasses can override this step (for example, for temporary tables) create_table_with_environment_context(tbl, envContext); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { hook.rollbackCreateTable(tbl); } } }
hook.preDropTable(tbl); drop_table_with_environment_context(dbname, name, deleteData, envContext); if (hook != null) { hook.commitDropTable(tbl, deleteData); hook.rollbackDropTable(tbl);
/** * @param tbl * @throws MetaException * @throws NoSuchObjectException * @throws TException * @see org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore.Iface#create_table(org.apache.hadoop.hive.metastore.api.Table) */ public void createTable(Table tbl) throws AlreadyExistsException, InvalidObjectException, MetaException, NoSuchObjectException, TException { HiveMetaHook hook = getHook(tbl); if (hook != null) { hook.preCreateTable(tbl); } boolean success = false; try { client.create_table(tbl); if (hook != null) { hook.commitCreateTable(tbl); } success = true; } finally { if (!success && (hook != null)) { hook.rollbackCreateTable(tbl); } } }
hook.preDropTable(tbl); drop_table_with_environment_context(dbname, name, deleteData, envContext); if (hook != null) { hook.commitDropTable(tbl, deleteData); hook.rollbackDropTable(tbl);