Package com.foundationdb.ais.model.aisb2

Examples of com.foundationdb.ais.model.aisb2.NewAISBuilder.table()


    @Test
    public void onlineWithNewIndex() {
        createTable(SCHEMA, T1_NAME, "x int");

        NewAISBuilder builder = AISBBasedBuilder.create(SCHEMA, schemaManager.getTypesTranslator());
        builder.table(SCHEMA, T1_NAME).colInt("x").key("x", "x");
        final Index index = builder.unvalidatedAIS().getTable(SCHEMA, T1_NAME).getIndex("x");

        transactionallyUnchecked( new Runnable() {
            @Override
            public void run() {
View Full Code Here


    @Test
    public void onlineDiscardNewIndex() {
        final int tid = createTable(SCHEMA, T1_NAME, "x int");

        NewAISBuilder builder = AISBBasedBuilder.create(SCHEMA, schemaManager.getTypesTranslator());
        builder.table(SCHEMA, T1_NAME).colInt("x").key("x", "x");
        final Index index = builder.unvalidatedAIS().getTable(SCHEMA, T1_NAME).getIndex("x");

        transactionallyUnchecked( new Runnable() {
            @Override
            public void run() {
View Full Code Here

        assertEquals("tables in: " + schema, expected, actual);
    }

    private static Table makeSimpleISTable(TableName name, TypesTranslator typesTranslator) {
        NewAISBuilder builder = AISBBasedBuilder.create(name.getSchemaName(), typesTranslator);
        builder.table(name.getTableName()).colInt("id", false).pk("id");
        return builder.ais().getTable(name);
    }

    private static class MemoryTableFactoryMock implements MemoryTableFactory {
        @Override
View Full Code Here

    }

    private void registerSummaryTable() {
        SchemaManagerSummaryFactory factory = new SchemaManagerSummaryFactory();
        NewAISBuilder builder = AISBBasedBuilder.create(getTypesTranslator());
        builder.table(factory.getName())
                .colBigInt("cache_misses", false)
                .colBigInt("delayed_tree_count", false)
                .colBigInt("latest_generation", true)
                .colBigInt("latest_timestamp", true)
                .colBigInt("load_count", false)
View Full Code Here

        protected abstract void buildTable(NewTableBuilder builder);

        public Table table(TypesTranslator typesTranslator) {
            NewAISBuilder builder = AISBBasedBuilder.create(typesTranslator);
            buildTable(builder.table(getName()));
            return builder.ais(false).getTable(getName());
        }

        protected MemTableBase(TableName tableName) {
            super(tableName);
View Full Code Here

public class PrimaryKeyParserTest {
    private static Index createIndex(int colCount, boolean binary) {
        NewAISBuilder builder = AISBBasedBuilder.create("test",
                                                        MTypesTranslator.INSTANCE);
        String[] colNames = new String[colCount];
        NewTableBuilder table = builder.table("t");
        char colName = 'a';
        for(int i = 0; i < colCount; ++i) {
            colNames[i] = String.valueOf(colName++);
            if (binary) {
                table.colVarBinary(colNames[i], 16, false);
View Full Code Here

    public static NewAISBuilder createAndFillBuilder(String schema) {
        TypesTranslator typesTranslator = MTypesTranslator.INSTANCE;
        NewAISBuilder builder = AISBBasedBuilder.create(schema, typesTranslator);

        builder.table(CUSTOMER_TABLE).
                colBigInt("customer_id", false).
                colString("customer_name", 100, false).
                pk("customer_id");

        builder.table(ADDRESS_TABLE).
View Full Code Here

        builder.table(CUSTOMER_TABLE).
                colBigInt("customer_id", false).
                colString("customer_name", 100, false).
                pk("customer_id");

        builder.table(ADDRESS_TABLE).
                colBigInt("customer_id", false).
                colInt("instance_id", false).
                colString("address_line1", 60, false).
                colString("address_line2", 60, false).
                colString("address_line3", 60, false).
View Full Code Here

                colString("address_line2", 60, false).
                colString("address_line3", 60, false).
                pk("customer_id", "instance_id").
                joinTo("customer").on("customer_id", "customer_id");

        builder.table(ORDER_TABLE).
                colBigInt("order_id", false).
                colBigInt("customer_id", false).
                colInt("order_date", false).
                pk("order_id").
                joinTo("customer").on("customer_id", "customer_id");
View Full Code Here

                colBigInt("customer_id", false).
                colInt("order_date", false).
                pk("order_id").
                joinTo("customer").on("customer_id", "customer_id");

        builder.table(ITEM_TABLE).
                colBigInt("order_id", false).
                colBigInt("part_id", false).
                colInt("quantity", false).
                colInt("unit_price", false).
                pk("part_id").
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.