Package org.voltdb.types

Examples of org.voltdb.types.TimestampType


           
            Object args[] = {
                w_id,                   // W_ID
                (byte)rng.nextInt(10)// D_ID
                rng.nextInt(),          // C_ID
                new TimestampType(),    // TIMESTAMP
                item_id,                // ITEM_IDS
                supware,                // SUPPLY W_IDS
                quantity                // QUANTITIES
            };
           
View Full Code Here


            char[] uninlineable = new char[1000];
            for (int j = 0; j < uninlineable.length; j++)
                uninlineable[j] = (char) (base + 32);

            voltQueueSQL(update, base + 1, base + 2, base + 3,
                         new TimestampType().getTime(),
                         (double) base / 100.0, new BigDecimal(base),
                         String.valueOf(base + 32),
                         String.valueOf(uninlineable), id);
        }
View Full Code Here

                uninlineable[j] = (char) (base + 32);

            switch (i) {
            case INSERT:
                voltQueueSQL(statements[i], id, base + 1, base + 2, base + 3,
                             new TimestampType().getTime(),
                             (double) base / 100.0, new BigDecimal(base),
                             String.valueOf(base + 32),
                             String.valueOf(uninlineable));
            case UPDATE:
                voltQueueSQL(statements[i], base + 1, base + 2, base + 3,
                             new TimestampType().getTime(),
                             (double) base / 100.0, new BigDecimal(base),
                             String.valueOf(base + 32),
                             String.valueOf(uninlineable), id);
            case DELETE:
                voltQueueSQL(statements[i], id);
View Full Code Here

            char[] uninlineable = new char[1000];
            for (int j = 0; j < uninlineable.length; j++)
                uninlineable[j] = (char) (base + 32);

            voltQueueSQL(update, base + 1, base + 2, base + 3,
                         new TimestampType().getTime(),
                         (double) base / 100.0, new BigDecimal(base),
                         String.valueOf(base + 32),
                         String.valueOf(uninlineable), id);
        }
View Full Code Here

            char[] uninlineable = new char[1000];
            for (int j = 0; j < uninlineable.length; j++)
                uninlineable[j] = (char) (base + 32);

            voltQueueSQL(insert, base, base + 1, base + 2, base + 3,
                         new TimestampType().getTime(),
                         (double) base / 100.0, new BigDecimal(base),
                         String.valueOf(base + 32),
                         String.valueOf(uninlineable));
        }
View Full Code Here

            char[] uninlineable = new char[1000];
            for (int j = 0; j < uninlineable.length; j++)
                uninlineable[j] = (char) (base + 32);

            voltQueueSQL(insert, base, base + 1, base + 2, base + 3,
                         new TimestampType().getTime(),
                         (double) base / 100.0, new BigDecimal(base),
                         String.valueOf(base + 32),
                         String.valueOf(uninlineable));
        }
View Full Code Here

       
        Object params[] = {
            (short)w_id,        // W_ID
            (byte)d_id,         // D_ID
            1,                  // C_ID
            new TimestampType(),// TIMESTAMP
            item_ids,           // ITEM_IDS
            supwares,           // SUPPLY W_IDS
            quantities          // QUANTITIES
        };
        return (params);
