aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb/batch.go
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-03-26 22:48:31 +0800
committerFelix Lange <fjl@users.noreply.github.com>2019-03-26 22:48:31 +0800
commit59e195324643e8f3a18396b529e3350e550fdecc (patch)
tree80850abf25e40b1e3a5bd359dacc654b651d8c73 /ethdb/batch.go
parentdf717abc999add34c5725ab86dce1fcee968ca10 (diff)
downloadgo-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.gz
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.bz2
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.lz
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.xz
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.tar.zst
go-tangerine-59e195324643e8f3a18396b529e3350e550fdecc.zip
core, ethdb, trie: mode dirty data to clean cache on flush (#19307)
This PR is a more advanced form of the dirty-to-clean cacher (#18995), where we reuse previous database write batches as datasets to uncache, saving a dirty-trie-iteration and a dirty-trie-rlp-reencoding per block.
Diffstat (limited to 'ethdb/batch.go')
-rw-r--r--ethdb/batch.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/ethdb/batch.go b/ethdb/batch.go
index a6f015821..a9c406354 100644
--- a/ethdb/batch.go
+++ b/ethdb/batch.go
@@ -24,7 +24,6 @@ const IdealBatchSize = 100 * 1024
// when Write is called. A batch cannot be used concurrently.
type Batch interface {
Writer
- Deleter
// ValueSize retrieves the amount of data queued up for writing.
ValueSize() int
@@ -32,8 +31,11 @@ type Batch interface {
// Write flushes any accumulated data to disk.
Write() error
- // Reset resets the batch for reuse
+ // Reset resets the batch for reuse.
Reset()
+
+ // Replay replays the batch contents.
+ Replay(w Writer) error
}
// Batcher wraps the NewBatch method of a backing data store.