Package org.voltdb.catalog

Examples of org.voltdb.catalog.Table


       
        // We have to massage our attributes list so that our testing is deterministic. Set the only table
        // that we're going to visit is ACCESS_INFO and change its partitioning column to something that we know
        // we can beat if we partition on S_ID
        Map<Table, Column> expected = new HashMap<Table, Column>();
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column catalog_col = this.getColumn(catalog_tbl, -1);
        catalog_tbl.setPartitioncolumn(catalog_col);
        table_visit_order.add(catalog_tbl);
        expected.put(catalog_tbl, this.getColumn(catalog_tbl, "S_ID"));
       
        catalog_tbl = this.getTable(TM1Constants.TABLENAME_CALL_FORWARDING);
        catalog_col = this.getColumn(catalog_tbl, -1);
        catalog_tbl.setPartitioncolumn(catalog_col);
        table_visit_order.add(catalog_tbl);
        expected.put(catalog_tbl, this.getColumn(catalog_tbl, "S_ID"));
       
        // Set this to be the upperbounds
        PartitionPlan ub_pplan = PartitionPlan.createFromCatalog(catalog_db);
View Full Code Here


    /**
     * testTableEntrySerialization
     */
    @Test
    public void testTableEntrySerialization() throws Exception {
        Table catalog_tbl = this.getTable("DISTRICT");
        Column catalog_col = this.getColumn(catalog_tbl, "D_W_ID");
       
        Table parent_tbl = this.getTable("WAREHOUSE");
        Column parent_col = this.getColumn(parent_tbl, "W_ID");
       
        TableEntry entries[] = {
            new TableEntry(PartitionMethodType.REPLICATION, null, null, null),
            new TableEntry(PartitionMethodType.HASH, catalog_col, null, null),
View Full Code Here

    /**
     * testGetChangedEntries
     */
    @Test
    public void testGetChangedEntries() {
        Table catalog_tbl = this.getTable("WAREHOUSE");
        Column catalog_col = this.getColumn(catalog_tbl, "W_NAME");

        // First check they are the same
        final PartitionPlan pplan0 = PartitionPlan.createFromCatalog(catalog_db);
        assertNotNull(pplan0);
View Full Code Here

     * testProcedureColumns
     */
    public void testProcedureColumns() throws Exception {
        this.partitioner.init(this.hints);
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        Table catalog_tbl0 = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Table catalog_tbl1 = this.getTable(TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column expected[] = {
            this.getColumn(catalog_tbl0, "S_ID"),
            this.getColumn(catalog_tbl0, "BIT_1"),
            this.getColumn(catalog_tbl1, "DATA_A"),
            this.getColumn(catalog_tbl1, "S_ID"),
View Full Code Here

     * testProcedureColumnAccessHistogram
     */
    public void testProcedureColumnAccessHistogram() throws Exception {
        this.partitioner.init(this.hints);
        Procedure catalog_proc = this.getProcedure(UpdateSubscriberData.class);
        Table catalog_tbl0 = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        Table catalog_tbl1 = this.getTable(TM1Constants.TABLENAME_SPECIAL_FACILITY);
        Column expected[] = {
            this.getColumn(catalog_tbl0, "S_ID"),
            this.getColumn(catalog_tbl0, "BIT_1"),
            this.getColumn(catalog_tbl1, "DATA_A"),
            this.getColumn(catalog_tbl1, "S_ID"),
View Full Code Here

     * testGenerateMultiColumns
     */
    public void testGenerateMultiColumns() throws Exception {
        hints.enable_multi_partitioning = true;
        Procedure catalog_proc = this.getProcedure(GetAccessData.class);
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_ACCESS_INFO);
        Column expected[] = {
            this.getColumn(catalog_tbl, "S_ID"),
            this.getColumn(catalog_tbl, "AI_TYPE"),
        };
       
View Full Code Here

        assert(new_cost > 0);
        assertEquals(this.partitioner.initial_cost, new_cost);
       
        // Genarate table+procedure attribute lists
        List<Table> table_attributes = new ArrayList<Table>();
        Table catalog_tbl = this.getTable(TM1Constants.TABLENAME_SUBSCRIBER);
        table_attributes.add(catalog_tbl);
       
        List<Procedure> proc_attributes = new ArrayList<Procedure>();
        for (Procedure catalog_proc : catalog_db.getProcedures()) {
            if (PartitionerUtil.isPartitionable(catalog_proc)) proc_attributes.add(catalog_proc);
View Full Code Here

    public void testRemoveDuplicateEdges() throws Exception {
        final int num_edges = 5;
        DependencyGraph dgraph = new DependencyGraph(catalogContext.database);
        DesignerVertex vertices[] = new DesignerVertex[TABLE_NAMES.length];
        for (int i = 0; i < vertices.length; i++) {
            Table catalog_tbl = this.getTable(TABLE_NAMES[i]);
            vertices[i] = new DesignerVertex(catalog_tbl);
            dgraph.addVertex(vertices[i]);
           
            if (i > 0) {
                for (int j = 0; j < num_edges; j++) {
View Full Code Here

           
            EvictedTupleAccessException error = (EvictedTupleAccessException)orig_error;
            short block_ids[] = error.getBlockIds();
            int tuple_offsets[] = error.getTupleOffsets();

            Table evicted_table = error.getTable(this.catalogContext.database);
            new_ts.setPendingError(error, false);

            if (debug.val)
                LOG.debug(String.format("Added aborted txn to %s queue. Unevicting %d blocks from %s (%d).",
                          AntiCacheManager.class.getSimpleName(), block_ids.length, evicted_table.getName(), evicted_table.getRelativeIndex()));
           
            if (orig_ts.getBasePartition() != error.getPartitionId() && !this.isLocalPartition(error.getPartitionId())) {
                new_ts.setOldTransactionId(orig_ts.getTransactionId());
            }
            this.anticacheManager.queue(new_ts, error.getPartitionId(), evicted_table, block_ids, tuple_offsets);
View Full Code Here

      ts.setUnevictCallback(done);
     
     
      ts.setNewTransactionId(request.getNewTransactionId());
      int partition = request.getPartitionId();
      Table catalog_tbl = hstore_site.getCatalogContext().getTableById(request.getTableId());
      short[] block_ids = new short[request.getBlockIdsList().size()];
      for(int i = 0; i < request.getBlockIdsList().size(); i++) block_ids[i] = (short) request.getBlockIds(i);

      int [] tuple_offsets = new int[request.getTupleOffsetsList().size()];
      for(int i = 0; i < request.getTupleOffsetsList().size(); i++) tuple_offsets[i] = request.getTupleOffsets(i);
View Full Code Here

TOP

Related Classes of org.voltdb.catalog.Table

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.