mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
now working for registering volume id ~ machine mapping
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@13 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
parent
10930ce6b6
commit
1fed603df9
|
@ -39,7 +39,8 @@ func NewMapper(dirname string, filename string, capacity int) (m *Mapper) {
|
||||||
log.Println("Mapping File Read", e)
|
log.Println("Mapping File Read", e)
|
||||||
} else {
|
} else {
|
||||||
decoder := gob.NewDecoder(dataFile)
|
decoder := gob.NewDecoder(dataFile)
|
||||||
decoder.Decode(m.Machines)
|
defer dataFile.Close()
|
||||||
|
decoder.Decode(&m.Machines)
|
||||||
for _, list := range m.Machines {
|
for _, list := range m.Machines {
|
||||||
//TODO: what if a list has mixed readers and writers? Now it's treated as readonly
|
//TODO: what if a list has mixed readers and writers? Now it's treated as readonly
|
||||||
allCanWrite := false
|
allCanWrite := false
|
||||||
|
@ -50,7 +51,6 @@ func NewMapper(dirname string, filename string, capacity int) (m *Mapper) {
|
||||||
m.writers = append(m.writers, list)
|
m.writers = append(m.writers, list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dataFile.Close()
|
|
||||||
log.Println("Loaded mapping size", len(m.Machines))
|
log.Println("Loaded mapping size", len(m.Machines))
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue