Search in sources :

Example 51 with TimestampType

use of org.voltdb.types.TimestampType in project voltdb by VoltDB.

the class TestVoltBulkLoader method testMultipleTablesWithMultipleClients.

//Test multiple tables with Multiple Clients and no errors.
public void testMultipleTablesWithMultipleClients() throws Exception {
    String mySchema = "create table BLAH (" + "clm_integer integer not null, " + // column that is partitioned on
    "clm_tinyint tinyint default 0, " + "clm_smallint smallint default 0, " + "clm_bigint bigint default 0, " + "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "PRIMARY KEY(clm_integer) " + "); " + "create table BLAH2 (" + "clm_integer integer not null, " + // column that is partitioned on
    "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "PRIMARY KEY(clm_integer) " + "); ";
    TimestampType currentTime = new TimestampType();
    Object[][] myData1 = { { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 3, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 4, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 5, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 6, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 7, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 8, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 9, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 10, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 11, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 12, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 13, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 14, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 15, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 16, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 17, 1, 1, 11111111, "first", 1.10, 1.11, currentTime } };
    int myBatchSize1 = 200;
    Integer[] failures1 = {};
    ArrayList<Integer> expectedFailures1 = new ArrayList<Integer>(Arrays.asList(failures1));
    Object[][] myData2 = { { 1, "first", 1.10, 1.11, currentTime }, { 2, "first", 1.10, 1.11, currentTime }, { 3, "first", 1.10, 1.11, currentTime }, { 4, "first", 1.10, 1.11, currentTime }, { 5, "first", 1.10, 1.11, currentTime }, { 6, "first", 1.10, 1.11, currentTime }, { 7, "first", 1.10, 1.11, currentTime }, { 8, "first", 1.10, 1.11, currentTime }, { 9, "first", 1.10, 1.11, currentTime }, { 10, "first", 1.10, 1.11, currentTime }, { 11, "first", 1.10, 1.11, currentTime }, { 12, "first", 1.10, 1.11, currentTime }, { 13, "first", 1.10, 1.11, currentTime }, { 14, "first", 1.10, 1.11, currentTime }, { 15, "first", 1.10, 1.11, currentTime } };
    int myBatchSize2 = 200;
    Integer[] failures2 = {};
    ArrayList<Integer> expectedFailures2 = new ArrayList<Integer>(Arrays.asList(failures2));
    test_multiplexing(mySchema, true, true, true, "BLAH", myData1, myBatchSize1, expectedFailures1, false, "BLAH2", myData2, myBatchSize2, expectedFailures2, false);
}
Also used : ArrayList(java.util.ArrayList) TimestampType(org.voltdb.types.TimestampType)

Example 52 with TimestampType

use of org.voltdb.types.TimestampType in project voltdb by VoltDB.

the class TestVoltBulkLoader method testBatchOptionThatSplitsAndGetsViolations.

//Test that gets constraint violations.
//has a batch that fully fails and 2 batches that has 50% failure.
public void testBatchOptionThatSplitsAndGetsViolations() throws Exception {
    String mySchema = "create table BLAH (" + "clm_integer integer not null, " + // column that is partitioned on
    "clm_tinyint tinyint default 0, " + "clm_smallint smallint default 0, " + "clm_bigint bigint default 0, " + "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "PRIMARY KEY(clm_integer) " + "); ";
    int myBatchSize = 2;
    TimestampType currentTime = new TimestampType();
    Object[][] myData = { { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 3, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 4, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 5, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 6, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 7, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 8, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 11, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, //Whole batch fails
    { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 12, 1, 1, 11111111, "first", 1.10, 1.11, currentTime } };
    Integer[] failures = { 5, 6, 9, 10, 14, 15, 16 };
    ArrayList<Integer> expectedFailures = new ArrayList<Integer>(Arrays.asList(failures));
    test_Interface(mySchema, myData, myBatchSize, expectedFailures, 0);
}
Also used : ArrayList(java.util.ArrayList) TimestampType(org.voltdb.types.TimestampType)

Example 53 with TimestampType

use of org.voltdb.types.TimestampType in project voltdb by VoltDB.

the class TestVoltBulkLoader method testBatchOptionLastRowGetsViolationsByFlush.

//Test batch option that splits and gets constraint violations.
public void testBatchOptionLastRowGetsViolationsByFlush() throws Exception {
    String mySchema = "create table BLAH (" + "clm_integer integer not null, " + // column that is partitioned on
    "clm_tinyint tinyint default 0, " + "clm_smallint smallint default 0, " + "clm_bigint bigint default 0, " + "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "clm_geo geography default null," + "clm_geopt geography_point default null, " + "PRIMARY KEY(clm_integer) " + "); ";
    int myBatchSize = 2;
    TimestampType currentTime = new TimestampType();
    Object[][] myData = { { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime, geo, geopt }, { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime, geo, geopt } };
    Integer[] failures = { 2 };
    ArrayList<Integer> expectedFailures = new ArrayList<Integer>(Arrays.asList(failures));
    test_Interface(mySchema, myData, myBatchSize, expectedFailures, 2);
}
Also used : ArrayList(java.util.ArrayList) TimestampType(org.voltdb.types.TimestampType)

