public boolean doInsert(DB db,Object threadstate) throws WorkloadException {
  int keynum=keysequence.nextInt();
  String dbkey=buildKeyName(keynum);
  HashMap<String,ByteIterator> values=buildValues();
  if (db.insert(table,dbkey,values) == 0) {
    actualopcount.addAndGet(1);
    return true;
  }
 else {
    return false;
  }
}

public boolean doInsert ( DB db , Object threadstate ) throws WorkloadException { int keynum = keysequence . nextInt ( ) ; String dbkey = buildKeyName ( keynum ) ; HashMap < String , ByteIterator > values = buildValues ( ) ; if ( db . insert ( table , dbkey , values ) == 0 ) { actualopcount . addAndGet ( 1 ) ; return true ; } else { return false ; } }
do one insert operation . because it will be called concurrently from multiple client threads , this function must be thread safe . however , avoid synchronized , or the threads will block waiting for each other , and it will be difficult to reach the target throughput . ideally , this function would have no side effects other than db operations .
