Skip to content

Commit

Permalink
mvcc: create TxnWrites from TxnRead with NewReadOnlyTxnWrite
Browse files Browse the repository at this point in the history
Already used internally by mvcc, but needed by etcdserver txns.
  • Loading branch information
Anthony Romano committed Jun 9, 2017
1 parent ad22aaa commit da48f1f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mvcc/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ func (trw *txnReadWrite) DeleteRange(key, end []byte) (n, rev int64) { panic("un
func (trw *txnReadWrite) Put(key, value []byte, lease lease.LeaseID) (rev int64) {
panic("unexpected Put")
}
func (trw *txnReadWrite) Changes() []mvccpb.KeyValue { panic("unexpected Changes") }
func (trw *txnReadWrite) Changes() []mvccpb.KeyValue { return nil }

func NewReadOnlyTxnWrite(txn TxnRead) TxnWrite { return &txnReadWrite{txn} }

type KV interface {
ReadView
Expand Down

0 comments on commit da48f1f

Please sign in to comment.