Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.SchemaFactory


    @Override
    protected void runInternal(Session session) {
        getServiceHolder().getDDLFunctions().setOnlineDDLMonitor(onlineDDLMonitor);
        try {
            SchemaFactory schemaFactory = new SchemaFactory(schema);
            if(server != null) {
                server.setSession(session);
                schemaFactory.ddl(getServiceHolder().getDDLFunctions(), session, descriptors, columnNames, server, ddl);
            } else {
                schemaFactory.ddl(getServiceHolder().getDDLFunctions(), session, ddl);
            }



        } finally {
View Full Code Here


                clazz.getName()
        );
    }

    protected void createFromDDL(String schema, String ddl) {
        SchemaFactory schemaFactory = new SchemaFactory(schema);
        schemaFactory.ddl(ddl(), session(), ddl);
    }
View Full Code Here

        builder.addJoinToGroup("group", "ca", 0);
        builder.createGroup("state", "schema");
        builder.addTableToGroup("state", "schema", "state");
        builder.groupingIsComplete();
       
        SchemaFactory factory = new SchemaFactory ("schema");
        factory.buildRowDefs(builder.akibanInformationSchema());
        return new Schema(builder.akibanInformationSchema());
    }
View Full Code Here

public class ProtobufRowDataConverterTest
{
    private static final String SCHEMA = "test";

    protected AkibanInformationSchema ais(String ddl) {
        AkibanInformationSchema ais = new SchemaFactory(SCHEMA).aisWithRowDefs(ddl);
        for (Table table : ais.getTables().values()) {
            if (!table.hasVersion()) {
                table.setVersion(0);
            }
            if (table.getUuid() == null)
View Full Code Here

        builder.addJoinToGroup("group", "oi", 0);
        builder.createGroup("state", "schema");
        builder.addTableToGroup("state", "schema", "state");
        builder.groupingIsComplete();
       
        SchemaFactory factory = new SchemaFactory ("schema");
        factory.buildRowDefs(builder.akibanInformationSchema());
        return new Schema(builder.akibanInformationSchema());
    }
View Full Code Here

        builder.addTableToGroup("state", "schema", "state");
        builder.createGroup("customer", "schema");
        builder.addTableToGroup("customer", "schema", "customer2");
        builder.groupingIsComplete();
       
        SchemaFactory factory = new SchemaFactory ("schema");
        factory.buildRowDefs(builder.akibanInformationSchema());
        return new Schema(builder.akibanInformationSchema());
    }
View Full Code Here

    public static final String DDL =
        "CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, s VARCHAR(32))";

    @Test
    public void reader() throws Exception {
        SchemaFactory schemaFactory = new SchemaFactory("test");
        AkibanInformationSchema ais = schemaFactory.aisWithRowDefs(DDL);
        Table t1 = ais.getTable("test", "t1");
        InputStream istr = new FileInputStream(DUMP_FILE);
        MysqlDumpRowReader reader = new MysqlDumpRowReader(t1, t1.getColumns(),
                                                           istr, "UTF-8",
                                                           null, MTypesTranslator.INSTANCE);
View Full Code Here

    public static final String DDL =
        "CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, t TIMESTAMP, n INT DEFAULT 100, s VARCHAR(128))";

    @Test
    public void reader() throws Exception {
        SchemaFactory schemaFactory = new SchemaFactory("test");
        AkibanInformationSchema ais = schemaFactory.aisWithRowDefs(DDL);
        Table t1 = ais.getTable("test", "t1");
        InputStream istr = new ByteArrayInputStream(Strings.join(CSV).getBytes("UTF-8"));
        List<Column> columns = new ArrayList<>(3);
        for (String cname : CSV[0].split(","))
            columns.add(t1.getColumn(cname));
View Full Code Here

    public static AkibanInformationSchema parseSchema(List<File> ddls) throws Exception {
        StringBuilder ddlBuilder = new StringBuilder();
        for (File ddl : ddls)
            ddlBuilder.append(fileContents(ddl));
        String sql = ddlBuilder.toString();
        SchemaFactory schemaFactory = new SchemaFactory(DEFAULT_SCHEMA);
        AkibanInformationSchema ret = schemaFactory.ais(sql);
        return ret;
    }
View Full Code Here

    }

    static final String DEFAULT_SCHEMA = "test";

    public void setSchema(String sql) throws Exception {
        SchemaFactory schemaFactory = new SchemaFactory(DEFAULT_SCHEMA);
        ais = schemaFactory.ais(sql);
        if (actions.contains(Action.BIND))
            binder = new AISBinder(ais, DEFAULT_SCHEMA);
        if (actions.contains(Action.OPERATORS))
            operatorCompiler = OperatorCompilerTest.TestOperatorCompiler.create(parser, ais, statsFile, compilerProperties);
        if (actions.contains(Action.PLAN))
View Full Code Here

TOP

Related Classes of com.foundationdb.server.rowdata.SchemaFactory

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.