vendor: update leveldb

This commit is contained in:
rjl493456442 2017-12-13 10:32:17 +08:00
parent f258a21a63
commit a30dc0ce7c
6 changed files with 21 additions and 8 deletions

View file

@ -321,7 +321,7 @@ func recoverTable(s *session, o *opt.Options) error {
} }
} }
err = iter.Error() err = iter.Error()
if err != nil { if err != nil && !errors.IsCorrupted(err) {
return return
} }
err = tw.Close() err = tw.Close()
@ -392,7 +392,7 @@ func recoverTable(s *session, o *opt.Options) error {
} }
imax = append(imax[:0], key...) imax = append(imax[:0], key...)
} }
if err := iter.Error(); err != nil { if err := iter.Error(); err != nil && !errors.IsCorrupted(err) {
iter.Release() iter.Release()
return err return err
} }

View file

@ -88,7 +88,7 @@ type Iterator interface {
// its contents may change on the next call to any 'seeks method'. // its contents may change on the next call to any 'seeks method'.
Key() []byte Key() []byte
// Value returns the key of the current key/value pair, or nil if done. // Value returns the value of the current key/value pair, or nil if done.
// The caller should not modify the contents of the returned slice, and // The caller should not modify the contents of the returned slice, and
// its contents may change on the next call to any 'seeks method'. // its contents may change on the next call to any 'seeks method'.
Value() []byte Value() []byte

View file

@ -329,7 +329,7 @@ func (p *DB) Delete(key []byte) error {
h := p.nodeData[node+nHeight] h := p.nodeData[node+nHeight]
for i, n := range p.prevNode[:h] { for i, n := range p.prevNode[:h] {
m := n + 4 + i m := n + nNext + i
p.nodeData[m] = p.nodeData[p.nodeData[m]+nNext+i] p.nodeData[m] = p.nodeData[p.nodeData[m]+nNext+i]
} }

View file

@ -41,6 +41,7 @@ var (
DefaultWriteBuffer = 4 * MiB DefaultWriteBuffer = 4 * MiB
DefaultWriteL0PauseTrigger = 12 DefaultWriteL0PauseTrigger = 12
DefaultWriteL0SlowdownTrigger = 8 DefaultWriteL0SlowdownTrigger = 8
DefaultSuspendedWriteStatSize = 100
) )
// Cacher is a caching algorithm. // Cacher is a caching algorithm.
@ -357,6 +358,11 @@ type Options struct {
// //
// The default value is 8. // The default value is 8.
WriteL0SlowdownTrigger int WriteL0SlowdownTrigger int
// SuspendedWriteStatSize defines the upper limit of the cached suspended write operation statistics.
//
// The default value is 100.
SuspendedWriteStatSize int
} }
func (o *Options) GetAltFilters() []filter.Filter { func (o *Options) GetAltFilters() []filter.Filter {
@ -609,6 +615,13 @@ func (o *Options) GetWriteL0SlowdownTrigger() int {
return o.WriteL0SlowdownTrigger return o.WriteL0SlowdownTrigger
} }
func (o *Options) GetSuspendedWriteStatSize() int {
if o == nil || o.SuspendedWriteStatSize == 0 {
return DefaultSuspendedWriteStatSize
}
return o.SuspendedWriteStatSize
}
// ReadOptions holds the optional parameters for 'read operation'. The // ReadOptions holds the optional parameters for 'read operation'. The
// 'read operation' includes Get, Find and NewIterator. // 'read operation' includes Get, Find and NewIterator.
type ReadOptions struct { type ReadOptions struct {

View file

@ -19,7 +19,7 @@ var (
// Releaser is the interface that wraps the basic Release method. // Releaser is the interface that wraps the basic Release method.
type Releaser interface { type Releaser interface {
// Release releases associated resources. Release should always success // Release releases associated resources. Release should always success
// and can be called multipe times without causing error. // and can be called multiple times without causing error.
Release() Release()
} }

6
vendor/vendor.json vendored
View file

@ -358,10 +358,10 @@
"revisionTime": "2017-07-05T02:17:15Z" "revisionTime": "2017-07-05T02:17:15Z"
}, },
{ {
"checksumSHA1": "yHbyLpI/Meh0DGrmi8x6FrDxxUY=", "checksumSHA1": "spMeORRgS1azN91KYqJgoxBmhMw=",
"path": "github.com/syndtr/goleveldb/leveldb", "path": "github.com/syndtr/goleveldb/leveldb",
"revision": "b89cc31ef7977104127d34c1bd31ebd1a9db2199", "revision": "3d8f4155ffd9029d32e5cf03853b58759b6e3710",
"revisionTime": "2017-07-25T06:48:36Z" "revisionTime": "2017-12-09T15:37:43Z"
}, },
{ {
"checksumSHA1": "EKIow7XkgNdWvR/982ffIZxKG8Y=", "checksumSHA1": "EKIow7XkgNdWvR/982ffIZxKG8Y=",