diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-09-09 10:03:41 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-09-09 10:03:41 -0700 |
| commit | 02710f96244903bb99fc6376531159d18735afdc (patch) | |
| tree | 8dc938a457fd9c30b3ed772db35f5cad246e3836 | |
| parent | 0f861d23a29d4ecb0f5a020ea68c211fcdd123c9 (diff) | |
| download | seaweedfs-02710f96244903bb99fc6376531159d18735afdc.tar.xz seaweedfs-02710f96244903bb99fc6376531159d18735afdc.zip | |
refactoring: remove unused functions
| -rw-r--r-- | weed/storage/needle_map.go | 13 | ||||
| -rw-r--r-- | weed/storage/volume.go | 18 |
2 files changed, 0 insertions, 31 deletions
diff --git a/weed/storage/needle_map.go b/weed/storage/needle_map.go index 876839be1..77d081ea7 100644 --- a/weed/storage/needle_map.go +++ b/weed/storage/needle_map.go @@ -2,7 +2,6 @@ package storage import ( "fmt" - "io/ioutil" "os" "sync" @@ -31,8 +30,6 @@ type NeedleMapper interface { DeletedCount() int MaxFileKey() NeedleId IndexFileSize() uint64 - IndexFileContent() ([]byte, error) - IndexFileName() string } type baseNeedleMapper struct { @@ -50,10 +47,6 @@ func (nm *baseNeedleMapper) IndexFileSize() uint64 { return 0 } -func (nm *baseNeedleMapper) IndexFileName() string { - return nm.indexFile.Name() -} - func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size uint32) error { bytes := needle_map.ToBytes(key, offset, size) @@ -66,9 +59,3 @@ func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size _, err := nm.indexFile.Write(bytes) return err } - -func (nm *baseNeedleMapper) IndexFileContent() ([]byte, error) { - nm.indexFileAccessLock.Lock() - defer nm.indexFileAccessLock.Unlock() - return ioutil.ReadFile(nm.indexFile.Name()) -} diff --git a/weed/storage/volume.go b/weed/storage/volume.go index 9c3f74ca4..301610ab6 100644 --- a/weed/storage/volume.go +++ b/weed/storage/volume.go @@ -140,24 +140,6 @@ func (v *Volume) IndexFileSize() uint64 { return v.nm.IndexFileSize() } -func (v *Volume) IndexFileContent() ([]byte, error) { - v.dataFileAccessLock.Lock() - defer v.dataFileAccessLock.Unlock() - if v.nm == nil { - return nil, nil - } - return v.nm.IndexFileContent() -} - -func (v *Volume) IndexFileName() string { - v.dataFileAccessLock.Lock() - defer v.dataFileAccessLock.Unlock() - if v.nm == nil { - return "" - } - return v.nm.IndexFileName() -} - // Close cleanly shuts down this volume func (v *Volume) Close() { v.dataFileAccessLock.Lock() |
