Examples of VoltTableRow


Examples of org.voltdb.VoltTableRow

        } catch (Exception e) {
            e.printStackTrace();
        }

        final int index = (namecnt-1)/2;
        final VoltTableRow customer = customers.fetchRow(index);
        final long c_id = customer.getLong(C_ID_IDX);

        voltQueueSQL(getWarehouse, W_ID);
        voltQueueSQL(getDistrict, W_ID, D_ID);
        final VoltTable[] results = voltExecuteSQL();
        final VoltTable warehouse = results[0];
        final VoltTable district = results[1];

        try {
            System.out.println("WAREHOUSE PRE: " + warehouse.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }

        voltQueueSQL(getWarehouses);
        VoltTable warehouses = voltExecuteSQL()[0];
        try {
            System.out.println("WAREHOUSE PRE: " + warehouses.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }

        voltQueueSQL(updateWarehouseBalance, paymentAmount, W_ID);
        voltQueueSQL(updateDistrictBalance, paymentAmount, W_ID, D_ID);
        voltExecuteSQL();

        voltQueueSQL(getWarehouses);
        warehouses = voltExecuteSQL()[0];
        try {
            System.out.println("WAREHOUSE PRE: " + warehouses.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }

        //do stuff to extract district and warehouse info.

        //customer info
        final byte[] c_first = customer.getStringAsBytes(C_FIRST_IDX);
        final byte[] c_middle = customer.getStringAsBytes(C_MIDDLE_IDX);
        final byte[] c_last = customer.getStringAsBytes(C_LAST_IDX);
        final byte[] c_street_1 = customer.getStringAsBytes(C_STREET_1_IDX);
        final byte[] c_street_2 = customer.getStringAsBytes(C_STREET_2_IDX);
        final byte[] c_city = customer.getStringAsBytes(C_CITY_IDX);
        final byte[] c_state = customer.getStringAsBytes(C_STATE_IDX);
        final byte[] c_zip = customer.getStringAsBytes(C_ZIP_IDX);
        final byte[] c_phone = customer.getStringAsBytes(C_PHONE_IDX);
        final TimestampType c_since = customer.getTimestampAsTimestamp(C_SINCE_IDX);
        final byte[] c_credit = customer.getStringAsBytes(C_CREDIT_IDX);
        final double c_credit_lim = customer.getDouble(C_CREDIT_LIM_IDX);
        final double c_discount = customer.getDouble(C_DISCOUNT_IDX);
        final double c_balance = customer.getDouble(C_BALANCE_IDX) - paymentAmount;
        final double c_ytd_payment = customer.getDouble(C_YTD_PAYMENT_IDX) + paymentAmount;
        final long c_payment_cnt = customer.getLong(C_PAYMENT_CNT_IDX) + 1;
        byte[] c_data;
        if (Arrays.equals(c_credit, Constants.BAD_CREDIT_BYTES)) {
            c_data = customer.getStringAsBytes(C_DATA_IDX);
            byte[] newData = (c_id + " " + D_ID + " " + W_ID + " " + D_ID + " " + W_ID  + " " + paymentAmount + "|").getBytes();

            int newLength = newData.length + c_data.length;
            if (newLength > Constants.MAX_C_DATA) {
                newLength = Constants.MAX_C_DATA;
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.