Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


        voltQueueSQL(truncate);
        voltQueueSQL(count);
        voltQueueSQL(scancount);
        VoltTable[] results = voltExecuteSQL(true);
        VoltTable data = results[1];
        VoltTableRow row = data.fetchRow(0);
        long optCount = row.getLong(0);
        if (optCount != 0) {
            throw new VoltAbortException("after truncate (opt) count not zero");
        }
        data = results[2];
View Full Code Here


        long optCount = row.getLong(0);
        if (optCount != 0) {
            throw new VoltAbortException("after truncate (opt) count not zero");
        }
        data = results[2];
        row = data.fetchRow(0);
        long scanCount = row.getLong(0);
        if (scanCount != 0) {
            throw new VoltAbortException("after truncate (scan) count not zero");
        }
        if (shouldRollback != 0) {
View Full Code Here

        voltExecuteSQL();

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

                    + " in warehouse: "
                    + c_w_id + " and in district " + c_d_id);
        }

        final int index = (namecnt-1)/2;
        final VoltTableRow customer = result.fetchRow(index);

        final long c_id = customer.getLong(0);
        return processPayment(w_id, d_id, h_amount, c_w_id, c_d_id, c_id, timestamp);
    }
}
View Full Code Here

            printJStack();
            System.exit(-1);
        }

        VoltTable t = cr.getResults()[0];
        partitionCount = (int) t.fetchRow(0).getLong(3);
        log.info("unique partition count is " + partitionCount);
        if (partitionCount <= 0) {
            log.error("partition count is zero");
            System.exit(-1);
        }
View Full Code Here

                System.exit(-1);
            }

            // successfully called summarize
            VoltTable t = cr.getResults()[0];
            long ts = t.fetchRow(0).getLong("ts");
            String tsStr = ts == 0 ? "NO TIMESTAMPS" : String.valueOf(ts) + " / " + new Date(ts).toString();
            long count = t.fetchRow(0).getLong("count");

            log.info("STARTUP TIMESTAMP OF LAST UPDATE (GMT): " + tsStr);
            log.info("UPDATES RUN AGAINST THIS DB TO DATE: " + count);
View Full Code Here

            // successfully called summarize
            VoltTable t = cr.getResults()[0];
            long ts = t.fetchRow(0).getLong("ts");
            String tsStr = ts == 0 ? "NO TIMESTAMPS" : String.valueOf(ts) + " / " + new Date(ts).toString();
            long count = t.fetchRow(0).getLong("count");

            log.info("STARTUP TIMESTAMP OF LAST UPDATE (GMT): " + tsStr);
            log.info("UPDATES RUN AGAINST THIS DB TO DATE: " + count);
        }
        catch (ProcCallException e) {
View Full Code Here

            // Randomly decide whether to delete (or update) the record
            if (rand.nextBoolean())
            {
                voltQueueSQL(delete, rowid);
                // Export deletion
                VoltTableRow row = item.fetchRow(0);
                voltQueueSQL(
                              export
                            , txid
                            , rowid
                            , row.get( 1, VoltType.TINYINT)
View Full Code Here

                try { Thread.sleep(3000); } catch (Exception e2) {}
            }
        }

        long pNextRid = (t1.getRowCount() == 0) ? 1 : t1.fetchRow(0).getLong("rid") + 1;
        long rNextRid = (t2.getRowCount() == 0) ? 1 : t2.fetchRow(0).getLong("rid") + 1;
        m_nextRid = pNextRid > rNextRid ? pNextRid : rNextRid; // max
    }

    class UserProcCallException extends Exception {
        private static final long serialVersionUID = 1L;
View Full Code Here

        System.out.println("Contestant Name\t\tVotes Received");
        while(result.advanceRow()) {
            System.out.printf("%s\t\t%,14d\n", result.getString(0), result.getLong(2));
        }
        System.out.printf("\nThe Winner is: %s\n\n", result.fetchRow(0).getString(0));

        // 3. Performance statistics
        System.out.print(HORIZONTAL_RULE);
        System.out.println(" Client Workload Statistics");
        System.out.println(HORIZONTAL_RULE);
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.