Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.Table


    }

    private static Table commonAncestor(Table inputTable, Table outputTable)
    {
        int minLevel = min(inputTable.getDepth(), outputTable.getDepth());
        Table inputAncestor = inputTable;
        while (inputAncestor.getDepth() > minLevel) {
            inputAncestor = inputAncestor.getParentTable();
        }
        Table outputAncestor = outputTable;
        while (outputAncestor.getDepth() > minLevel) {
            outputAncestor = outputAncestor.getParentTable();
        }
        while (inputAncestor != outputAncestor) {
            inputAncestor = inputAncestor.getParentTable();
            outputAncestor = outputAncestor.getParentTable();
        }
        return outputAncestor;
    }
View Full Code Here


        return indexScanCreator(tID, INDEX);
    }

    @Override
    protected void postCheckAIS(AkibanInformationSchema ais) {
        Table table = ais.getTable(SCHEMA, TABLE);
        assertNotNull("index present", table.getIndex(INDEX));
    }
View Full Code Here

        return null;
    }

    @Override
    protected void postCheckAIS(AkibanInformationSchema ais) {
        Table table = ais.getTable(SCHEMA, TABLE);
        Column column = table.getColumn(COLUMN);
        assertEquals("column nullable", expectedNullable, column.getNullable());
    }
View Full Code Here

        return null;
}

    @Override
    protected void postCheckAIS(AkibanInformationSchema ais) {
        Table table = ais.getTable(SCHEMA, CHILD_TABLE);
        List<String> fks = new ArrayList<>();
        for(ForeignKey f : table.getReferencingForeignKeys()) {
            fks.add(f.getConstraintName().getTableName());
        }
        assertEquals(expectedFKPresent ? "[fk1]" : "[]", fks.toString());
    }
View Full Code Here

        }
        return create((GroupIndex)index, policy);
    }

    private static IndexScanSelector create(GroupIndex index, SelectorCreationPolicy policy) {
        Table giLeaf = index.leafMostTable();
        List<Table> requiredTables = new ArrayList<>(giLeaf.getDepth());
        for(Table table = giLeaf, end = index.rootMostTable().getParentTable();
            table != null && !table.equals(end);
            table = table.getParentTable()
        ) {
            if (policy.include(table))
View Full Code Here

        return null;
    }

    @Override
    protected void postCheckAIS(AkibanInformationSchema ais) {
        Table table = ais.getTable(tID);
        Column column = table.getColumn(COLUMN_NAME);
        assertNotNull("new column present", column);
    }
View Full Code Here

            throw new IllegalArgumentException(rowType + " not in branch: " + allTablesForBranch);
        }

        public BranchTables(Schema schema, GroupIndex groupIndex) {
            List<TableRowType> localTables = new ArrayList<>();
            Table rootmost = groupIndex.rootMostTable();
            int branchRootmostIndex = -1;
            for (Table table = groupIndex.leafMostTable(); table != null; table = table.getParentTable()) {
                if (table.equals(rootmost)) {
                    assert branchRootmostIndex == -1 : branchRootmostIndex;
                    branchRootmostIndex = table.getDepth();
View Full Code Here

                throw new ProtectedTableDDLException (table.getName());
            return store.createAdapter(session, schema);
        }

        private Table getTable () {
            Table table = ais.getTable(tableName);
            if (table == null) {
                throw new NoSuchTableException(tableName.getSchemaName(), tableName.getTableName());
            } else if (table.isProtectedTable()) {
                throw  new ProtectedTableDDLException (table.getName());
            }
            return table;
        }
View Full Code Here

        Operator operator;
        RowType rowType;
    }
   
    protected Operator indexAncestorLookup(TableName tableName) {
        Table table = ais().getTable(tableName);
        return PlanGenerator.generateAncestorPlan(ais(), table);
    }
View Full Code Here

                throw new IllegalStateException("Unknown index type: " + index);
        }
    }

    protected RowDef getIndexStatsRowDef(Session session) {
        Table table = store.getAIS(session).getTable(INDEX_STATISTICS_TABLE_NAME);
        assert (table != null);
        return table.rowDef();
    }
View Full Code Here

TOP

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

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.