View Full Code Here

                0,
                0,
                0,
                0,
                0.0,
                new TimestampType(0),
                firstString,
                secondString,
                "",
                "",
                VoltType.NULL_DECIMAL
        };
        VoltTable results[] = client.callProcedure("Insert", params).getResults();
        params = null;
        firstString = null;
        secondString = null;

        assertEquals(results.length, 1);
        assertEquals( 1, results[0].asScalarLong());

        results = client.callProcedure("Select", "JUMBO_ROW", 0).getResults();
        assertEquals(results.length, 1);
        assertTrue(results[0].advanceRow());
        assertTrue(java.util.Arrays.equals( results[0].getStringAsBytes(1), firstStringBytes));
        assertTrue(java.util.Arrays.equals( results[0].getStringAsBytes(2), secondStringBytes));

        java.util.Arrays.fill(firstStringBytes, (byte)'q');
        firstString = new String(firstStringBytes, "UTF-8");
        java.util.Arrays.fill(secondStringBytes, (byte)'r');
        secondString = new String(secondStringBytes, "UTF-8");

        params = new Object[] {
                "JUMBO_ROW",
                0,
                0,
                0,
                0,
                0,
                0.0,
                new TimestampType(0),
                firstString,
                secondString,
                "",
                "",
                VoltType.NULL_DECIMAL
View Full Code Here

        int x = 3;
        SyncCallback cb = new SyncCallback();
        client.callProcedure(cb,
                org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
                new long[] {x}, new long[] {x}, x, new long[] {x},
                new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
                new double[] {x}, new String[] {"a"});
        cb.waitForResponse();

        // make sure the previous catalog change has completed
        client.drain();

        // now calling the new proc better work
        x = 2;
        client.callProcedure(org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
                new long[] {x}, new long[] {x}, x, new long[] {x},
                new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
                new double[] {x}, new String[] {"a"});

        loadSomeData(client, 50, 5);

        // this is a do nothing change... shouldn't affect anything
        newCatalogURL = VoltServerConfig.getPathToCatalogForTest("catalogupdate-cluster-expanded.jar");
        results = client.callProcedure("@UpdateApplicationCatalog", newCatalogURL).getResults();
        assertTrue(results.length == 1);

        client.drain();

        // now calling the new proc better work
        x = 4;
        client.callProcedure(org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
                new long[] {x}, new long[] {x}, x, new long[] {x},
                new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
                new double[] {x}, new String[] {"a"});

        loadSomeData(client, 55, 5);

        // remove the procedure we just added async
        newCatalogURL = VoltServerConfig.getPathToCatalogForTest("catalogupdate-cluster-base.jar");
        callback = new CatTestCallback(Status.OK);
        client.callProcedure(callback, "@UpdateApplicationCatalog", newCatalogURL);

        // don't care if this works now
        x = 4;
        cb = new SyncCallback();
        client.callProcedure(cb,
                org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
                new long[] {x}, new long[] {x}, x, new long[] {x},
                new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
                new double[] {x}, new String[] {"a"});
        cb.waitForResponse();

        // make sure the previous catalog change has completed
        client.drain();

        // now calling the new proc better fail
        x = 5;
        cb = new SyncCallback();
        client.callProcedure(cb,
                org.voltdb.benchmark.tpcc.procedures.InsertOrderLineBatched.class.getSimpleName(),
                new long[] {x}, new long[] {x}, x, new long[] {x},
                new long[] {x}, new long[] {x}, new TimestampType[] { new TimestampType() }, new long[] {x},
                new double[] {x}, new String[] {"a"});
        cb.waitForResponse();
        assertNotSame(cb.getResponse().getStatus(), Status.OK);

        loadSomeData(client, 60, 5);
View Full Code Here

    public void testInsertsAndSelects() throws IOException {
        Client client = getClient();

        try {
            VoltTable[] results = null;
            TimestampType timestamp = new TimestampType();

            results = client.callProcedure("InsertWarehouse", 8L, "EZ Street WHouse", "Headquarters", "77 Mass. Ave.", "Cambridge", "AZ", "12938", .1234, 18837.57).getResults();
            assertEquals(1L, results[0].asScalarLong());

            results = client.callProcedure("InsertDistrict", 7L, 3L, "A District", "Street Addy", "meh", "westerfield", "BA", "99999", .0825, 15241.45, 21L).getResults();
            assertEquals(1L, results[0].asScalarLong());

            results = client.callProcedure("InsertItem", 5L, 21L, "An Item", 7.33, "Some Data").getResults();
            assertEquals(1L, results[0].asScalarLong());

            results = client.callProcedure("InsertCustomer", 2L, 7L, 8L, "I", "Is", "Name", "Place", "Place2", "BiggerPlace", "AL", "91083", "(913) 909 - 0928", new TimestampType(), "GC", 19298943.12, .13, 15.75, 18832.45, 45L, 15L, "Some History").getResults();
            assertEquals(1L, results[0].asScalarLong());

            results = client.callProcedure("InsertHistory", 13L, 2L, 7L, 5L, 6L, timestamp, 23.334, "Some History").getResults();
            assertEquals(1L, results[0].asScalarLong());
View Full Code Here

TOP

Related Classes of org.voltdb.types.TimestampType

Copyright © 2018 www.massapicom. 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.