diff --git a/leveldb/db/batch.go b/leveldb/db/batch.go
index <HASH>..<HASH> 100644
--- a/leveldb/db/batch.go
+++ b/leveldb/db/batch.go
@@ -18,6 +18,7 @@ import (
 	"encoding/binary"
 	"io"
 	"leveldb"
+	"leveldb/memdb"
 )
 
 var (
@@ -53,6 +54,14 @@ func (b *Batch) Delete(key []byte) {
 	b.kvSize += len(key)
 }
 
+func (b *Batch) Reset() {
+	b.rec = b.rec[:0]
+	b.sequence = 0
+	b.kvSize = 0
+	b.ch = nil
+	b.sync = false
+}
+
 func (b *Batch) init(sync bool) chan error {
 	ch := make(chan error)
 	b.ch = nil
@@ -173,6 +182,13 @@ func (b *Batch) replay(to batchReplay) {
 	}
 }
 
+func (b *Batch) memReplay(to *memdb.DB) {
+	for i, rec := range b.rec {
+		ikey := newIKey(rec.key, b.sequence+uint64(i), rec.t)
+		to.Put(ikey, rec.value)
+	}
+}
+
 func decodeBatchHeader(b []byte, seq *uint64, n *uint32) (err error) {
 	if len(b) < 12 {
 		return errBatchTooShort
fb: batch: introduce *Batch.Reset() and *Batch.memReplay() methods