Package com.foundationdb.ais.util.TableChangeValidator

Examples of com.foundationdb.ais.util.TableChangeValidator.ChangeLevel


                                            Table newTable,
                                            TableChangeValidator validator)
    {
        AkibanInformationSchema origAIS = origTable.getAIS();
        TableChangeValidatorState changeState = validator.getState();
        ChangeLevel changeLevel = validator.getFinalChangeLevel();

        List<Sequence> sequencesToDrop = new ArrayList<>();
        for(ChangedTableDescription desc : changeState.descriptions) {
            for(TableName name : desc.getDroppedSequences()) {
                sequencesToDrop.add(origAIS.getSequence(name));
View Full Code Here


        runAlter(changeLevel, SCHEMA, sql);
    }

    protected void runAlter(ChangeLevel expectedChangeLevel, TableName name, Table newDefinition,
                            List<TableChange> columnChanges, List<TableChange> indexChanges) {
        ChangeLevel actual = ddlForAlter().alterTable(session(), name, newDefinition, columnChanges, indexChanges, queryContext());
        assertEquals("ChangeLevel", expectedChangeLevel, actual);
    }
View Full Code Here

        if (alterTable.isTruncateTable()) {
            dmlFunctions.truncateTable(session, table.getTableId(), alterTable.isCascade());
            return null;
        }

        ChangeLevel level = null;
        if((alterTable.tableElementList != null) && !alterTable.tableElementList.isEmpty()) {
            level = processAlter(ddlFunctions, session, defaultSchemaName, table, alterTable.tableElementList, context);
        }

        if(level == null) {
View Full Code Here

        schemaManager.setOnlineDMLError(session, t.getTableId(), e.getMessage());
    }

    private void buildIndexesInternal(Session session, QueryContext context) {
        Collection<ChangeSet> changeSets = schemaManager.getOnlineChangeSets(session);
        ChangeLevel changeLevel = commonChangeLevel(changeSets);
        assert (changeLevel == ChangeLevel.INDEX || changeLevel == ChangeLevel.INDEX_CONSTRAINT) : changeSets;
        TransformCache transformCache = getTransformCache(session, null);
        Multimap<Group,RowType> tableIndexes = HashMultimap.create();
        Set<GroupIndex> groupIndexes = new HashSet<>();
        for(ChangeSet cs : changeSets) {
View Full Code Here

        }
    }

    private void alterInternal(Session session, QueryContext context) {
        final Collection<ChangeSet> changeSets = schemaManager.getOnlineChangeSets(session);
        final ChangeLevel changeLevel = commonChangeLevel(changeSets);
        assert (changeLevel == ChangeLevel.TABLE || changeLevel == ChangeLevel.GROUP) : changeSets;

        final AkibanInformationSchema origAIS = schemaManager.getAis(session);
        final AkibanInformationSchema newAIS = schemaManager.getOnlineAIS(session);
View Full Code Here

                                     TypesTranslator typesTranslator,
                                     Session session,
                                     ServerSession server,
                                     Store givenStore) {

        final ChangeLevel changeLevel = commonChangeLevel(changeSets);
        final Schema newSchema = SchemaCache.globalSchema(newAIS);
        Plannable deletePlan = null;
        Plannable insertPlan = null;
        for(ChangeSet cs : changeSets) {
            if(cs.hasSelectStatement()) {
View Full Code Here

        assert(context.getSession() != null);
        return new DelegatingContext(adapter, context);
    }

    public static ChangeLevel commonChangeLevel(Collection<ChangeSet> changeSets) {
        ChangeLevel level = null;
        for(ChangeSet cs : changeSets) {
            if(level == null) {
                level = ChangeLevel.valueOf(cs.getChangeLevel());
            } else if(!level.name().equals(cs.getChangeLevel())) {
                throw new IllegalStateException("Mixed ChangeLevels: " + changeSets);
            }
        }
        assert (level != null);
        return level;
View Full Code Here

TOP

Related Classes of com.foundationdb.ais.util.TableChangeValidator.ChangeLevel

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.