NewWriteBatchAt is similar to NewWriteBatch but it allows user to set the commit timestamp. NewWriteBatchAt is supposed to be used only in the managed mode.
(commitTs uint64)
| 43 | // NewWriteBatchAt is similar to NewWriteBatch but it allows user to set the commit timestamp. |
| 44 | // NewWriteBatchAt is supposed to be used only in the managed mode. |
| 45 | func (db *DB) NewWriteBatchAt(commitTs uint64) *WriteBatch { |
| 46 | if !db.opt.managedTxns { |
| 47 | panic("cannot use NewWriteBatchAt with managedDB=false. Use NewWriteBatch instead") |
| 48 | } |
| 49 | |
| 50 | wb := db.newWriteBatch(true) |
| 51 | wb.commitTs = commitTs |
| 52 | wb.txn.commitTs = commitTs |
| 53 | return wb |
| 54 | } |
| 55 | func (db *DB) NewManagedWriteBatch() *WriteBatch { |
| 56 | if !db.opt.managedTxns { |
| 57 | panic("cannot use NewManagedWriteBatch with managedDB=false. Use NewWriteBatch instead") |