Examples of fetchRow()


Examples of org.voltdb.VoltTable.fetchRow()

            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

Examples of org.voltdb.VoltTable.fetchRow()

                    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

Examples of org.voltdb.VoltTable.fetchRow()

                    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

Examples of org.voltdb.VoltTable.fetchRow()

        // 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

Examples of org.voltdb.VoltTable.fetchRow()

        voltQueueSQL(getHoldingSummary, acct_id, symbol);
        VoltTable[] trade_type_hold = voltExecuteSQL();
       
        VoltTable trade_type = trade_type_hold[0];
        assert trade_type.getRowCount() == 1;
        VoltTableRow trade_type_row = trade_type.fetchRow(0);
       
        String type_name = trade_type_row.getString("TT_NAME");
        int type_is_sell = (int)(int)trade_type_row.getLong("TT_IS_SELL");
        int type_is_market = (int)trade_type_row.getLong("TT_IS_MRKT");
       
View Full Code Here

Examples of org.voltdb.VoltTable.fetchRow()

       
        VoltTable hold_sum = trade_type_hold[1];
        int hs_qty = 0;
        if (hold_sum.getRowCount() > 0) {
            assert hold_sum.getRowCount() == 1;
            hs_qty = (int)hold_sum.fetchRow(0).getLong("HS_QTY");
        }
       
        // frame 2: modifying the customer's holdings
       
        // first, some cusomer's account info
View Full Code Here

Examples of org.voltdb.VoltTable.fetchRow()

        // first, some cusomer's account info
        voltQueueSQL(getCustomerAccount, acct_id);
        VoltTable account = voltExecuteSQL()[0];
       
        assert account.getRowCount() == 1;
        VoltTableRow account_row = account.fetchRow(0);
       
        long broker_id = account_row.getLong("CA_B_ID");
        long cust_id = account_row.getLong("CA_C_ID");
        int tax_status = (int)account_row.getLong("CA_TAX_ST");
       
View Full Code Here

Examples of org.voltdb.VoltTable.fetchRow()

                }
               
                // modify existing holdings
                VoltTable hold_list = voltExecuteSQL()[0];
                for (int i = 0; i < hold_list.getRowCount() && needed_qty != 0; i++) {
                    VoltTableRow hold = hold_list.fetchRow(i);
                   
                    long hold_id = hold.getLong("H_T_ID");
                    int hold_qty = (int)hold.getLong("H_QTY");
                    double hold_price = hold.getDouble("H_PRICE");
                   
View Full Code Here

Examples of org.voltdb.VoltTable.fetchRow()

                }
               
                // modify existing holdings
                VoltTable hold_list = voltExecuteSQL()[0];
                for (int i = 0; i < hold_list.getRowCount() && needed_qty != 0; i++) {
                    VoltTableRow hold = hold_list.fetchRow(i);
                   
                    long hold_id = hold.getLong("H_T_ID");
                    int hold_qty = (int)hold.getLong("H_QTY");
                    double hold_price = hold.getDouble("H_PRICE");
                   
View Full Code Here

Examples of org.voltdb.VoltTable.fetchRow()

        if ((tax_status == 1 || tax_status == 2) && sell_value > buy_value) {
            voltQueueSQL(getTaxrate, cust_id);
            VoltTable tax_rate = voltExecuteSQL()[0];
           
            assert tax_rate.getRowCount() == 1;
            double tax_rates = tax_rate.fetchRow(0).getDouble(0);
            tax_amount = (sell_value - buy_value) * tax_rates;
           
            voltQueueSQL(updateTrade1, tax_amount, trade_id);
            voltExecuteSQL();
        }
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.