Search in sources :

Example 1 with RandomByteIterator

use of com.yahoo.ycsb.RandomByteIterator in project YCSB by brianfrankcooper.

the class RestWorkload method doTransactionInsert.

@Override
public void doTransactionInsert(DB db) {
    HashMap<String, ByteIterator> value = new HashMap<String, ByteIterator>();
    // Create random bytes of insert data with a specific size.
    value.put("data", new RandomByteIterator(fieldlengthgenerator.nextValue().longValue()));
    db.insert(null, getNextURL(2), value);
}
Also used : ByteIterator(com.yahoo.ycsb.ByteIterator) RandomByteIterator(com.yahoo.ycsb.RandomByteIterator) HashMap(java.util.HashMap) RandomByteIterator(com.yahoo.ycsb.RandomByteIterator)

Example 2 with RandomByteIterator

use of com.yahoo.ycsb.RandomByteIterator in project YCSB by brianfrankcooper.

the class RestWorkload method doTransactionUpdate.

@Override
public void doTransactionUpdate(DB db) {
    HashMap<String, ByteIterator> value = new HashMap<String, ByteIterator>();
    // Create random bytes of update data with a specific size.
    value.put("data", new RandomByteIterator(fieldlengthgenerator.nextValue().longValue()));
    db.update(null, getNextURL(4), value);
}
Also used : ByteIterator(com.yahoo.ycsb.ByteIterator) RandomByteIterator(com.yahoo.ycsb.RandomByteIterator) HashMap(java.util.HashMap) RandomByteIterator(com.yahoo.ycsb.RandomByteIterator)

Aggregations

ByteIterator (com.yahoo.ycsb.ByteIterator)2 RandomByteIterator (com.yahoo.ycsb.RandomByteIterator)2 HashMap (java.util.HashMap)2