Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


        else {
            voltQueueSQL(getSecurity2, symbol);
            VoltTable sec = voltExecuteSQL()[0];
           
            assert sec.getRowCount() == 1;
            VoltTableRow sec_row = sec.fetchRow(0);
           
            co_id = sec_row.getLong("S_CO_ID");
            exch_id = sec_row.getString("S_EX_ID");
            s_name = sec_row.getString("S_NAME");
                   
View Full Code Here


                   
            voltQueueSQL(getCompany2, co_id);
            VoltTable comp = voltExecuteSQL()[0];
           
            assert comp.getRowCount() == 1;
            co_name = comp.fetchRow(0).getString("CO_NAME");
        }
       
        voltQueueSQL(getLastTrade, symbol);
        voltQueueSQL(getTradeType, trade_type_id);
        voltQueueSQL(getHoldingSummmary, acct_id, symbol);
View Full Code Here

                }
               
                VoltTable hold_list = voltExecuteSQL()[0];
               
                for (int i = 0; i < hold_list.getRowCount() && needed_qty != 0; i++) {
                    VoltTableRow hold = hold_list.fetchRow(i);
                    int hold_qty = (int)hold.getLong("H_QTY");
                    double hold_price = hold.getDouble("H_PRICE");
                   
                    if (hold_qty > needed_qty) {
                        buy_value += needed_qty * hold_price;
 
View Full Code Here

                }
               
                VoltTable hold_list = voltExecuteSQL()[0];
               
                for (int i = 0; i < hold_list.getRowCount() && needed_qty != 0; i++) {
                    VoltTableRow hold = hold_list.fetchRow(i);
                    int hold_qty = (int)hold.getLong("H_QTY");
                    double hold_price = hold.getDouble("H_PRICE");
                   
                    if (hold_qty + needed_qty < 0) {
                        sell_value += needed_qty * hold_price;
 
View Full Code Here

        if (sell_value > buy_value && (tax_status == 1 || tax_status == 2)) {
            voltQueueSQL(getTaxrate, cust_id);
            VoltTable tr = voltExecuteSQL()[0];
           
            assert tr.getRowCount() == 1;
            double tax_rates = tr.fetchRow(0).getDouble(0);
            tax_amount = (sell_value - buy_value) * tax_rates;
        }
       
        // administrative fees
        voltQueueSQL(getCommissionRate, cust_tier, trade_type_id, exch_id, trade_qty, trade_qty);
View Full Code Here

            }
            else {
                // H-Store does not support SUM(X * Y), so we make it manually
                double hold_assets = 0;
                for (int i = 0; i < holds.getRowCount(); i++) {
                    hold_assets += holds.fetchRow(i).getDouble(0);
                }
               
                cust_assets = hold_assets + acct_bal;
            }
        }
View Full Code Here

                if (num_updated < max_updates) {
                    voltQueueSQL(getTrade1, trade_ids[i]);
                    VoltTable trade = voltExecuteSQL()[0];
                   
                    assert trade.getRowCount() == 1;
                    String ex_name = trade.fetchRow(0).getString("T_EXEC_NAME");
                   
                    Matcher m = p.matcher(ex_name);
                   
                    // ex_name LIKE "% X %"
                    if (m.matches()) {
View Full Code Here

                VoltTable[] res = voltExecuteSQL();
               
                // we do not need to retrieve settlement here
                VoltTable trade = res[0];
                assert trade.getRowCount() == 1;
                VoltTableRow trade_row = trade.fetchRow(0);
               
                is_cash[i] = (int)trade_row.getLong("T_IS_CASH");
                is_market[i] = (int)trade_row.getLong("TT_IS_MRKT");
               
                if (is_cash[i] == 1) {
View Full Code Here

        }

        // Concatenate w_name, four spaces, d_name
        byte[] w_name = warehouse.fetchRow(0).getStringAsBytes(W_NAME_IDX);
        final byte[] FOUR_SPACES = { ' ', ' ', ' ', ' ' };
        byte[] d_name = district.fetchRow(0).getStringAsBytes(D_NAME_IDX);
        ByteBuilder builder = new ByteBuilder(w_name.length + FOUR_SPACES.length + d_name.length);
        builder.append(w_name);
        builder.append(FOUR_SPACES);
        builder.append(d_name);
        byte[] h_data = builder.array();
View Full Code Here

            throw new VoltAbortException("no customers with last name: " + c_last + " in warehouse: "
                    + c_w_id + " and in district " + c_d_id);
        }

        final int index = (namecnt-1)/2;
        final VoltTableRow customerIdRow = customersIds.fetchRow(index);
        final int c_id = (int)customerIdRow.getLong(C_ID_IDX);
       
        voltQueueSQL(getCustomersByCustomerId, c_id, c_d_id, c_w_id);
        final VoltTableRow customer = voltExecuteSQL()[0].fetchRow(0);
        return processPayment(w_id, d_id, c_w_id, c_d_id, c_id, h_amount, customer, timestamp);
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.