|
@ -108,7 +108,7 @@ func (s *Store) loadExistingVolumes() { |
|
|
if s.volumes[vid] == nil { |
|
|
if s.volumes[vid] == nil { |
|
|
v := NewVolume(s.dir, vid, CopyNil) |
|
|
v := NewVolume(s.dir, vid, CopyNil) |
|
|
s.volumes[vid] = v |
|
|
s.volumes[vid] = v |
|
|
log.Println("In dir", s.dir, "reads volume = ", vid, ", replicationType =", v.replicaType) |
|
|
|
|
|
|
|
|
log.Println("In dir", s.dir, "read volume =", vid, "replicationType =", v.replicaType, "version =", v.version,"size =", v.Size()) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -119,7 +119,7 @@ func (s *Store) Status() []*VolumeInfo { |
|
|
var stats []*VolumeInfo |
|
|
var stats []*VolumeInfo |
|
|
for k, v := range s.volumes { |
|
|
for k, v := range s.volumes { |
|
|
s := new(VolumeInfo) |
|
|
s := new(VolumeInfo) |
|
|
s.Id, s.Size, s.RepType, s.FileCount, s.DeleteCount, s.DeletedByteCount = VolumeId(k), v.ContentSize(), v.replicaType, v.nm.fileCounter, v.nm.deletionCounter, v.nm.deletionByteCounter |
|
|
|
|
|
|
|
|
s.Id, s.Size, s.RepType, s.Version, s.FileCount, s.DeleteCount, s.DeletedByteCount = VolumeId(k), v.ContentSize(), v.replicaType, v.Version(), v.nm.fileCounter, v.nm.deletionCounter, v.nm.deletionByteCounter |
|
|
stats = append(stats, s) |
|
|
stats = append(stats, s) |
|
|
} |
|
|
} |
|
|
return stats |
|
|
return stats |
|
@ -136,7 +136,7 @@ func (s *Store) Join() error { |
|
|
stats := new([]*VolumeInfo) |
|
|
stats := new([]*VolumeInfo) |
|
|
for k, v := range s.volumes { |
|
|
for k, v := range s.volumes { |
|
|
s := new(VolumeInfo) |
|
|
s := new(VolumeInfo) |
|
|
s.Id, s.Size, s.RepType, s.FileCount, s.DeleteCount, s.DeletedByteCount = VolumeId(k), uint64(v.Size()), v.replicaType, v.nm.fileCounter, v.nm.deletionCounter, v.nm.deletionByteCounter |
|
|
|
|
|
|
|
|
s.Id, s.Size, s.RepType, s.Version, s.FileCount, s.DeleteCount, s.DeletedByteCount = VolumeId(k), uint64(v.Size()), v.replicaType, v.Version(), v.nm.fileCounter, v.nm.deletionCounter, v.nm.deletionByteCounter |
|
|
*stats = append(*stats, s) |
|
|
*stats = append(*stats, s) |
|
|
} |
|
|
} |
|
|
bytes, _ := json.Marshal(stats) |
|
|
bytes, _ := json.Marshal(stats) |
|
|