diff options
| author | Chris Lu <chris.lu@gmail.com> | 2017-05-26 22:51:25 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2017-05-26 22:51:25 -0700 |
| commit | 82c3ccc8ddb1fea27a15f0610cf7730deb4529bc (patch) | |
| tree | b1deba002de8d716ca395c3b29c43448a4522f7d /weed/storage/volume_loading.go | |
| parent | 80cefade65ecf965cde769240594f17b0a562304 (diff) | |
| download | seaweedfs-82c3ccc8ddb1fea27a15f0610cf7730deb4529bc.tar.xz seaweedfs-82c3ccc8ddb1fea27a15f0610cf7730deb4529bc.zip | |
add btree for volume index
Diffstat (limited to 'weed/storage/volume_loading.go')
| -rw-r--r-- | weed/storage/volume_loading.go | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.go index 4be860987..457d50410 100644 --- a/weed/storage/volume_loading.go +++ b/weed/storage/volume_loading.go @@ -70,20 +70,25 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind } switch needleMapKind { case NeedleMapInMemory: - glog.V(0).Infoln("loading index file", fileName+".idx", "readonly", v.readOnly) - if v.nm, e = LoadNeedleMap(indexFile); e != nil { - glog.V(0).Infof("loading index %s error: %v", fileName+".idx", e) + glog.V(0).Infoln("loading index", fileName+".idx", "to memory readonly", v.readOnly) + if v.nm, e = LoadCompactNeedleMap(indexFile); e != nil { + glog.V(0).Infof("loading index %s to memory error: %v", fileName+".idx", e) } case NeedleMapLevelDb: - glog.V(0).Infoln("loading leveldb file", fileName+".ldb") + glog.V(0).Infoln("loading leveldb", fileName+".ldb") if v.nm, e = NewLevelDbNeedleMap(fileName+".ldb", indexFile); e != nil { glog.V(0).Infof("loading leveldb %s error: %v", fileName+".ldb", e) } case NeedleMapBoltDb: - glog.V(0).Infoln("loading boltdb file", fileName+".bdb") + glog.V(0).Infoln("loading boltdb", fileName+".bdb") if v.nm, e = NewBoltDbNeedleMap(fileName+".bdb", indexFile); e != nil { glog.V(0).Infof("loading boltdb %s error: %v", fileName+".bdb", e) } + case NeedleMapBtree: + glog.V(0).Infoln("loading index", fileName+".idx", "to btree readonly", v.readOnly) + if v.nm, e = LoadBtreeNeedleMap(indexFile); e != nil { + glog.V(0).Infof("loading index %s to btree error: %v", fileName+".idx", e) + } } } |
