Search in sources :

Example 21 with Status

use of site.ycsb.Status in project YCSB by brianfrankcooper.

the class RestClientTest method update_500.

@Test
public void update_500() {
    HashMap<String, ByteIterator> data = new HashMap<String, ByteIterator>();
    data.put(DATA_TAG, new StringByteIterator(INPUT_DATA));
    Status status = rc.update(null, INVALID_RESOURCE, data);
    assertEquals(Status.ERROR, status);
}
Also used : Status(site.ycsb.Status) ByteIterator(site.ycsb.ByteIterator) StringByteIterator(site.ycsb.StringByteIterator) HashMap(java.util.HashMap) StringByteIterator(site.ycsb.StringByteIterator) Test(org.junit.Test)

Example 22 with Status

use of site.ycsb.Status in project YCSB by brianfrankcooper.

the class RadosClientTest method insertTest.

@Test
public void insertTest() {
    Status result = radosclient.insert(TABLE_NAME, KEY1, DATA);
    assertEquals(Status.OK, result);
}
Also used : Status(site.ycsb.Status) Test(org.junit.Test)

Example 23 with Status

use of site.ycsb.Status in project YCSB by brianfrankcooper.

the class HBaseClient1Test method testUpdate.

@Test
public void testUpdate() throws Exception {
    final String key = "key";
    final HashMap<String, String> input = new HashMap<String, String>();
    input.put("column1", "value1");
    input.put("column2", "value2");
    final Status status = client.insert(tableName, key, StringByteIterator.getByteIteratorMap(input));
    assertEquals(Status.OK, status);
    // Verify result
    final Get get = new Get(Bytes.toBytes(key));
    final Result result = this.table.get(get);
    assertFalse(result.isEmpty());
    assertEquals(2, result.size());
    for (final java.util.Map.Entry<String, String> entry : input.entrySet()) {
        assertEquals(entry.getValue(), new String(result.getValue(Bytes.toBytes(COLUMN_FAMILY), Bytes.toBytes(entry.getKey()))));
    }
}
Also used : Status(site.ycsb.Status) HashMap(java.util.HashMap) Get(org.apache.hadoop.hbase.client.Get) HashMap(java.util.HashMap) Result(org.apache.hadoop.hbase.client.Result) Test(org.junit.Test)

Example 24 with Status

use of site.ycsb.Status in project YCSB by brianfrankcooper.

the class HBaseClient1Test method testReadMissingRow.

@Test
public void testReadMissingRow() throws Exception {
    final HashMap<String, ByteIterator> result = new HashMap<String, ByteIterator>();
    final Status status = client.read(tableName, "Missing row", null, result);
    assertEquals(Status.NOT_FOUND, status);
    assertEquals(0, result.size());
}
Also used : Status(site.ycsb.Status) ByteIterator(site.ycsb.ByteIterator) StringByteIterator(site.ycsb.StringByteIterator) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 25 with Status

use of site.ycsb.Status in project YCSB by brianfrankcooper.

the class IgniteClientTest method testDelete.

@Test
public void testDelete() throws Exception {
    cluster.cache(DEFAULT_CACHE_NAME).clear();
    final String key1 = "key1";
    final Map<String, String> input1 = new HashMap<>();
    input1.put("field0", "value1");
    input1.put("field1", "value2");
    final Status status1 = client.insert(DEFAULT_CACHE_NAME, key1, StringByteIterator.getByteIteratorMap(input1));
    assertThat(status1, is(Status.OK));
    assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(1));
    final String key2 = "key2";
    final Map<String, String> input2 = new HashMap<>();
    input2.put("field0", "value1");
    input2.put("field1", "value2");
    final Status status2 = client.insert(DEFAULT_CACHE_NAME, key2, StringByteIterator.getByteIteratorMap(input2));
    assertThat(status2, is(Status.OK));
    assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(2));
    final Status status3 = client.delete(DEFAULT_CACHE_NAME, key2);
    assertThat(status3, is(Status.OK));
    assertThat(cluster.cache(DEFAULT_CACHE_NAME).size(), is(1));
}
Also used : Status(site.ycsb.Status) Test(org.junit.Test)

Aggregations

Status (site.ycsb.Status)101 Test (org.junit.Test)80 ByteIterator (site.ycsb.ByteIterator)62 HashMap (java.util.HashMap)60 StringByteIterator (site.ycsb.StringByteIterator)60 ResultSet (com.datastax.driver.core.ResultSet)6 Row (com.datastax.driver.core.Row)6 Select (com.datastax.driver.core.querybuilder.Select)6 Vector (java.util.Vector)6 ByteArrayByteIterator (site.ycsb.ByteArrayByteIterator)5 DBException (site.ycsb.DBException)5 Assume.assumeNoException (org.junit.Assume.assumeNoException)4 DB (site.ycsb.DB)4 Get (org.apache.hadoop.hbase.client.Get)3 Put (org.apache.hadoop.hbase.client.Put)3 Result (org.apache.hadoop.hbase.client.Result)3 DatastoreException (com.google.datastore.v1.client.DatastoreException)2 Map (java.util.Map)2 User (org.apache.gora.benchmark.generated.User)2 NumericByteIterator (site.ycsb.NumericByteIterator)2