Search in sources :

Example 1 with RandomByteIterator

use of site.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 : RandomByteIterator(site.ycsb.RandomByteIterator) ByteIterator(site.ycsb.ByteIterator) HashMap(java.util.HashMap) RandomByteIterator(site.ycsb.RandomByteIterator)

Example 2 with RandomByteIterator

use of site.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 : RandomByteIterator(site.ycsb.RandomByteIterator) ByteIterator(site.ycsb.ByteIterator) HashMap(java.util.HashMap) RandomByteIterator(site.ycsb.RandomByteIterator)

Aggregations

HashMap (java.util.HashMap)2 ByteIterator (site.ycsb.ByteIterator)2 RandomByteIterator (site.ycsb.RandomByteIterator)2