benchmark: support mvcc txn

This commit is contained in:
Anthony Romano 2017-01-05 01:16:15 -08:00
parent 58da8b17ee
commit 0ed3c83e49

View File

@ -109,12 +109,9 @@ func mvccPutFunc(cmd *cobra.Command, args []string) {
for i := 0; i < totalNrKeys; i++ {
st := time.Now()
if txn {
id := s.TxnBegin()
if _, err := s.TxnPut(id, keys[i], vals[i], lease.NoLease); err != nil {
fmt.Fprintln(os.Stderr, "txn put error:", err)
os.Exit(1)
}
s.TxnEnd(id)
tw := s.Write()
tw.Put(keys[i], vals[i], lease.NoLease)
tw.End()
} else {
s.Put(keys[i], vals[i], lease.NoLease)
}