aboutsummaryrefslogtreecommitdiff
path: root/go/topology/volume_layout.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-08-08 23:57:22 -0700
committerChris Lu <chris.lu@gmail.com>2013-08-08 23:57:22 -0700
commited154053c833f9bcce9094e535e2adc0a0397e46 (patch)
tree40dc16b76a12929bc8ac7af0549ccf65316e9011 /go/topology/volume_layout.go
parentb27947b3550dfdf091010bd2607b8c36a5dca049 (diff)
downloadseaweedfs-ed154053c833f9bcce9094e535e2adc0a0397e46.tar.xz
seaweedfs-ed154053c833f9bcce9094e535e2adc0a0397e46.zip
switching to temporarily use glog library
Diffstat (limited to 'go/topology/volume_layout.go')
-rw-r--r--go/topology/volume_layout.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/go/topology/volume_layout.go b/go/topology/volume_layout.go
index e54491268..a0451cc00 100644
--- a/go/topology/volume_layout.go
+++ b/go/topology/volume_layout.go
@@ -3,7 +3,7 @@ package topology
import (
"code.google.com/p/weed-fs/go/storage"
"errors"
- "log"
+ "code.google.com/p/weed-fs/go/glog"
"math/rand"
"sync"
)
@@ -59,7 +59,7 @@ func (vl *VolumeLayout) Lookup(vid storage.VolumeId) []*DataNode {
func (vl *VolumeLayout) PickForWrite(count int, dataCenter string) (*storage.VolumeId, int, *VolumeLocationList, error) {
len_writers := len(vl.writables)
if len_writers <= 0 {
- log.Println("No more writable volumes!")
+ glog.V(0).Infoln("No more writable volumes!")
return nil, 0, nil, errors.New("No more writable volumes!")
}
if dataCenter == "" {
@@ -107,7 +107,7 @@ func (vl *VolumeLayout) GetActiveVolumeCount(dataCenter string) int {
func (vl *VolumeLayout) removeFromWritable(vid storage.VolumeId) bool {
for i, v := range vl.writables {
if v == vid {
- log.Println("Volume", vid, "becomes unwritable")
+ glog.V(0).Infoln("Volume", vid, "becomes unwritable")
vl.writables = append(vl.writables[:i], vl.writables[i+1:]...)
return true
}
@@ -120,7 +120,7 @@ func (vl *VolumeLayout) setVolumeWritable(vid storage.VolumeId) bool {
return false
}
}
- log.Println("Volume", vid, "becomes writable")
+ glog.V(0).Infoln("Volume", vid, "becomes writable")
vl.writables = append(vl.writables, vid)
return true
}
@@ -131,7 +131,7 @@ func (vl *VolumeLayout) SetVolumeUnavailable(dn *DataNode, vid storage.VolumeId)
if vl.vid2location[vid].Remove(dn) {
if vl.vid2location[vid].Length() < vl.repType.GetCopyCount() {
- log.Println("Volume", vid, "has", vl.vid2location[vid].Length(), "replica, less than required", vl.repType.GetCopyCount())
+ glog.V(0).Infoln("Volume", vid, "has", vl.vid2location[vid].Length(), "replica, less than required", vl.repType.GetCopyCount())
return vl.removeFromWritable(vid)
}
}
@@ -153,7 +153,7 @@ func (vl *VolumeLayout) SetVolumeCapacityFull(vid storage.VolumeId) bool {
vl.accessLock.Lock()
defer vl.accessLock.Unlock()
- // log.Println("Volume", vid, "reaches full capacity.")
+ // glog.V(0).Infoln("Volume", vid, "reaches full capacity.")
return vl.removeFromWritable(vid)
}