Package org.voltdb.catalog

Examples of org.voltdb.catalog.Database


        // Instead of something exhaustive, let's just make sure that we get
        // the number of result rows corresponding to the number of
        // ExecutionSites
        // that did save work
        Cluster cluster = CatalogUtil.getCluster(this.getCatalog());
        Database database = cluster.getDatabases().get("database");
        CatalogMap<Table> tables = database.getTables();

        CatalogMap<Site> sites = cluster.getSites();
        int num_hosts = cluster.getHosts().size();
        int replicated = 0;
        int total_tables = 0;
View Full Code Here


    public void testSingleAggregate() throws IOException, ProcCallException {
        int num_partitions = this.getServerConfig().getPartitionCount();
        Client client = this.getClient();
        final VoltTable vt = this.loadTable(client);
       
        Database catalog_db = CatalogUtil.getDatabase(this.getCatalog());
        Table catalog_tbl = catalog_db.getTables().get("TABLEC");
        assertNotNull(catalog_tbl);
        Column catalog_col = catalog_tbl.getColumns().get("C_VALUE0");
        assertNotNull(catalog_col);
       
        // Compute the AVG in Java so that we can compare
View Full Code Here

   
    protected VoltTable loadTable(Client client) throws IOException, ProcCallException {
        int num_partitions = this.getServerConfig().getPartitionCount();
        int num_tuples = num_partitions * 10;

        Database catalog_db = CatalogUtil.getDatabase(this.getCatalog());
        Table catalog_tbl = catalog_db.getTables().get("TABLEC");
        assertNotNull(catalog_tbl);
       
        Random rand = new Random(0);
        VoltTable vt = CatalogUtil.getVoltTable(catalog_tbl);
        int col_cnt = vt.getColumnCount();
View Full Code Here

   
    /**
     * testMultiColumnPartitioning
     */
    public void testMultiColumnPartitioning() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalogContext.database);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);

        Procedure catalog_proc = this.getProcedure(clone_db, GetNewDestination.class);
        ProcParameter catalog_params[] = new ProcParameter[] {
            this.getProcParameter(clone_db, catalog_proc, 0),   // S_ID
View Full Code Here

   
    /**
     * testMultiColumnPartitioningIncomplete
     */
    public void testMultiColumnPartitioningIncomplete() throws Exception {
        Database clone_db = CatalogCloner.cloneDatabase(catalogContext.database);
        CatalogContext clone_catalogContext = new CatalogContext(clone_db.getCatalog());
        PartitionEstimator p_estimator = new PartitionEstimator(clone_catalogContext);

        Procedure catalog_proc = this.getProcedure(clone_db, GetAccessData.class);
        ProcParameter catalog_params[] = new ProcParameter[] {
            this.getProcParameter(clone_db, catalog_proc, 0),   // S_ID
View Full Code Here

    public static Collection<Column> getOutputColumnsForStatement(Statement catalog_stmt) throws Exception {
        Collection<Column> ret = CACHE_OUTPUT_COLUMNS.get(catalog_stmt);
        if (ret == null && catalog_stmt.getQuerytype() == QueryType.SELECT.getValue()) {
            // It's easier to figure things out if we use the single-partition
            // query plan
            final Database catalog_db = CatalogUtil.getDatabase(catalog_stmt);
            final AbstractPlanNode root = PlanNodeUtil.getRootPlanNodeForStatement(catalog_stmt, true);
            assert (root != null);
            assert (root instanceof SendPlanNode) : "Unexpected PlanNode root " + root + " for " + catalog_stmt.fullName();

            // We need to examine down the tree to figure out what this thing
View Full Code Here

        AbstractPlanNode ret = cache.get(cache_key);
        if (ret != null)
            return (ret);

        // Otherwise construct the AbstractPlanNode tree
        Database catalog_db = CatalogUtil.getDatabase(catalog_stmt);
        String fullPlan = (singlePartition ? catalog_stmt.getFullplan() : catalog_stmt.getMs_fullplan());
        if (fullPlan == null || fullPlan.isEmpty()) {
            throw new RuntimeException("Unable to deserialize full query plan tree for " + catalog_stmt + ": The plan attribute is empty");
        }
View Full Code Here

        String id = catalog_frag.getName();
        AbstractPlanNode ret = PlanNodeUtil.CACHE_DESERIALIZE_FRAGMENT.get(id);
        if (ret == null) {
            if (debug.val)
                LOG.warn("No cached object for " + catalog_frag.fullName());
            Database catalog_db = CatalogUtil.getDatabase(catalog_frag);
            String jsonString = Encoder.hexDecodeToString(catalog_frag.getPlannodetree());
            PlanNodeList list = null;
            try {
                JSONObject jsonObject = new JSONObject(jsonString);
                list = (PlanNodeList) PlanNodeTree.fromJSONObject(jsonObject, catalog_db);
View Full Code Here

     * @param filter
     * @param workload
     */
    public Workload(Catalog catalog, Filter filter, Workload...workloads) {
        this(catalog);
        Database catalog_db = CatalogUtil.getDatabase(this.catalog);
        for (Workload w : workloads) {
            assert(w != null);
            for (TransactionTrace txn : CollectionUtil.iterable(w.iterator(filter))) {
                this.addTransaction(txn.getCatalogItem(catalog_db), txn, false);
            } // WHILE
View Full Code Here

     * @param catalog_proc
     * @return
     */
    public static Collection<Procedure> getWriteWriteConflicts(Procedure catalog_proc) {
        List<Procedure> conflicts = new ArrayList<Procedure>();
        Database catalog_db = CatalogUtil.getDatabase(catalog_proc);
        for (String procName : catalog_proc.getConflicts().keySet()) {
            ConflictSet cs = catalog_proc.getConflicts().get(procName);
            if (cs.getWritewriteconflicts().isEmpty() == false) {
                conflicts.add(catalog_db.getProcedures().get(procName));
            }
        } // FOR
        return (conflicts);
    }
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.