mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
rename .sdb to .sdx
This commit is contained in:
parent
abffe857a1
commit
f42b5bd0f5
|
@ -19,15 +19,15 @@ type SortedFileNeedleMap struct {
|
|||
func NewSortedFileNeedleMap(baseFileName string, indexFile *os.File) (m *SortedFileNeedleMap, err error) {
|
||||
m = &SortedFileNeedleMap{baseFileName: baseFileName}
|
||||
m.indexFile = indexFile
|
||||
fileName := baseFileName + ".sdb"
|
||||
fileName := baseFileName + ".sdx"
|
||||
if !isSortedFileFresh(fileName, indexFile) {
|
||||
glog.V(0).Infof("Start to Generate %s from %s", fileName, indexFile.Name())
|
||||
erasure_coding.WriteSortedFileFromIdx(baseFileName, ".sdb")
|
||||
erasure_coding.WriteSortedFileFromIdx(baseFileName, ".sdx")
|
||||
glog.V(0).Infof("Finished Generating %s from %s", fileName, indexFile.Name())
|
||||
}
|
||||
glog.V(1).Infof("Opening %s...", fileName)
|
||||
|
||||
if m.dbFile, err = os.Open(baseFileName + ".sdb"); err != nil {
|
||||
if m.dbFile, err = os.Open(baseFileName + ".sdx"); err != nil {
|
||||
return
|
||||
}
|
||||
dbStat, _ := m.dbFile.Stat()
|
||||
|
@ -101,5 +101,5 @@ func (m *SortedFileNeedleMap) Close() {
|
|||
func (m *SortedFileNeedleMap) Destroy() error {
|
||||
m.Close()
|
||||
os.Remove(m.indexFile.Name())
|
||||
return os.Remove(m.baseFileName + ".sdb")
|
||||
return os.Remove(m.baseFileName + ".sdx")
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
|
|||
|
||||
if v.noWriteOrDelete || v.noWriteCanDelete {
|
||||
if v.nm, err = NewSortedFileNeedleMap(fileName, indexFile); err != nil {
|
||||
glog.V(0).Infof("loading sorted db %s error: %v", fileName+".sdb", err)
|
||||
glog.V(0).Infof("loading sorted db %s error: %v", fileName+".sdx", err)
|
||||
}
|
||||
} else {
|
||||
switch needleMapKind {
|
||||
|
|
|
@ -50,7 +50,7 @@ func (v *Volume) Destroy() (err error) {
|
|||
os.Remove(v.FileName() + ".dat")
|
||||
os.Remove(v.FileName() + ".idx")
|
||||
os.Remove(v.FileName() + ".tier")
|
||||
os.Remove(v.FileName() + ".sdb")
|
||||
os.Remove(v.FileName() + ".sdx")
|
||||
os.Remove(v.FileName() + ".cpd")
|
||||
os.Remove(v.FileName() + ".cpx")
|
||||
os.RemoveAll(v.FileName() + ".ldb")
|
||||
|
|
Loading…
Reference in a new issue