Package org.voltdb

Examples of org.voltdb.VoltTable.addRow()


                                         "city_" + i,
                                         "ma",
                                         "zip_"  + i,
                                         new Double(i),
                                         new Double(i)};
            partitioned_table.addRow(row);
        }

        // make a TPCC item table
        VoltTable replicated_table =
            new VoltTable(new VoltTable.ColumnInfo("I_ID", VoltType.INTEGER),
View Full Code Here


                                         i,
                                         "name_" + i,
                                         new Double(i),
                                         "data_"  + i};

            replicated_table.addRow(row);
        }

        try {
            client.callProcedure("@LoadMultipartitionTable", "WAREHOUSE", partitioned_table);
            client.callProcedure("@LoadMultipartitionTable", "ITEM", replicated_table);
View Full Code Here

        VoltTable warehousedata = new VoltTable(
                new VoltTable.ColumnInfo("W_ID", VoltType.INTEGER),
                new VoltTable.ColumnInfo("W_NAME", VoltType.STRING)
        );
        for (int i = 0; i < 200; ++i) {
            warehousedata.addRow(i, "str" + i);
        }

        System.out.println(warehousedata.toString());
        sourceEngine.loadTable(WAREHOUSE_TABLEID, warehousedata, 0, 0, Long.MAX_VALUE, allowExport);
View Full Code Here

                new VoltTable.ColumnInfo("S_I_ID", VoltType.INTEGER),
                new VoltTable.ColumnInfo("S_W_ID", VoltType.INTEGER),
                new VoltTable.ColumnInfo("S_QUANTITY", VoltType.INTEGER)
        );
        for (int i = 0; i < 1000; ++i) {
            stockdata.addRow(i, i % 200, i * i);
        }
        sourceEngine.loadTable(STOCK_TABLEID, stockdata, 0, 0, Long.MAX_VALUE, allowExport);
    }

    public void testLoadTable() throws Exception {
View Full Code Here

        // Replication should check to make sure they're the same
        // from all replicas.
        VoltTable retval = new VoltTable(
                new ColumnInfo("date", VoltType.BIGINT),
                new ColumnInfo("rand", VoltType.BIGINT));
        retval.addRow(deterDate, randNo);
        return retval;
    }
}
View Full Code Here

            Object[] row = new Object[] { i, stringVal, i, new Double(i) };
            if (sb != null) {
                sb.append(i).append(delimeter).append(escapedVal).append(delimeter);
                sb.append(i).append(delimeter).append(new Double(i).toString()).append('\n');
            }
            repl_table.addRow(row);
        }
        return repl_table;
    }

    private VoltTable createPartitionedTable(int numberOfItems, int indexBase) {
View Full Code Here

        VoltTable partition_table = new VoltTable(new ColumnInfo("PT_ID", VoltType.INTEGER), new ColumnInfo("PT_NAME", VoltType.STRING), new ColumnInfo("PT_INTVAL", VoltType.INTEGER), new ColumnInfo(
                "PT_FLOATVAL", VoltType.FLOAT));

        for (int i = indexBase; i < numberOfItems + indexBase; i++) {
            Object[] row = new Object[] { i, "name_" + i, i, new Double(i) };
            partition_table.addRow(row);
        }

        return partition_table;
    }
View Full Code Here

        // Return the entire warehouse and district tuples. The client provided:
        // w_id, d_id, c_d_id, c_w_id, h_amount, h_data.
        // Build a table for the rest
        final VoltTable misc = misc_template.clone(8192);
        misc.addRow(c_id, c_first, c_middle, c_last, c_street_1, c_street_2, c_city, c_state, c_zip,
                c_phone, c_since, c_credit, c_credit_lim, c_discount, c_balance, c_data);

        // Hand back all the warehouse, district, and customer data
        VoltTable[] resultsX = new VoltTable[] {warehouse, district, misc};
View Full Code Here

            row[col++] = i % num_partitions;
            for ( ; col < col_cnt; col++) {
                int val = rand.nextInt(100);
                row[col] = val;
            } // FOR
            vt.addRow(row);
        } // FOR
       
        ClientResponse cr = client.callProcedure("@LoadMultipartitionTable", catalog_tbl.getName(), vt);
        assertEquals(Status.OK, cr.getStatus());
       
View Full Code Here

    private static final ColumnInfo[] statusColumns = { new ColumnInfo("status", VoltType.BIGINT), };

    public static VoltTable getStatusTable(boolean success) {
        VoltTable vt = new VoltTable(statusColumns);
        vt.addRow((success ? 1 : 0));
        return (vt);
    }

    /**
     * Combine multiple VoltTables into a single table
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.