Package com.foundationdb.ais.model

Examples of com.foundationdb.ais.model.AkibanInformationSchema


        return getSessionAIS(session);
    }

    @Override
    public void createView(Session session, View view) {
        final AkibanInformationSchema oldAIS = getAISForChange(session);
        checkSystemSchema(view.getName(), false);
        if (oldAIS.getView(view.getName()) != null)
            throw new DuplicateViewException(view.getName());
        AkibanInformationSchema newAIS = AISMerge.mergeView(aisCloner, oldAIS, view);
        final String schemaName = view.getName().getSchemaName();
        saveAISChange(session, newAIS, Collections.singleton(schemaName));
    }
View Full Code Here


        saveAISChange(session, newAIS, Collections.singleton(schemaName));
    }

    @Override
    public void dropView(Session session, TableName viewName) {
        final AkibanInformationSchema oldAIS = getAISForChange(session);
        checkSystemSchema(viewName, false);
        if (oldAIS.getView(viewName) == null)
            throw new UndefinedViewException(viewName);
        final AkibanInformationSchema newAIS = aisCloner.clone(oldAIS);
        newAIS.removeView(viewName);
        final String schemaName = viewName.getSchemaName();
        saveAISChange(session, newAIS, Collections.singleton(schemaName));
    }
View Full Code Here

    @Override
    public void dumpAllAsJson(Session session, PrintWriter writer,
                              String schemaName, String tableName,
                              int depth, boolean withTransaction, FormatOptions options) {
        AkibanInformationSchema ais = dxlService.ddlFunctions().getAIS(session);
        Table table = getTable(ais, schemaName, tableName);
        logger.debug("Writing all of {}", table);
        PlanGenerator generator = ais.getCachedValue(this, CACHED_PLAN_GENERATOR);
        Operator plan = generator.generateScanPlan(table);
        dumpAsJson(session, writer, table, null, depth, withTransaction, generator.getSchema(), plan, options);
    }
View Full Code Here

    @Override
    public void dumpBranchAsJson(Session session, PrintWriter writer,
                                 String schemaName, String tableName,
                                 List<List<Object>> keys, int depth,
                                 boolean withTransaction, FormatOptions options) {
        AkibanInformationSchema ais = dxlService.ddlFunctions().getAIS(session);
        Table table = getTable(ais, schemaName, tableName);
        logger.debug("Writing from {}: {}", table, keys);
        PlanGenerator generator = ais.getCachedValue(this, CACHED_PLAN_GENERATOR);
        Operator plan = generator.generateBranchPlan(table);
        dumpAsJson(session, writer, table, keys, depth, withTransaction, generator.getSchema(), plan, options);
    }
View Full Code Here

    @Override
    public void dumpBranchAsJson(Session session, PrintWriter writer,
                                 String schemaName, String tableName,
                                 Operator scan, RowType scanType, int depth,
                                 boolean withTransaction, FormatOptions options) {
        AkibanInformationSchema ais = dxlService.ddlFunctions().getAIS(session);
        Table table = getTable(ais, schemaName, tableName);
        logger.debug("Writing from {}: {}", table, scan);
        PlanGenerator generator = ais.getCachedValue(this, CACHED_PLAN_GENERATOR);
        Operator plan = generator.generateBranchPlan(table, scan, scanType);
        dumpAsJson(session, writer, table, Collections.singletonList(Collections.emptyList()), depth, withTransaction, generator.getSchema(), plan, options);
    }
View Full Code Here

    private void trackChange(Session session, Table table, Key hKey) {
        NiceRow row = null;
        for(Index index : table.getFullTextIndexes()) {
            if(row == null) {
                AkibanInformationSchema ais = getAIS(session);
                Table changeTable = ais.getTable(CHANGES_TABLE);
                row = new NiceRow(changeTable.getTableId(), changeTable.rowDef());
            }
            row.put(0, index.getIndexName().getSchemaName());
            row.put(1, index.getIndexName().getTableName());
            row.put(2, index.getIndexName().getName());
View Full Code Here

               .colInt("index_id", false)
               .colVarBinary("hkey", 4096, false);
        builder.procedure(BACKGROUND_WAIT_PROC_NAME)
               .language("java", Routine.CallingConvention.JAVA)
               .externalName(Routines.class.getName(), "backgroundWait");
        AkibanInformationSchema ais = builder.ais();
        schemaManager.registerStoredInformationSchemaTable(ais.getTable(CHANGES_TABLE), tableVersion);
        schemaManager.registerSystemRoutine(ais.getRoutine(BACKGROUND_WAIT_PROC_NAME));
    }
View Full Code Here

            return new Scan(adapter.getSession(), getRowType(adapter));
        }

        @Override
        public long rowCount(Session session) {
            AkibanInformationSchema ais = getAIS(session);
            return ais.getTables().size() + ais.getViews().size() ;
        }
View Full Code Here

            return new Scan(adapter.getSession(), getRowType(adapter));
        }

        @Override
        public long rowCount(Session session) {
            AkibanInformationSchema ais = getAIS(session);
            long count = 0;
            for(Table table : ais.getTables().values()) {
                count += table.getColumns().size();
            }
            for(View view : ais.getViews().values()) {
                count += view.getColumns().size();
            }
            return count;
        }
View Full Code Here

        private Cursor cursor;
        private Row row;

        private HKeyBytesStream(Session session) {
            this.session = session;
            AkibanInformationSchema ais = getAIS(session);
            Table changesTable = ais.getTable(CHANGES_TABLE);
            Operator plan = API.groupScan_Default(changesTable.getGroup());
            StoreAdapter adapter = store.createAdapter(session, SchemaCache.globalSchema(ais));
            QueryContext context = new SimpleQueryContext(adapter);
            this.cursor = API.cursor(plan, context, context.createBindings());
            cursor.open();
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.