refactoring: remove unused functions

This commit is contained in:
Chris Lu 2019-09-09 10:03:41 -07:00
parent 0f861d23a2
commit 02710f9624
2 changed files with 0 additions and 31 deletions

View file

@ -2,7 +2,6 @@ package storage
import ( import (
"fmt" "fmt"
"io/ioutil"
"os" "os"
"sync" "sync"
@ -31,8 +30,6 @@ type NeedleMapper interface {
DeletedCount() int DeletedCount() int
MaxFileKey() NeedleId MaxFileKey() NeedleId
IndexFileSize() uint64 IndexFileSize() uint64
IndexFileContent() ([]byte, error)
IndexFileName() string
} }
type baseNeedleMapper struct { type baseNeedleMapper struct {
@ -50,10 +47,6 @@ func (nm *baseNeedleMapper) IndexFileSize() uint64 {
return 0 return 0
} }
func (nm *baseNeedleMapper) IndexFileName() string {
return nm.indexFile.Name()
}
func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size uint32) error { func (nm *baseNeedleMapper) appendToIndexFile(key NeedleId, offset Offset, size uint32) error {
bytes := needle_map.ToBytes(key, offset, size) 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) _, err := nm.indexFile.Write(bytes)
return err return err
} }
func (nm *baseNeedleMapper) IndexFileContent() ([]byte, error) {
nm.indexFileAccessLock.Lock()
defer nm.indexFileAccessLock.Unlock()
return ioutil.ReadFile(nm.indexFile.Name())
}

View file

@ -140,24 +140,6 @@ func (v *Volume) IndexFileSize() uint64 {
return v.nm.IndexFileSize() 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 // Close cleanly shuts down this volume
func (v *Volume) Close() { func (v *Volume) Close() {
v.dataFileAccessLock.Lock() v.dataFileAccessLock.Lock()