Package org.voltdb

Examples of org.voltdb.VoltTable.fetchRow()


        }

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


        // Check each item
        VoltTable itemResults = neworder[2];
        assertEquals(quantities.length, itemResults.getRowCount());
        for (int i = 0; i < itemResults.getRowCount(); ++i) {
            VoltTableRow itemRow = itemResults.fetchRow(i);
            assertEquals("ITEM" + (i + 1), itemRow.getString("i_name"));
            //~ assertEquals(quantities[i], itemRow.getLong("));
            long expected = s_quantities[i] - quantities[i];
            if (expected < 10) expected += 91;
            assertEquals(expected, itemRow.getLong("s_quantity"));
View Full Code Here

        // verify that stock was updated correctly
        VoltTable[] allTables = client.callProcedure("SelectAll").getResults();
        VoltTable stock = allTables[TPCDataPrinter.nameMap.get("STOCK")];
        for (int i = 0; i < stock.getRowCount(); ++i) {
            VoltTableRow stockRow = stock.fetchRow(i);
            assertEquals(INITIAL_S_YTD + i*10 + quantities[i], stockRow.getLong("S_YTD"));
            assertEquals(INITIAL_S_ORDER_CNT + i*10 + 1, stockRow.getLong("S_ORDER_CNT"));
        }

        // New order with a missing item
View Full Code Here

        VoltTable result = client.callProcedure(
                "@AdHoc", "select * FROM R1 LEFT JOIN R2 ON R1.A = R2.C")
                                 .getResults()[0];
        System.out.println(result.toString());
        assertEquals(4, result.getRowCount());
        VoltTableRow row = result.fetchRow(2);
        assertEquals(2, row.getLong(1));

        client.callProcedure("InsertR2", 1, 1);
        client.callProcedure("InsertR2", 1, 3);
        client.callProcedure("InsertR2", 3, null);
View Full Code Here

        // R2 3rd joined with R3 null
        // R2 4th joined with R3 null
        VoltTable result = client.callProcedure(
                "@AdHoc", "select * FROM R2 LEFT JOIN R3 ON R3.A = R2.A")
                                 .getResults()[0];
        VoltTableRow row = result.fetchRow(2);
        assertEquals(3, row.getLong(1));
        System.out.println(result.toString());
        assertEquals(4, result.getRowCount());

        client.callProcedure("InsertR3", 1, 1);
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

        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

        assertEquals(fr.getStatusCode(), fr2.getStatusCode());
        assertEquals(fr.getTableCount(), fr2.getTableCount());

        VoltTable t1 = fr.getTableAtIndex(0);
        VoltTable t2 = fr2.getTableAtIndex(0);
        assertEquals(t1.fetchRow(0).getString(0), t2.fetchRow(0).getString(0));
    }

    public void testMembershipNotice() throws IOException {
        MultiPartitionParticipantMessage mn = new MultiPartitionParticipantMessage(100222, -75, 555555555555L, false);
View Full Code Here

        } 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();
View Full Code Here

        assert(amt1 == amt2);

        voltQueueSQL(getDistricts);
        VoltTable districts = voltExecuteSQL()[0];
        assert(1 == districts.getRowCount());
        assert((initialYTD + paymentAmount) == districts.fetchRow(0).getDouble("D_YTD"));

        voltQueueSQL(getCustomers);
        VoltTable customersX = voltExecuteSQL()[0];
        assert(4 == customersX.getRowCount());
        assert((C_ID + 1) == customersX.fetchRow(1).getLong("C_ID"));
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.