mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
update volume status on each heartbeat
git-svn-id: https://weed-fs.googlecode.com/svn/trunk@26 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
parent
6913fabc64
commit
c27f6175d7
|
@ -91,6 +91,8 @@ func (m *Mapper) Add(machine Machine){
|
|||
if machineId < 0 {
|
||||
machineId = len(m.Machines)
|
||||
m.Machines = append(m.Machines, &machine)
|
||||
}else{
|
||||
m.Machines[machineId] = &machine
|
||||
}
|
||||
m.lock.Unlock()
|
||||
|
||||
|
@ -98,20 +100,17 @@ func (m *Mapper) Add(machine Machine){
|
|||
for _, v := range machine.Volumes {
|
||||
//log.Println("Setting volume", v.Id, "to", machine.Server.Url)
|
||||
m.vid2machineId[v.Id] = machineId
|
||||
if v.Size < ChunkSizeLimit {
|
||||
m.Writers = append(m.Writers, machineId)
|
||||
}
|
||||
}
|
||||
//setting Writers, copy-on-write because of possible updating
|
||||
var Writers []int
|
||||
var writers []int
|
||||
for machine_index, machine_entry := range m.Machines {
|
||||
for _, v := range machine_entry.Volumes {
|
||||
if v.Size < ChunkSizeLimit {
|
||||
Writers = append(Writers, machine_index)
|
||||
writers = append(writers, machine_index)
|
||||
}
|
||||
}
|
||||
}
|
||||
m.Writers = Writers
|
||||
m.Writers = writers
|
||||
}
|
||||
func (m *Mapper) saveSequence() {
|
||||
log.Println("Saving file id sequence", m.FileIdSequence, "to", path.Join(m.dir, m.fileName+".seq"))
|
||||
|
|
Loading…
Reference in a new issue