|
|
@ -16,7 +16,6 @@ import ( |
|
|
|
"github.com/chrislusf/seaweedfs/weed/storage/needle" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/storage/super_block" |
|
|
|
. "github.com/chrislusf/seaweedfs/weed/storage/types" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/util" |
|
|
|
) |
|
|
|
|
|
|
|
const ( |
|
|
@ -53,11 +52,11 @@ func (s *Store) String() (str string) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
func NewStore(grpcDialOption grpc.DialOption, port int, ip, publicUrl string, dirnames []string, maxVolumeCounts []int, minFreeSpacePercents []float32, needleMapKind NeedleMapType) (s *Store) { |
|
|
|
func NewStore(grpcDialOption grpc.DialOption, port int, ip, publicUrl string, dirnames []string, maxVolumeCounts []int, minFreeSpacePercents []float32, idxFolder string, needleMapKind NeedleMapType) (s *Store) { |
|
|
|
s = &Store{grpcDialOption: grpcDialOption, Port: port, Ip: ip, PublicUrl: publicUrl, NeedleMapType: needleMapKind} |
|
|
|
s.Locations = make([]*DiskLocation, 0) |
|
|
|
for i := 0; i < len(dirnames); i++ { |
|
|
|
location := NewDiskLocation(util.ResolvePath(dirnames[i]), maxVolumeCounts[i], minFreeSpacePercents[i]) |
|
|
|
location := NewDiskLocation(dirnames[i], maxVolumeCounts[i], minFreeSpacePercents[i], idxFolder) |
|
|
|
location.loadExistingVolumes(needleMapKind) |
|
|
|
s.Locations = append(s.Locations, location) |
|
|
|
stats.VolumeServerMaxVolumeCounter.Add(float64(maxVolumeCounts[i])) |
|
|
|