Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
8380a130
Unverified
Commit
8380a130
authored
6 years ago
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vendor: update leveldb
parent
695a5cce
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
76 additions
and
68 deletions
+76
-68
cache.go
vendor/github.com/syndtr/goleveldb/leveldb/cache/cache.go
+0
-1
bytes_comparer.go
...b.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go
+2
-2
comparer.go
.../github.com/syndtr/goleveldb/leveldb/comparer/comparer.go
+1
-1
db.go
vendor/github.com/syndtr/goleveldb/leveldb/db.go
+1
-1
db_compaction.go
vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go
+9
-15
db_util.go
vendor/github.com/syndtr/goleveldb/leveldb/db_util.go
+1
-1
iter.go
vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter.go
+2
-2
options.go
vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go
+13
-0
session_util.go
vendor/github.com/syndtr/goleveldb/leveldb/session_util.go
+2
-2
table.go
vendor/github.com/syndtr/goleveldb/leveldb/table.go
+16
-14
vendor.json
vendor/vendor.json
+29
-29
No files found.
vendor/github.com/syndtr/goleveldb/leveldb/cache/cache.go
View file @
8380a130
...
...
@@ -331,7 +331,6 @@ func (r *Cache) delete(n *Node) bool {
return
deleted
}
}
return
false
}
// Nodes returns number of 'cache node' in the map.
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go
View file @
8380a130
...
...
@@ -29,7 +29,7 @@ func (bytesComparer) Separator(dst, a, b []byte) []byte {
// Do not shorten if one string is a prefix of the other
}
else
if
c
:=
a
[
i
];
c
<
0xff
&&
c
+
1
<
b
[
i
]
{
dst
=
append
(
dst
,
a
[
:
i
+
1
]
...
)
dst
[
i
]
++
dst
[
len
(
dst
)
-
1
]
++
return
dst
}
return
nil
...
...
@@ -39,7 +39,7 @@ func (bytesComparer) Successor(dst, b []byte) []byte {
for
i
,
c
:=
range
b
{
if
c
!=
0xff
{
dst
=
append
(
dst
,
b
[
:
i
+
1
]
...
)
dst
[
i
]
++
dst
[
len
(
dst
)
-
1
]
++
return
dst
}
}
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/comparer/comparer.go
View file @
8380a130
...
...
@@ -36,7 +36,7 @@ type Comparer interface {
// by any users of this package.
Name
()
string
// Bellow are advanced functions used
used
to reduce the space requirements
// Bellow are advanced functions used to reduce the space requirements
// for internal data structures such as index blocks.
// Separator appends a sequence of bytes x to dst such that a <= x && x < b,
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/db.go
View file @
8380a130
...
...
@@ -182,7 +182,7 @@ func Open(stor storage.Storage, o *opt.Options) (db *DB, err error) {
err
=
s
.
recover
()
if
err
!=
nil
{
if
!
os
.
IsNotExist
(
err
)
||
s
.
o
.
GetErrorIfMissing
()
{
if
!
os
.
IsNotExist
(
err
)
||
s
.
o
.
GetErrorIfMissing
()
||
s
.
o
.
GetReadOnly
()
{
return
}
err
=
s
.
create
()
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/db_compaction.go
View file @
8380a130
...
...
@@ -663,7 +663,7 @@ type cCmd interface {
}
type
cAuto
struct
{
// Note for table compaction, an empty ackC represents it's a compaction waiting command.
// Note for table compaction, an
non-
empty ackC represents it's a compaction waiting command.
ackC
chan
<-
error
}
...
...
@@ -777,8 +777,8 @@ func (db *DB) mCompaction() {
func
(
db
*
DB
)
tCompaction
()
{
var
(
x
cCmd
ackQ
,
waitQ
[]
cCmd
x
cCmd
waitQ
[]
cCmd
)
defer
func
()
{
...
...
@@ -787,10 +787,6 @@ func (db *DB) tCompaction() {
panic
(
x
)
}
}
for
i
:=
range
ackQ
{
ackQ
[
i
]
.
ack
(
ErrClosed
)
ackQ
[
i
]
=
nil
}
for
i
:=
range
waitQ
{
waitQ
[
i
]
.
ack
(
ErrClosed
)
waitQ
[
i
]
=
nil
...
...
@@ -821,11 +817,6 @@ func (db *DB) tCompaction() {
waitQ
=
waitQ
[
:
0
]
}
}
else
{
for
i
:=
range
ackQ
{
ackQ
[
i
]
.
ack
(
nil
)
ackQ
[
i
]
=
nil
}
ackQ
=
ackQ
[
:
0
]
for
i
:=
range
waitQ
{
waitQ
[
i
]
.
ack
(
nil
)
waitQ
[
i
]
=
nil
...
...
@@ -844,9 +835,12 @@ func (db *DB) tCompaction() {
switch
cmd
:=
x
.
(
type
)
{
case
cAuto
:
if
cmd
.
ackC
!=
nil
{
waitQ
=
append
(
waitQ
,
x
)
}
else
{
ackQ
=
append
(
ackQ
,
x
)
// Check the write pause state before caching it.
if
db
.
resumeWrite
()
{
x
.
ack
(
nil
)
}
else
{
waitQ
=
append
(
waitQ
,
x
)
}
}
case
cRange
:
x
.
ack
(
db
.
tableRangeCompaction
(
cmd
.
level
,
cmd
.
min
,
cmd
.
max
))
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/db_util.go
View file @
8380a130
...
...
@@ -84,7 +84,7 @@ func (db *DB) checkAndCleanFiles() error {
var
mfds
[]
storage
.
FileDesc
for
num
,
present
:=
range
tmap
{
if
!
present
{
mfds
=
append
(
mfds
,
storage
.
FileDesc
{
storage
.
TypeTable
,
num
})
mfds
=
append
(
mfds
,
storage
.
FileDesc
{
Type
:
storage
.
TypeTable
,
Num
:
num
})
db
.
logf
(
"db@janitor table missing @%d"
,
num
)
}
}
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter.go
View file @
8380a130
...
...
@@ -40,11 +40,11 @@ type IteratorSeeker interface {
Seek
(
key
[]
byte
)
bool
// Next moves the iterator to the next key/value pair.
// It returns
whether
the iterator is exhausted.
// It returns
false if
the iterator is exhausted.
Next
()
bool
// Prev moves the iterator to the previous key/value pair.
// It returns
whether
the iterator is exhausted.
// It returns
false if
the iterator is exhausted.
Prev
()
bool
}
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/opt/options.go
View file @
8380a130
...
...
@@ -158,6 +158,12 @@ type Options struct {
// The default value is 8MiB.
BlockCacheCapacity
int
// BlockCacheEvictRemoved allows enable forced-eviction on cached block belonging
// to removed 'sorted table'.
//
// The default if false.
BlockCacheEvictRemoved
bool
// BlockRestartInterval is the number of keys between restart points for
// delta encoding of keys.
//
...
...
@@ -384,6 +390,13 @@ func (o *Options) GetBlockCacheCapacity() int {
return
o
.
BlockCacheCapacity
}
func
(
o
*
Options
)
GetBlockCacheEvictRemoved
()
bool
{
if
o
==
nil
{
return
false
}
return
o
.
BlockCacheEvictRemoved
}
func
(
o
*
Options
)
GetBlockRestartInterval
()
int
{
if
o
==
nil
||
o
.
BlockRestartInterval
<=
0
{
return
DefaultBlockRestartInterval
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/session_util.go
View file @
8380a130
...
...
@@ -36,7 +36,7 @@ func (s *session) logf(format string, v ...interface{}) { s.stor.Log(fmt.Sprintf
func
(
s
*
session
)
newTemp
()
storage
.
FileDesc
{
num
:=
atomic
.
AddInt64
(
&
s
.
stTempFileNum
,
1
)
-
1
return
storage
.
FileDesc
{
storage
.
TypeTemp
,
num
}
return
storage
.
FileDesc
{
Type
:
storage
.
TypeTemp
,
Num
:
num
}
}
func
(
s
*
session
)
addFileRef
(
fd
storage
.
FileDesc
,
ref
int
)
int
{
...
...
@@ -190,7 +190,7 @@ func (s *session) recordCommited(rec *sessionRecord) {
// Create a new manifest file; need external synchronization.
func
(
s
*
session
)
newManifest
(
rec
*
sessionRecord
,
v
*
version
)
(
err
error
)
{
fd
:=
storage
.
FileDesc
{
storage
.
TypeManifest
,
s
.
allocFileNum
()}
fd
:=
storage
.
FileDesc
{
Type
:
storage
.
TypeManifest
,
Num
:
s
.
allocFileNum
()}
writer
,
err
:=
s
.
stor
.
Create
(
fd
)
if
err
!=
nil
{
return
...
...
This diff is collapsed.
Click to expand it.
vendor/github.com/syndtr/goleveldb/leveldb/table.go
View file @
8380a130
...
...
@@ -78,7 +78,7 @@ func newTableFile(fd storage.FileDesc, size int64, imin, imax internalKey) *tFil
}
func
tableFileFromRecord
(
r
atRecord
)
*
tFile
{
return
newTableFile
(
storage
.
FileDesc
{
storage
.
TypeTable
,
r
.
num
},
r
.
size
,
r
.
imin
,
r
.
imax
)
return
newTableFile
(
storage
.
FileDesc
{
Type
:
storage
.
TypeTable
,
Num
:
r
.
num
},
r
.
size
,
r
.
imin
,
r
.
imax
)
}
// tFiles hold multiple tFile.
...
...
@@ -290,16 +290,17 @@ func (x *tFilesSortByNum) Less(i, j int) bool {
// Table operations.
type
tOps
struct
{
s
*
session
noSync
bool
cache
*
cache
.
Cache
bcache
*
cache
.
Cache
bpool
*
util
.
BufferPool
s
*
session
noSync
bool
evictRemoved
bool
cache
*
cache
.
Cache
bcache
*
cache
.
Cache
bpool
*
util
.
BufferPool
}
// Creates an empty table and returns table writer.
func
(
t
*
tOps
)
create
()
(
*
tWriter
,
error
)
{
fd
:=
storage
.
FileDesc
{
storage
.
TypeTable
,
t
.
s
.
allocFileNum
()}
fd
:=
storage
.
FileDesc
{
Type
:
storage
.
TypeTable
,
Num
:
t
.
s
.
allocFileNum
()}
fw
,
err
:=
t
.
s
.
stor
.
Create
(
fd
)
if
err
!=
nil
{
return
nil
,
err
...
...
@@ -422,7 +423,7 @@ func (t *tOps) remove(f *tFile) {
}
else
{
t
.
s
.
logf
(
"table@remove removed @%d"
,
f
.
fd
.
Num
)
}
if
t
.
bcache
!=
nil
{
if
t
.
evictRemoved
&&
t
.
bcache
!=
nil
{
t
.
bcache
.
EvictNS
(
uint64
(
f
.
fd
.
Num
))
}
})
...
...
@@ -451,7 +452,7 @@ func newTableOps(s *session) *tOps {
if
!
s
.
o
.
GetDisableBlockCache
()
{
var
bcacher
cache
.
Cacher
if
s
.
o
.
GetBlockCacheCapacity
()
>
0
{
bcacher
=
cache
.
NewLRU
(
s
.
o
.
GetBlockCacheCapacity
())
bcacher
=
s
.
o
.
GetBlockCacher
()
.
New
(
s
.
o
.
GetBlockCacheCapacity
())
}
bcache
=
cache
.
NewCache
(
bcacher
)
}
...
...
@@ -459,11 +460,12 @@ func newTableOps(s *session) *tOps {
bpool
=
util
.
NewBufferPool
(
s
.
o
.
GetBlockSize
()
+
5
)
}
return
&
tOps
{
s
:
s
,
noSync
:
s
.
o
.
GetNoSync
(),
cache
:
cache
.
NewCache
(
cacher
),
bcache
:
bcache
,
bpool
:
bpool
,
s
:
s
,
noSync
:
s
.
o
.
GetNoSync
(),
evictRemoved
:
s
.
o
.
GetBlockCacheEvictRemoved
(),
cache
:
cache
.
NewCache
(
cacher
),
bcache
:
bcache
,
bpool
:
bpool
,
}
}
...
...
This diff is collapsed.
Click to expand it.
vendor/vendor.json
View file @
8380a130
...
...
@@ -455,76 +455,76 @@
"revisionTime"
:
"2017-07-05T02:17:15Z"
},
{
"checksumSHA1"
:
"
k6zbR5hiI10hkWtiK91rIY5s5/E
="
,
"checksumSHA1"
:
"
LV0VMVON7xY1ttV+s2ph83ntmDQ
="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"
EKIow7XkgNdWvR/982ffIZxKG8Y
="
,
"checksumSHA1"
:
"
mPNraL2edpk/2FYq26rSXfMHbJg
="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/cache"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"
5KPgnvCPlR0ysDAqo6jApzRQ3tw
="
,
"checksumSHA1"
:
"
UA+PKDKWlDnE2OZblh23W6wZwbY
="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/comparer"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"1DRAxdlWzS4U0xKN/yQ/fdNN7f0="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/errors"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"eqKeD6DS7eNCtxVYZEHHRKkyZrw="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/filter"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"
weSsccMav4BCerDpSLzh3mMxAYo
="
,
"checksumSHA1"
:
"
hPyFsMiqZ1OB7MX+6wIAA6nsdtc
="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/iterator"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"gJY7bRpELtO0PJpZXgPQ2BYFJ88="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/journal"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"MtYY1b2234y/MlS+djL8tXVAcQs="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/memdb"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"
UmQeotV+m8/FduKEfLOhjdp18rs
="
,
"checksumSHA1"
:
"
o2TorI3z+vc+EBMJ8XeFoUmXBtU
="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/opt"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"ZnyuciM+R19NG8L5YS3TIJdo1e8="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/storage"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"gWFPMz8OQeul0t54RM66yMTX49g="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/table"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"V/Dh7NV0/fy/5jX1KaAjmGcNbzI="
,
"path"
:
"github.com/syndtr/goleveldb/leveldb/util"
,
"revision"
:
"
c4c61651e9e37fa117f53c5a906d3b63090d8445
"
,
"revisionTime"
:
"2018-
07-08T03:05:51
Z"
"revision"
:
"
b001fa50d6b27f3f0bb175a87d0cb55426d0a0ae
"
,
"revisionTime"
:
"2018-
11-28T10:09:59
Z"
},
{
"checksumSHA1"
:
"nD6S4KB0S+YHxVMDDE+w3PyXaMk="
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment