mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 09:44:51 +08:00
simplified to one machine per volume
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@14 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
@@ -16,9 +16,9 @@ type Store struct {
|
||||
Port int
|
||||
PublicServer string
|
||||
}
|
||||
type VolumeStat struct {
|
||||
Id uint64 "id"
|
||||
CanWrite bool
|
||||
type VolumeInfo struct {
|
||||
Id uint64
|
||||
Size int64
|
||||
}
|
||||
|
||||
func NewStore(port int, publicServer, dirname string, chunkSize, capacity int) (s *Store) {
|
||||
@@ -44,10 +44,10 @@ func NewStore(port int, publicServer, dirname string, chunkSize, capacity int) (
|
||||
}
|
||||
|
||||
func (s *Store) Join(mserver string) {
|
||||
stats := new([]*VolumeStat)
|
||||
for k, _ := range s.volumes {
|
||||
s := new(VolumeStat)
|
||||
s.Id, s.CanWrite = k, true
|
||||
stats := new([]*VolumeInfo)
|
||||
for k, v := range s.volumes {
|
||||
s := new(VolumeInfo)
|
||||
s.Id, s.Size = k, v.Size()
|
||||
*stats = append(*stats, s)
|
||||
}
|
||||
bytes, _ := json.Marshal(stats)
|
||||
|
Reference in New Issue
Block a user