Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.AkibanInformationSchema


     * @param tableNames List of table names to check.
     * @throws Exception For any internal error.
     */
    private void assertTablesInSchema(String schema, String... tableNames) {
        final SortedSet<String> expected = new TreeSet<>();
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : tableNames) {
            final Table table = ais.getTable(schema, name);
            assertNotNull(schema + "." + name + " in AIS", table);
            expected.add(name);
        }
        final SortedSet<String> actual = new TreeSet<>();
        Schema schemaObj = ais.getSchema(schema);
        if(schemaObj != null) {
            actual.addAll(schemaObj.getTables().keySet());
        }
        assertEquals("tables in: " + schema, expected, actual);
    }
View Full Code Here


            String scratchString = scratch.toString();
            assertTrue(scratchString, scratchString.endsWith(" => "));
            assertNotNull(giToCheck);

            Set<Table> containingTables = new HashSet<>();
            AkibanInformationSchema ais = ddl().getAIS(session());
            containingTables.add(ais.getTable(firstTableId));
            for (int tableId : tableIds) {
                containingTables.add(ais.getTable(tableId));
            }
            long result = 0;
            for(Table table = giToCheck.leafMostTable();
                table != giToCheck.rootMostTable().getParentTable();
                table = table.getParentTable())
View Full Code Here

            }
        }
    }

    private static Index createSimpleIndex(Table curTable, String columnName) {
        AkibanInformationSchema ais = new AkibanInformationSchema();
        Table newTable = Table.create(ais, curTable.getName().getSchemaName(), curTable.getName().getTableName(), 0);
        Index newIndex = TableIndex.create(ais, newTable, columnName, 0, false, false);
        Column curColumn = curTable.getColumn(columnName);
        Column newColumn = Column.create(newTable,  curColumn.getName(), curColumn.getPosition(), curColumn.getType());
        IndexColumn.create(newIndex, newColumn, 0, true, null);
View Full Code Here

    }

    private int loadBlocksTable() throws InvalidOperationException, IOException {
        final String blocksDDL = Strings.join(Strings.dumpResource(getClass(), "blocks-table.ddl"));
        createFromDDL("drupal", blocksDDL);
        AkibanInformationSchema ais = ddl().getAIS(session());
        assertNotNull("drupal.blocks missing from " + ais.getTables(), ais.getTable("drupal", "blocks"));
        return tableId("drupal", "blocks");
    }
View Full Code Here

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public final class DropSchemaIT extends ITBase {
    private void expectTables(String schemaName, String... tableNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : tableNames) {
            final Table table = ais.getTable(schemaName, name);
            assertNotNull(schemaName + " " + name + " doesn't exist", table);
        }
    }
View Full Code Here

            assertNotNull(schemaName + " " + name + " doesn't exist", table);
        }
    }

    private void expectNotTables(String schemaName, String... tableNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : tableNames) {
            final Table table = ais.getTable(schemaName, name);
            assertNull(schemaName + " " + name + " still exists", table);
        }
    }
View Full Code Here

            assertNull(schemaName + " " + name + " still exists", table);
        }
    }

    private void expectRoutines(String schemaName, String... routineNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : routineNames) {
            final Routine routine = ais.getRoutine(schemaName, name);
            assertNotNull(schemaName + " " + name + " doesn't exist", routine);
        }
    }
View Full Code Here

            assertNotNull(schemaName + " " + name + " doesn't exist", routine);
        }
    }

    private void expectNotRoutines(String schemaName, String... routineNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : routineNames) {
            final Routine routine = ais.getRoutine(schemaName, name);
            assertNull(schemaName + " " + name + " still exists", routine);
        }
    }
View Full Code Here

            assertNull(schemaName + " " + name + " still exists", routine);
        }
    }

    private void expectSqljJars(String schemaName, String... sqljJarNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : sqljJarNames) {
            final SQLJJar sqljJar = ais.getSQLJJar(schemaName, name);
            assertNotNull(schemaName + " " + name + " doesn't exist", sqljJar);
        }
    }
View Full Code Here

            assertNotNull(schemaName + " " + name + " doesn't exist", sqljJar);
        }
    }

    private void expectNotSqljJars(String schemaName, String... sqljJarNames) {
        final AkibanInformationSchema ais = ddl().getAIS(session());
        for (String name : sqljJarNames) {
            final SQLJJar sqljJar = ais.getSQLJJar(schemaName, name);
            assertNull(schemaName + " " + name + " still exists", sqljJar);
        }
    }
View Full Code Here

TOP

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

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.