Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


        voltQueueSQL(getCustomers);
        VoltTable customersX = voltExecuteSQL()[0];
        assert(4 == customersX.getRowCount());
        assert((C_ID + 1) == customersX.fetchRow(1).getLong("C_ID"));
        assert((initialBalance - paymentAmount) == customersX.fetchRow(1).getDouble("C_BALANCE"));
        assert((initialYTD + paymentAmount) == customersX.fetchRow(1).getDouble("C_YTD_PAYMENT"));
        assert(2 == customersX.fetchRow(1).getLong("C_PAYMENT_CNT"));

        return null;
    }
}
View Full Code Here


        VoltTable customersX = voltExecuteSQL()[0];
        assert(4 == customersX.getRowCount());
        assert((C_ID + 1) == customersX.fetchRow(1).getLong("C_ID"));
        assert((initialBalance - paymentAmount) == customersX.fetchRow(1).getDouble("C_BALANCE"));
        assert((initialYTD + paymentAmount) == customersX.fetchRow(1).getDouble("C_YTD_PAYMENT"));
        assert(2 == customersX.fetchRow(1).getLong("C_PAYMENT_CNT"));

        return null;
    }
}
View Full Code Here

            map.put(key, new Object[row_count]);

        // for update, delete, insert, keys is empty
        if (keys.length > 0) {
            for (int i = 0; i < row_count; i++) {
                VoltTableRow row = table.fetchRow(i);
                for (int j = 0; j < keys.length; j++) {
                    Object[] vals = map.get(keys[j]);
                    Object ref = value_refs[j];
                    if (ref instanceof Integer) {
                        // ref is column_index
View Full Code Here

        VoltTable vt = new VoltTable(new ColumnInfo[] {
            new ColumnInfo(catalog_col0.getName(), VoltType.get(catalog_col0.getType())),   // D_ID
            new ColumnInfo(catalog_col1.getName(), VoltType.get(catalog_col1.getType())),   // D_W_ID
        });
        vt.addRow(params[0], params[1]);
        VoltTableRow vt_row = vt.fetchRow(0);
        int vt_partition = p_estimator.getTableRowPartition(catalog_tbl, vt_row);
        assert(vt_partition >= 0) : "Invalid Partition: " + vt_partition;
        assertEquals(stmt_partition, vt_partition);
    }
   
View Full Code Here

           
            result = trade_update_ret_template_frame2.clone(256);
            int num_updated = 0;
           
            for (int i = 0; i < trades.getRowCount(); i++) {
                VoltTableRow trade_row = trades.fetchRow(i);
               
                long trade_id = trade_row.getLong("T_ID");
                int is_cash = (int)trade_row.getLong("T_IS_CASH");
               
                if (num_updated < max_updates) {
View Full Code Here

                if (num_updated < max_updates) {
                    voltQueueSQL(getCashType, trade_id);
                    VoltTable cash = voltExecuteSQL()[0];
                   
                    assert cash.getRowCount() == 1;
                    String cash_type = cash.fetchRow(0).getString("SE_CASH_TYPE");
                   
                    if (is_cash == 1) {
                        if (cash_type.equals("Cash Account")) {
                            cash_type = "Cash";
                        }
View Full Code Here

            result = trade_update_ret_template_frame3.clone(128);
            int num_updated = 0;
            Pattern p = Pattern.compile(".* shares of .*");
           
            for (int i = 0; i < trades.getRowCount(); i++) {
                VoltTableRow trade_row = trades.fetchRow(i);
               
                long trade_id = trade_row.getLong("T_ID");
                int is_cash = (int)trade_row.getLong("T_IS_CASH");
                String type_name = trade_row.getString("TT_NAME");
                String s_name = trade_row.getString("S_NAME");
View Full Code Here

                    if (num_updated < max_updates) {
                        voltQueueSQL(getCTName, trade_id);
                        VoltTable cash = voltExecuteSQL()[0];
                       
                        assert cash.getRowCount() == 1;
                        String ct_name = cash.fetchRow(0).getString("CT_NAME");
                        Matcher m = p.matcher(ct_name);
                       
                        // ct_name LIKE "% shares of %"
                        if (m.matches()) {
                            ct_name = type_name + " " + quantity + " Shares of " + s_name;
View Full Code Here

                    type_limit_sell, price_quotes[i],
                    type_limit_buy, price_quotes[i]);
            VoltTable reqs = voltExecuteSQL()[0];
           
            for (int j = 0; j < reqs.getRowCount() && tradeRequestBuffer.size() < MAX_SEND_LEN; j++) {
                VoltTableRow req = reqs.fetchRow(j);
               
                long trade_id = req.getLong("TR_T_ID");
                double price_quote = req.getDouble("TR_BID_PRICE");
                String trade_type = req.getString("TR_TT_ID");
                int trade_qty = (int)req.getLong("TR_QTY");
View Full Code Here

        // info about the trade
        voltQueueSQL(getTrade, trade_id);
        VoltTable trade = voltExecuteSQL()[0];
       
        assert trade.getRowCount() == 1;
        VoltTableRow trade_row = trade.fetchRow(0);
       
        long acct_id = trade_row.getLong("T_CA_ID");
        String type_id = trade_row.getString("T_TT_ID");
        String symbol = trade_row.getString("T_S_SYMB");
        int trade_qty = (int)trade_row.getLong("T_QTY");
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.