Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


            voltQueueSQL(getTrades, acct_id);
            VoltTable trades = voltExecuteSQL()[0];
           
            // since we split the original SQL statement we have to retrieve every trade separately
            for (int i = 0; i < trades.getRowCount(); i++) {
                long trade_id = trades.fetchRow(i).getLong("T_ID");
                voltQueueSQL(getTradeHistory, trade_id);
            }
           
            // we cannot limit them by 30 as required, so we will retrieve the whole history
            voltExecuteSQL();
View Full Code Here


                    // no "AA", "ZAPS", "ZONS" list
                    voltQueueSQL(selectWatchListMax);
                    VoltTable wl = voltExecuteSQL()[0];
                   
                    assert wl.getRowCount() == 1;
                    long last_wl_id = wl.fetchRow(0).getLong(0);
                   
                    voltQueueSQL(insertWatchList, last_wl_id + 1, c_id);
                    voltQueueSQL(insertWatchItem, last_wl_id + 1, symbol1);
                    voltQueueSQL(insertWatchItem, last_wl_id + 1, symbol2);
                    voltQueueSQL(insertWatchItem, last_wl_id + 1, symbol3);
View Full Code Here

                    // the customer has the list -- remove it for this and all other customers
                    voltQueueSQL(selectMaxCommonWatchList, symbol1, symbol2, symbol3);
                    VoltTable wl = voltExecuteSQL()[0];
                   
                    assert wl.getRowCount() == 1;
                    long max_wl_id = wl.fetchRow(0).getLong(0);
                   
                    // have to remove all lists with ids greater that that one
                    voltQueueSQL(deleteWatchListItems, max_wl_id);
                    voltQueueSQL(deleteWatchList, max_wl_id);
                }
View Full Code Here

                // no watch lists for the customer -- insert this as the only one
                voltQueueSQL(selectWatchListMax);
                VoltTable wl = voltExecuteSQL()[0];
               
                assert wl.getRowCount() == 1;
                long last_wl_id = wl.fetchRow(0).getLong(0);
               
                voltQueueSQL(insertWatchList, last_wl_id + 1, c_id);
                voltQueueSQL(insertWatchItem, last_wl_id + 1, symbol1);
                voltQueueSQL(insertWatchItem, last_wl_id + 1, symbol2);
                voltQueueSQL(insertWatchItem, last_wl_id + 1, symbol3);
View Full Code Here

            VoltTable brok_res = voltExecuteSQL()[0];
           
            if (brok_res.getRowCount() > 0) {
                double vol = 0;
                for (int j = 0; j < brok_res.getRowCount(); j++) {
                    vol += brok_res.fetchRow(j).getDouble(1);
                }
                volumes.add(vol);
            }
        }
       
View Full Code Here

            try {
                LOG.info("Processing " + num_tuples + " (sample=10) tuples for statistics on " + catalog_tbl.getName());
                boolean show_progress = (num_tuples > 25000);
                for (int i = 0; i < num_tuples; i += 10) {
                    if (i >= num_tuples) break;
                    VoltTableRow tuple = voltTable.fetchRow(i);
                    for (int j = 0; j < num_columns; j++) {
                        loader_query.params[j] = tuple.get(j, col_types[j]);
                    } // FOR
                    table_stats.process(stats_catalog_db, loader_xact);
                    if (show_progress && i > 0 && i % 10000 == 0) LOG.info(i + " tuples");
View Full Code Here

        voltQueueSQL(getAccount1, acct_id);
        VoltTable acc_info = voltExecuteSQL()[0];
       
        assert acc_info.getRowCount() == 1;
       
        VoltTableRow acc_info_row = acc_info.fetchRow(0);
        String acct_name = acc_info_row.getString("CA_NAME");
        long broker_id = acc_info_row.getLong("CA_B_ID");
        long cust_id = acc_info_row.getLong("CA_C_ID");
        int tax_status = (int)acc_info_row.getLong("CA_TAX_ST");
       
View Full Code Here

            voltQueueSQL(getACL, acct_id, exec_f_name, exec_l_name, exec_tax_id);
            VoltTable acl = voltExecuteSQL()[0];
           
            assert acl.getRowCount() == 1;
           
            if (acl.fetchRow(0).get(0) == null) {
                throw new VoltAbortException("ACL for a Trade-Order transaction is NULL");
            }
        }
       
        // frame 3: estimating overall financial impact
View Full Code Here

        if (symbol.equals("")) {
            voltQueueSQL(getCompany, co_name);
            VoltTable comp = voltExecuteSQL()[0];
           
            assert comp.getRowCount() == 1;
            co_id = comp.fetchRow(0).getLong("CO_ID");
           
            voltQueueSQL(getSecurity1, co_id, issue);
            VoltTable sec = voltExecuteSQL()[0];
           
            assert sec.getRowCount() == 1;
View Full Code Here

           
            voltQueueSQL(getSecurity1, co_id, issue);
            VoltTable sec = voltExecuteSQL()[0];
           
            assert sec.getRowCount() == 1;
            VoltTableRow sec_row = sec.fetchRow(0);
           
            exch_id = sec_row.getString("S_EX_ID");
            s_name = sec_row.getString("S_NAME");
            symbol = sec_row.getString("S_SYMB");
        }
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.