Examples of DDLFunctions


Examples of com.foundationdb.server.api.DDLFunctions

    private final ConfigurationService configService;

    @Override
    public void start() {
        List<DXLFunctionsHook> hooks = getHooks();
        DDLFunctions localDdlFunctions = new HookableDDLFunctions(createDDLFunctions(), hooks, sessionService);
        DMLFunctions localDmlFunctions = new HookableDMLFunctions(createDMLFunctions(), hooks);
        synchronized (MONITOR) {
            if (ddlFunctions != null) {
                throw new ServiceStartupException("service already started");
            }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

        }
    }

    @Override
    public DDLFunctions ddlFunctions() {
        final DDLFunctions ret = ddlFunctions;
        if (ret == null) {
            throw new ServiceNotStartedException("DDL Functions");
        }
        return ret;
    }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

    public static void install(String url, String jar, long deploy) {
        ServerQueryContext context = ServerCallContextStack.getCallingContext();
        ServerSession server = context.getServer();
        TableName jarName = jarName(server, jar);
        DDLFunctions ddl = server.getDXL().ddlFunctions();
        NewAISBuilder aisb = AISBBasedBuilder.create(server.getDefaultSchemaName(),
                                                     ddl.getTypesTranslator());
        aisb.sqljJar(jarName).url(url, true);
        SQLJJar sqljJar = aisb.ais().getSQLJJar(jarName);
        ddl.createSQLJJar(server.getSession(), sqljJar);
        if (deploy != 0) {
            new SQLJJarDeployer(context, jarName).deploy();
        }
    }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

    public static void replace(String url, String jar) {
        ServerQueryContext context = ServerCallContextStack.getCallingContext();
        ServerSession server = context.getServer();
        TableName jarName = jarName(server, jar);
        DDLFunctions ddl = server.getDXL().ddlFunctions();
        NewAISBuilder aisb = AISBBasedBuilder.create(server.getDefaultSchemaName(),
                                                     ddl.getTypesTranslator());
        aisb.sqljJar(jarName).url(url, true);
        SQLJJar sqljJar = aisb.ais().getSQLJJar(jarName);
        ddl.replaceSQLJJar(server.getSession(), sqljJar);
        server.getRoutineLoader().checkUnloadSQLJJar(server.getSession(), jarName);
    }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

    public static void remove(String jar, long undeploy) {
        ServerQueryContext context = ServerCallContextStack.getCallingContext();
        ServerSession server = context.getServer();
        TableName jarName = jarName(server, jar);
        DDLFunctions ddl = server.getDXL().ddlFunctions();
        if (undeploy != 0) {
            new SQLJJarDeployer(context, jarName).undeploy();
        }
        ddl.dropSQLJJar(server.getSession(), jarName);
        server.getRoutineLoader().checkUnloadSQLJJar(server.getSession(), jarName);
    }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

                               ServerQueryContext<?> context) {
        ServerSession server = context.getServer();
        AkibanInformationSchema ais = server.getAIS();
        String schema = server.getDefaultSchemaName();
        logger.info("DDL in {}: {}", schema, sql);
        DDLFunctions ddlFunctions = server.getDXL().ddlFunctions();
        Session session = server.getSession();
        switch (ddl.getNodeType()) {
        case NodeTypes.CREATE_SCHEMA_NODE:
            SchemaDDL.createSchema(ais, schema, (CreateSchemaNode)ddl, context);
            return;
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

                rollbackTransaction();
        }
    }

    protected void updateAIS(EmbeddedQueryContext context) {
        DDLFunctions ddl = reqs.dxl().ddlFunctions();
        AkibanInformationSchema newAIS = ddl.getAIS(session);
        if ((ais != null) && (ais.getGeneration() == newAIS.getGeneration()))
            return;             // Unchanged.
        ais = newAIS;
        rebuildCompiler();
    }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

    }

    // When the AIS changes, throw everything away, since it might
    // point to obsolete objects.
    protected void updateAIS(PostgresQueryContext context) {
        DDLFunctions ddl = reqs.dxl().ddlFunctions();
        AkibanInformationSchema newAIS = ddl.getAIS(session);
        if ((ais != null) && (ais.getGeneration() == newAIS.getGeneration()))
            return;             // Unchanged.
        ais = newAIS;
        rebuildCompiler();
    }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

        //if this is a create table node with a query expression use special case
        if(ddl.getNodeType() == NodeTypes.CREATE_TABLE_NODE && ((CreateTableNode)ddl).getQueryExpression() != null){
            try{
                preExecute(context, DXLFunction.UNSPECIFIED_DDL_WRITE);
                String schema = server.getDefaultSchemaName();
                DDLFunctions ddlFunctions = server.getDXL().ddlFunctions();
                Session session = server.getSession();
                List<DataTypeDescriptor> descriptors = new ArrayList<>();
                for(PostgresType columnType: columnTypes){
                    descriptors.add(columnType.getType().dataTypeDescriptor());
                }
View Full Code Here

Examples of com.foundationdb.server.api.DDLFunctions

        AkibanInformationSchema ais = new AkibanInformationSchema();
       
        StatementNode stmt = parser.parseStatement(sql);
        assertTrue (stmt instanceof DropSchemaNode);
       
        DDLFunctions ddlFunctions = new TableDDLTest.DDLFunctionsMock(ais);
       
        SchemaDDL.dropSchema(ddlFunctions, null, (DropSchemaNode)stmt, null);
    }
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.