Package org.voltdb.catalog

Examples of org.voltdb.catalog.Database


     * @param catalog_obj
     * @param id
     * @return
     */
    public static PlanFragment getPlanFragment(CatalogType catalog_obj, int id) {
        Database catalog_db = CatalogUtil.getDatabase(catalog_obj);
        for (Procedure catalog_proc : catalog_db.getProcedures()) {
            for (Statement catalog_stmt : catalog_proc.getStatements()) {
                for (PlanFragment catalog_frag : catalog_stmt.getFragments())
                    if (catalog_frag.getId() == id)
                        return (catalog_frag);
                for (PlanFragment catalog_frag : catalog_stmt.getMs_fragments())
View Full Code Here


                                                                                                                     final Workload workload,
                                                                                                                     final PartitionEstimator p_estimator,
                                                                                                                     final Class<T> containerClass,
                                                                                                                     final Map<Integer, MarkovGraphsContainer> markovs_map) throws Exception {
        final String className = containerClass.getSimpleName();
        final Database catalog_db = catalogContext.database;
        final List<Runnable> runnables = new ArrayList<Runnable>();
        final Set<Procedure> procedures = workload.getProcedures(catalog_db);
        final ObjectHistogram<Procedure> proc_h = new ObjectHistogram<Procedure>();
        final int num_transactions = workload.getTransactionCount();
        final int marker = Math.max(1, (int)(num_transactions * 0.10));
 
View Full Code Here

    public CatalogSummaryUtil(Catalog catalog) {
        this.catalog = catalog;
    }
   
    public Map<String, Integer>[] getProceduresInfo(boolean full) {
        Database catalog_db = CatalogUtil.getDatabase(catalog);
        Map<String, Integer> m[] = (Map<String, Integer>[])new Map<?, ?>[1];
        int idx = -1;

        int procs = 0;
        int sysprocs = 0;
        int params = 0;
        int stmts = 0;
        for (Procedure p : catalog_db.getProcedures()) {
            if (p.getSystemproc()) {
                sysprocs++;
            } else {
                procs++;
                params += p.getParameters().size();
View Full Code Here

       
        return (m);
    }
   
    public Map<String, Integer>[] getTablesInfo(boolean full) {
        Database catalog_db = CatalogUtil.getDatabase(catalog);
        Map<String, Integer> m[] = (Map<String, Integer>[])new Map<?, ?>[3];
        int idx = -1;
       
        int cols = 0;
        int fkeys = 0;
View Full Code Here

   
    /**
     * testCatalogMapValues
     */
    public void testCatalogMapValues() {
        Database catalog_db = CatalogUtil.getDatabase(CatalogCloner.cloneBaseCatalog(this.getCatalog()));
        Procedure catalog_proc = this.getProcedure(catalog_db, neworder.class);
        CatalogMap<Statement> stmts = catalog_proc.getStatements();
        List<Statement> orig = new ArrayList<Statement>(stmts);
        assertFalse(stmts.isEmpty());
        int expected = stmts.size();
View Full Code Here

    /**
     * testGetDatabase
     */
    @SuppressWarnings("deprecation")
    public void testGetDatabase() {
        Database db0 = CatalogUtil.getDatabase(catalog);
        assertNotNull(db0);

        Set<Database> dbs = new HashSet<Database>();
        for (Database db1 : catalogContext.cluster.getDatabases()) {
            dbs.add(db1);
View Full Code Here

     * for this PartitionExecutor
     * @return
     */
    public static File getMMAPDir(PartitionExecutor executor) {
        HStoreConf hstore_conf = executor.getHStoreConf();
        Database catalog_db = CatalogUtil.getDatabase(executor.getPartition());

        // First make sure that our base directory exists
        String base_dir = FileUtil.realpath(hstore_conf.site.storage_mmap_dir +
                File.separatorChar +
                catalog_db.getProject());

        //synchronized (AntiCacheManager.class) {
        FileUtil.makeDirIfNotExists(base_dir);
        //} // SYNC

View Full Code Here

     * for this PartitionExecutor
     * @return
     */
    public static File getARIESDir(PartitionExecutor executor) {
        HStoreConf hstore_conf = executor.getHStoreConf();
        Database catalog_db = CatalogUtil.getDatabase(executor.getPartition());

        // First make sure that our base directory exists
        String base_dir = FileUtil.realpath(hstore_conf.site.aries_dir + File.separatorChar + catalog_db.getProject());

        synchronized (PartitionExecutor.class) {
            FileUtil.makeDirIfNotExists(base_dir);
        } // SYNC

View Full Code Here

     * testCreateSchemaCatalog
     */
    public void testCreateSchemaCatalog() throws Exception {
        Catalog s_catalog = new TPCEProjectBuilder().getSchemaCatalog(false);
        assertNotNull(s_catalog);
        Database s_catalog_db = CatalogUtil.getDatabase(s_catalog);
        assertNotNull(catalog_db);

        // ADDRESS should point to ZIP_CODE
        Table address = s_catalog_db.getTables().get(TPCEConstants.TABLENAME_ADDRESS);
        assertNotNull(address);
        Table zipcode = s_catalog_db.getTables().get(TPCEConstants.TABLENAME_ZIP_CODE);
        assertNotNull(zipcode);

        for (Constraint catalog_const : address.getConstraints()) {
            if (catalog_const.getType() == ConstraintType.FOREIGN_KEY.getValue()) {
                assertEquals(zipcode, catalog_const.getForeignkeytable());
View Full Code Here

   
    public void testGetChildTables() throws Exception{
      super.setUp(ProjectType.ARTICLES);
     
        Table catalog_tbl = this.getTable(ArticlesConstants.TABLENAME_ARTICLES);
        Database db = this.getDatabase();
        String expected[] = { ArticlesConstants.TABLENAME_COMMENTS };

      String[] tables = CatalogUtil.getChildTables(db, catalog_tbl);
     
        assertNotNull(tables);
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Database

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.