ec: generate and copy .vif file

This commit is contained in:
Chris Lu
2019-12-28 12:44:59 -08:00
parent c06f7eb48a
commit 37b64a50b4
8 changed files with 220 additions and 212 deletions

View File

@@ -9,6 +9,7 @@ import (
"sync"
"time"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/idx"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
@@ -56,6 +57,12 @@ func NewEcVolume(dir string, collection string, vid needle.VolumeId) (ev *EcVolu
return nil, fmt.Errorf("cannot open ec volume journal %s.ecj: %v", baseFileName, err)
}
// read volume info
ev.Version = needle.Version3
if volumeInfo, found := pb.MaybeLoadVolumeInfo(baseFileName + ".vif"); found {
ev.Version = needle.Version(volumeInfo.Version)
}
ev.ShardLocations = make(map[ShardId][]string)
return