catalog.alterTablespace(alterTablespace); } catch (TajoException e) { throw new TajoInternalError(e);
catalog.alterTablespace(alterTablespace); } catch (TajoException e) { throw new TajoInternalError(e);
/** * Alter a given table */ public static void alterTablespace(final TajoMaster.MasterContext context, final QueryContext queryContext, final AlterTablespaceNode alterTablespace) throws UndefinedTablespaceException, InsufficientPrivilegeException { final CatalogService catalog = context.getCatalog(); final String spaceName = alterTablespace.getTablespaceName(); AlterTablespaceProto.Builder builder = AlterTablespaceProto.newBuilder(); builder.setSpaceName(spaceName); if (alterTablespace.getSetType() == AlterTablespaceSetType.LOCATION) { AlterTablespaceProto.AlterTablespaceCommand.Builder commandBuilder = AlterTablespaceProto.AlterTablespaceCommand.newBuilder(); commandBuilder.setType(AlterTablespaceProto.AlterTablespaceType.LOCATION); commandBuilder.setLocation(alterTablespace.getLocation()); commandBuilder.build(); builder.addCommand(commandBuilder); } else { throw new RuntimeException("This 'ALTER TABLESPACE' is not supported yet."); } catalog.alterTablespace(builder.build()); }
/** * Alter a given table */ public static void alterTablespace(final TajoMaster.MasterContext context, final QueryContext queryContext, final AlterTablespaceNode alterTablespace) throws UndefinedTablespaceException, InsufficientPrivilegeException { final CatalogService catalog = context.getCatalog(); final String spaceName = alterTablespace.getTablespaceName(); AlterTablespaceProto.Builder builder = AlterTablespaceProto.newBuilder(); builder.setSpaceName(spaceName); if (alterTablespace.getSetType() == AlterTablespaceSetType.LOCATION) { AlterTablespaceProto.AlterTablespaceCommand.Builder commandBuilder = AlterTablespaceProto.AlterTablespaceCommand.newBuilder(); commandBuilder.setType(AlterTablespaceProto.AlterTablespaceType.LOCATION); commandBuilder.setLocation(alterTablespace.getLocation()); commandBuilder.build(); builder.addCommand(commandBuilder); } else { throw new RuntimeException("This 'ALTER TABLESPACE' is not supported yet."); } catalog.alterTablespace(builder.build()); }