Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.TableName


        schemaManager.registerSystemRoutine(ais.getRoutine(SCHEMA, ADD_ROLE_PROC_NAME));
        schemaManager.registerSystemRoutine(ais.getRoutine(SCHEMA, ADD_USER_PROC_NAME));
    }

    protected void deregisterSystemObjects() {
        schemaManager.unRegisterSystemRoutine(new TableName(SCHEMA, ADD_ROLE_PROC_NAME));
        schemaManager.unRegisterSystemRoutine(new TableName(SCHEMA, ADD_USER_PROC_NAME));
    }
View Full Code Here


    private OnlineDDLMonitor onlineDDLMonitor;

    @Override
    public void createTable(Session session, Table table)
    {
        TableName tableName = schemaManager().createTableDefinition(session, table);
        Table newTable = getAIS(session).getTable(tableName);
        for(TableListener listener : listenerService.getTableListeners()) {
            listener.onCreate(session, newTable);
        }
    }
View Full Code Here

            onlineAt(OnlineDDLMonitor.Stage.PRE_METADATA);
            txnService.run(session, new Runnable() {
                @Override
                public void run() {
                    schemaManager().startOnline(session);
                    TableName tableName = schemaManager().createTableDefinition(session, table);
                    AkibanInformationSchema onlineAIS = schemaManager().getOnlineAIS(session);
                    int onlineTableID = onlineAIS.getTable(table.getName()).getTableId();
                    List<TableName> tableNames = getTableNames(session, server, queryExpression, table);
                    if(tableNames.size() > 1)
                        throw new UnsupportedCreateSelectException();
View Full Code Here

            } else {
                implicitlyDroppedTables.add(table);
            }
            // All children must be in the same schema
            for(Join childJoin : table.getChildJoins()) {
                final TableName childName = childJoin.getChild().getName();
                if(!childName.getSchemaName().equals(schemaName)) {
                    throw new ForeignConstraintDDLException(table.getName(), childName);
                }
            }
            // All referencing foreign keys must be in the same schema
            for(ForeignKey foreignKey : table.getReferencedForeignKeys()) {
                final TableName referencingName = foreignKey.getReferencingTable().getName();
                if(!referencingName.getSchemaName().equals(schemaName)) {
                    throw new ForeignKeyPreventsDropTableException(table.getName(), foreignKey.getConstraintName().getTableName(), referencingName);
                }
            }
        }
        for (SQLJJar jar : schema.getSQLJJars().values()) {
View Full Code Here

        List<ChangeSet> changeSets = new ArrayList<>();
        for(Integer tid : tableIDs) {
            ChangeSet.Builder cs = ChangeSet.newBuilder();
            cs.setChangeLevel(validator.getFinalChangeLevel().name());
            cs.setTableId(tid);
            final TableName oldName, newName;
            ChangedTableDescription desc = findByID(validator.getState().descriptions, tid);
            if(desc == null) {
                Table table = newAIS.getTable(tid);
                oldName = newName = table.getName();
            } else {
                oldName = desc.getOldName();
                newName = desc.getNewName();
            }
            cs.setOldSchema(oldName.getSchemaName());
            cs.setOldName(oldName.getTableName());
            cs.setNewSchema(newName.getSchemaName());
            cs.setNewName(newName.getTableName());

            Table oldTable = oldAIS.getTable(tid);
            Table newTable = newAIS.getTable(tid);
View Full Code Here

    {
        Attributes att = new Attributes();
       
        att.put(Label.NAME, PrimitiveExplainer.getInstance(getName()));
        att.put(Label.SCAN_OPTION, PrimitiveExplainer.getInstance(cursorCreator.describeRange()));
        TableName rootName = cursorCreator.group().getRoot().getName();
        att.put(Label.TABLE_SCHEMA, PrimitiveExplainer.getInstance(rootName.getSchemaName()));
        att.put(Label.TABLE_NAME, PrimitiveExplainer.getInstance(rootName.getTableName()));
        return new CompoundExplainer(Type.SCAN_OPERATOR, att);
    }
View Full Code Here

        }
    }
   
    private void checkTableID (AISValidationOutput failures, Map<Integer, Table> tableIDList, Table table) {
        if (tableIDList.containsKey(table.getTableId())) {
            TableName name = tableIDList.get(table.getTableId()).getName();
           
            failures.reportFailure(new AISValidationFailure (
                    new DuplicateTableIdException(table.getName(), name)));
        } else {
            tableIDList.put(table.getTableId(), table);
View Full Code Here

    public TableName registerStoredInformationSchemaTable(final Table newTable, final int version) {
        try(Session session = sessionService.createSession()) {
            txnService.run(session, new Runnable() {
                @Override
                public void run() {
                    final TableName newName = newTable.getName();
                    checkSystemSchema(newName, true);
                    Table curTable = getAISForChange(session, false).getTable(newName);
                    if(curTable != null) {
                        Integer oldVersion = curTable.getVersion();
                        if(oldVersion != null && oldVersion == version) {
View Full Code Here

        saveAISChange(session, newAIS, schemas, tableIDs);
    }

    @Override
    public void dropTableDefinition(Session session, String schemaName, String tableName, DropBehavior dropBehavior) {
        dropTableCommon(session, new TableName(schemaName, tableName), dropBehavior, false, false);
    }
View Full Code Here

        AkibanInformationSchema oldAIS = getAISForChange(session);
        Set<String> schemas = new HashSet<>();
        List<Integer> tableIDs = new ArrayList<>(alteredTables.size());
        for(ChangedTableDescription desc : alteredTables) {
            TableName oldName = desc.getOldName();
            TableName newName = desc.getNewName();
            checkTableName(session, oldName, true, false);
            if(!oldName.equals(newName)) {
                checkTableName(session, newName, false, false);
            }
            Table newTable = desc.getNewDefinition();
            if(newTable != null) {
                AISInvariants.checkJoinTo(newTable.getParentJoin(), newName, false);
                if(newTable.getColumns().isEmpty()) {
                    throw new NoColumnsInTableException(newName);
                }
            }
            schemas.add(oldName.getSchemaName());
            schemas.add(newName.getSchemaName());
            tableIDs.add(oldAIS.getTable(oldName).getTableId());
        }

        AISMerge merge = AISMerge.newForModifyTable(aisCloner, getNameGenerator(session), oldAIS, alteredTables);
        merge.merge();
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.model.TableName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.