Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
efdef273
Commit
efdef273
authored
Oct 16, 2019
by
liuyuhang
Committed by
33cn
Oct 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Independent enable kvmvcc prune
parent
b8fa1f7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
chain33.toml
chain33.toml
+1
-0
kvmvcc_mavl.go
plugin/store/kvmvccmavl/kvmvcc_mavl.go
+3
-2
kvmvccdb.go
plugin/store/kvmvccmavl/kvmvccdb.go
+4
-4
No files found.
chain33.toml
View file @
efdef273
...
...
@@ -171,6 +171,7 @@ enableMVCCIter=true
enableMavlPrefix
=
false
enableMVCC
=
false
enableMavlPrune
=
false
enableMVCCPrune
=
false
pruneHeight
=
10000
# 是否使能mavl数据载入内存
enableMemTree
=
true
...
...
plugin/store/kvmvccmavl/kvmvcc_mavl.go
View file @
efdef273
...
...
@@ -74,7 +74,7 @@ type KVmMavlStore struct {
type
subKVMVCCConfig
struct
{
EnableMVCCIter
bool
`json:"enableMVCCIter"`
EnableM
avlPrune
bool
`json:"enableMavl
Prune"`
EnableM
VCCPrune
bool
`json:"enableMVCC
Prune"`
PruneHeight
int32
`json:"pruneHeight"`
}
...
...
@@ -96,6 +96,7 @@ type subConfig struct {
EnableMavlPrefix
bool
`json:"enableMavlPrefix"`
EnableMVCC
bool
`json:"enableMVCC"`
EnableMavlPrune
bool
`json:"enableMavlPrune"`
EnableMVCCPrune
bool
`json:"enableMVCCPrune"`
PruneHeight
int32
`json:"pruneHeight"`
// 是否使能内存树
EnableMemTree
bool
`json:"enableMemTree"`
...
...
@@ -114,7 +115,7 @@ func New(cfg *types.Store, sub []byte) queue.Module {
if
sub
!=
nil
{
types
.
MustDecode
(
sub
,
&
subcfg
)
subKVMVCCcfg
.
EnableMVCCIter
=
subcfg
.
EnableMVCCIter
subKVMVCCcfg
.
EnableM
avlPrune
=
subcfg
.
EnableMavl
Prune
subKVMVCCcfg
.
EnableM
VCCPrune
=
subcfg
.
EnableMVCC
Prune
subKVMVCCcfg
.
PruneHeight
=
subcfg
.
PruneHeight
subMavlcfg
.
EnableMavlPrefix
=
subcfg
.
EnableMavlPrefix
...
...
plugin/store/kvmvccmavl/kvmvccdb.go
View file @
efdef273
...
...
@@ -52,7 +52,7 @@ type KVMVCCStore struct {
mvcc
dbm
.
MVCC
kvsetmap
map
[
string
][]
*
types
.
KeyValue
enableMVCCIter
bool
enableM
avl
Prune
bool
enableM
VCC
Prune
bool
pruneHeight
int32
sync
bool
}
...
...
@@ -66,12 +66,12 @@ func NewKVMVCC(sub *subKVMVCCConfig, db dbm.DB) *KVMVCCStore {
}
if
enable
{
kvs
=
&
KVMVCCStore
{
db
,
dbm
.
NewMVCCIter
(
db
),
make
(
map
[
string
][]
*
types
.
KeyValue
),
true
,
sub
.
EnableM
avl
Prune
,
sub
.
PruneHeight
,
false
}
true
,
sub
.
EnableM
VCC
Prune
,
sub
.
PruneHeight
,
false
}
}
else
{
kvs
=
&
KVMVCCStore
{
db
,
dbm
.
NewMVCC
(
db
),
make
(
map
[
string
][]
*
types
.
KeyValue
),
false
,
sub
.
EnableM
avl
Prune
,
sub
.
PruneHeight
,
false
}
false
,
sub
.
EnableM
VCC
Prune
,
sub
.
PruneHeight
,
false
}
}
EnablePrune
(
sub
.
EnableM
avl
Prune
)
EnablePrune
(
sub
.
EnableM
VCC
Prune
)
SetPruneHeight
(
int
(
sub
.
PruneHeight
))
return
kvs
}
...
...
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