Skip to content

Commit

Permalink
no MigrateTable
Browse files Browse the repository at this point in the history
  • Loading branch information
JukLee0ira committed Sep 25, 2024
1 parent a3b0e3b commit bb86a90
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 31 deletions.
1 change: 0 additions & 1 deletion XDCxDAO/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type XDCXDAO interface {
AppendAncient(number uint64, hash, header, body, receipt, td []byte) error
TruncateAncients(n uint64) error
Sync() error
MigrateTable(string, func([]byte) ([]byte, error)) error //type convertLegacyFn = func([]byte) ([]byte, error)
NewIterator(prefix []byte, start []byte) ethdb.Iterator

Stat(property string) (string, error)
Expand Down
6 changes: 0 additions & 6 deletions XDCxDAO/leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ func (db *BatchDatabase) Sync() error {
return errNotSupported
}

// MigrateTable processes the entries in a given table in sequence
// converting them to a new format if they're of an old format.
func (db *BatchDatabase) MigrateTable(kind string, convert func([]byte) ([]byte, error)) error {
return errNotSupported
}

func (db *BatchDatabase) NewIterator(prefix []byte, start []byte) ethdb.Iterator {
panic("NewIterator from XDCxDAO leveldb is not supported")
}
Expand Down
6 changes: 0 additions & 6 deletions XDCxDAO/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,12 +873,6 @@ func (db *MongoDatabase) Sync() error {
return errNotSupported
}

// MigrateTable processes the entries in a given table in sequence
// converting them to a new format if they're of an old format.
func (db *MongoDatabase) MigrateTable(kind string, convert func([]byte) ([]byte, error)) error {
return errNotSupported
}

func (db *MongoDatabase) NewIterator(prefix []byte, start []byte) ethdb.Iterator {
panic("NewIterator from XDCxDAO mongodb is not supported")
}
Expand Down
6 changes: 0 additions & 6 deletions core/rawdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ func (db *nofreezedb) Sync() error {
return errNotSupported
}

// MigrateTable processes the entries in a given table in sequence
// converting them to a new format if they're of an old format.
func (db *nofreezedb) MigrateTable(kind string, convert convertLegacyFn) error {
return errNotSupported
}

// NewDatabase creates a high level database on top of a given key-value data
// store without a freezer moving immutable chain segments into cold storage.
func NewDatabase(db ethdb.KeyValueStore) ethdb.Database {
Expand Down
6 changes: 0 additions & 6 deletions core/rawdb/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,6 @@ func (t *table) Sync() error {
return t.db.Sync()
}

// MigrateTable processes the entries in a given table in sequence
// converting them to a new format if they're of an old format.
func (t *table) MigrateTable(kind string, convert convertLegacyFn) error {
return t.db.MigrateTable(kind, convert)
}

// Put inserts the given value into the database at a prefixed version of the
// provided key.
func (t *table) Put(key []byte, value []byte) error {
Expand Down
8 changes: 2 additions & 6 deletions ethdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
package ethdb

import (
"github.com/XinFinOrg/XDPoSChain/common"
"io"

"github.com/XinFinOrg/XDPoSChain/common"
)

// KeyValueReader wraps the Has and Get method of a backing data store.
Expand Down Expand Up @@ -97,11 +98,6 @@ type AncientWriter interface {

// Sync flushes all in-memory ancient store data to disk.
Sync() error

// MigrateTable processes and migrates entries of a given table to a new format.
// The second argument is a function that takes a raw entry and returns it
// in the newest format.
MigrateTable(string, func([]byte) ([]byte, error)) error
}

// Reader contains the methods required to read data from both key-value as well as
Expand Down

0 comments on commit bb86a90

Please sign in to comment.