Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compression/rle: delete RLE compression #16468

Merged
merged 1 commit into from
Apr 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 0 additions & 101 deletions compression/rle/read_write.go

This file was deleted.

50 changes: 0 additions & 50 deletions compression/rle/read_write_test.go

This file was deleted.

6 changes: 0 additions & 6 deletions ethdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ func (db *LDBDatabase) Path() string {

// Put puts the given key / value to the queue
func (db *LDBDatabase) Put(key []byte, value []byte) error {
// Generate the data to write to disk, update the meter and write
//value = rle.Compress(value)

return db.db.Put(key, value, nil)
}

Expand All @@ -103,18 +100,15 @@ func (db *LDBDatabase) Has(key []byte) (bool, error) {

// Get returns the given key if it's present.
func (db *LDBDatabase) Get(key []byte) ([]byte, error) {
// Retrieve the key and increment the miss counter if not found
dat, err := db.db.Get(key, nil)
if err != nil {
return nil, err
}
return dat, nil
//return rle.Decompress(dat)
}

// Delete deletes the key from the queue and database
func (db *LDBDatabase) Delete(key []byte) error {
// Execute the actual operation
return db.db.Delete(key, nil)
}

Expand Down
15 changes: 2 additions & 13 deletions swarm/storage/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ package storage
import (
"fmt"

"github.com/ethereum/go-ethereum/compression/rle"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
Expand All @@ -31,8 +30,7 @@ import (
const openFileLimit = 128

type LDBDatabase struct {
db *leveldb.DB
comp bool
db *leveldb.DB
}

func NewLDBDatabase(file string) (*LDBDatabase, error) {
Expand All @@ -42,16 +40,12 @@ func NewLDBDatabase(file string) (*LDBDatabase, error) {
return nil, err
}

database := &LDBDatabase{db: db, comp: false}
database := &LDBDatabase{db: db}

return database, nil
}

func (self *LDBDatabase) Put(key []byte, value []byte) {
if self.comp {
value = rle.Compress(value)
}

err := self.db.Put(key, value, nil)
if err != nil {
fmt.Println("Error put", err)
Expand All @@ -63,11 +57,6 @@ func (self *LDBDatabase) Get(key []byte) ([]byte, error) {
if err != nil {
return nil, err
}

if self.comp {
return rle.Decompress(dat)
}

return dat, nil
}

Expand Down