func NewLevelDBWal(filename string) (p *LevelDBWal, err error) {
	p = &LevelDBWal{}
	if p.db, err = leveldb.OpenFile(filename, nil); err != nil {
		err = errors.Wrap(err, "open database failed")
		return
	}
	return
}
NewLevelDBWal returns new leveldb wal instance.
package wal
import (
	"bytes"
	"encoding/binary"
	"io"
	"sync"
	"sync/atomic"
	"github.com/pkg/errors"
	"github.com/syndtr/goleveldb/leveldb"
	"github.com/syndtr/goleveldb/leveldb/iterator"
	"github.com/syndtr/goleveldb/leveldb/util"
	kt "github.com/SQLess/SQLess/kayak/types"
	"github.com/SQLess/SQLess/utils"
	"github.com/SQLess/SQLess/utils/log"
)
var (
	logHeaderKeyPrefix = []byte{'L', 'H'}
	logDataKeyPrefix = []byte{'L', 'D'}
)
type LevelDBWal struct {
	db       *leveldb.DB
	it       iterator.Iterator
	closed   uint32
	readLock sync.Mutex
	read     uint32
}