Example 54 with TimestampType

use of org.voltdb.types.TimestampType in project voltdb by VoltDB.

the class TestVoltBulkLoader method testSingleTableOnSingleLoader.

//Test single table with single loader.
public void testSingleTableOnSingleLoader() throws Exception {
    String mySchema = "create table BLAH (" + "clm_integer integer not null, " + // column that is partitioned on
    "clm_tinyint tinyint default 0, " + "clm_smallint smallint default 0, " + "clm_bigint bigint default 0, " + "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "PRIMARY KEY(clm_integer) " + "); ";
    TimestampType currentTime = new TimestampType();
    Object[][] myData1 = { { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 3, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 4, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 5, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 6, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 7, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 8, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 9, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 10, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 11, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 12, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 13, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 14, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 15, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 16, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 17, 1, 1, 11111111, "first", 1.10, 1.11, currentTime } };
    int myBatchSize1 = 200;
    Integer[] failures1 = {};
    ArrayList<Integer> expectedFailures1 = new ArrayList<Integer>(Arrays.asList(failures1));
    Object[][] myData2 = { { 18, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 19, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 20, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 21, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 22, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 23, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 24, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 25, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 26, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 27, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 28, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 29, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 30, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 31, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 32, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 33, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 34, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 35, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 36, 1, 1, 11111111, "first", 1.10, 1.11, currentTime } };
    int myBatchSize2 = 5;
    Integer[] failures2 = {};
    ArrayList<Integer> expectedFailures2 = new ArrayList<Integer>(Arrays.asList(failures2));
    test_multiplexing(mySchema, false, false, false, "BLAH", myData1, myBatchSize1, expectedFailures1, false, "BLAH", myData2, myBatchSize2, expectedFailures2, false);
}
Also used : ArrayList(java.util.ArrayList) TimestampType(org.voltdb.types.TimestampType)

Example 55 with TimestampType

use of org.voltdb.types.TimestampType in project voltdb by VoltDB.

the class TestVoltBulkLoader method testSingleTableOnMultipleClients.

//Test single table with multiple clients.
public void testSingleTableOnMultipleClients() throws Exception {
    String mySchema = "create table BLAH (" + "clm_integer integer not null, " + // column that is partitioned on
    "clm_tinyint tinyint default 0, " + "clm_smallint smallint default 0, " + "clm_bigint bigint default 0, " + "clm_string varchar(20) default null, " + "clm_decimal decimal default null, " + "clm_float float default null, " + "clm_timestamp timestamp default null, " + "PRIMARY KEY(clm_integer) " + "); ";
    TimestampType currentTime = new TimestampType();
    Object[][] myData1 = { { 1, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 2, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 3, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 4, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 5, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 6, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 7, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 8, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 9, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 10, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 11, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 12, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 13, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 14, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 15, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 16, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 17, 1, 1, 11111111, "first", 1.10, 1.11, currentTime } };
    int myBatchSize1 = 200;
    Integer[] failures1 = {};
    ArrayList<Integer> expectedFailures1 = new ArrayList<Integer>(Arrays.asList(failures1));
    Object[][] myData2 = { { 18, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 19, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 20, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 21, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 22, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 23, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 24, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 25, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 26, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 27, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 28, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 29, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 30, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 31, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 32, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 33, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 34, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 35, 1, 1, 11111111, "first", 1.10, 1.11, currentTime }, { 36, 1, 1, 11111111, "first", 1.10, 1.11, currentTime } };
    int myBatchSize2 = 3;
    Integer[] failures2 = {};
    ArrayList<Integer> expectedFailures2 = new ArrayList<Integer>(Arrays.asList(failures2));
    test_multiplexing(mySchema, true, true, false, "BLAH", myData1, myBatchSize1, expectedFailures1, false, "BLAH", myData2, myBatchSize2, expectedFailures2, false);
}
Also used : ArrayList(java.util.ArrayList) TimestampType(org.voltdb.types.TimestampType)

Aggregations

TimestampType (org.voltdb.types.TimestampType)127 VoltTable (org.voltdb.VoltTable)37 BigDecimal (java.math.BigDecimal)30 Test (org.junit.Test)23 Client (org.voltdb.client.Client)19 ArrayList (java.util.ArrayList)16 IOException (java.io.IOException)11 GeographyValue (org.voltdb.types.GeographyValue)11 GeographyPointValue (org.voltdb.types.GeographyPointValue)10 Date (java.util.Date)9 File (java.io.File)7 VoltTableRow (org.voltdb.VoltTableRow)7 ProcCallException (org.voltdb.client.ProcCallException)7 ByteBuffer (java.nio.ByteBuffer)5 SimpleDateFormat (java.text.SimpleDateFormat)5 ColumnInfo (org.voltdb.VoltTable.ColumnInfo)5 ClientResponse (org.voltdb.client.ClientResponse)5 Random (java.util.Random)4 VoltType (org.voltdb.VoltType)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2