aboutsummaryrefslogtreecommitdiff
path: root/go/topology/volume_layout.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-07-13 19:44:24 -0700
committerChris Lu <chris.lu@gmail.com>2013-07-13 19:44:24 -0700
commitac15868694e800657ba968da028be92a334660d4 (patch)
tree9996156fdd4dff75381d55165d415dd0302c280d /go/topology/volume_layout.go
parentae3245f1dcd9f95f5109b53306c03a0d359cf540 (diff)
downloadseaweedfs-ac15868694e800657ba968da028be92a334660d4.tar.xz
seaweedfs-ac15868694e800657ba968da028be92a334660d4.zip
clean up log fmt usage. Move to log for important data changes,
warnings.
Diffstat (limited to 'go/topology/volume_layout.go')
-rw-r--r--go/topology/volume_layout.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/go/topology/volume_layout.go b/go/topology/volume_layout.go
index d8ed49b0b..7d7e3f662 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"
- "fmt"
+ "log"
"math/rand"
)
@@ -54,7 +54,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 {
- fmt.Println("No more writable volumes!")
+ log.Println("No more writable volumes!")
return nil, 0, nil, errors.New("No more writable volumes!")
}
if dataCenter == "" {
@@ -102,7 +102,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 {
- fmt.Println("Volume", vid, "becomes unwritable")
+ log.Println("Volume", vid, "becomes unwritable")
vl.writables = append(vl.writables[:i], vl.writables[i+1:]...)
return true
}
@@ -115,7 +115,7 @@ func (vl *VolumeLayout) setVolumeWritable(vid storage.VolumeId) bool {
return false
}
}
- fmt.Println("Volume", vid, "becomes writable")
+ log.Println("Volume", vid, "becomes writable")
vl.writables = append(vl.writables, vid)
return true
}
@@ -123,7 +123,7 @@ func (vl *VolumeLayout) setVolumeWritable(vid storage.VolumeId) bool {
func (vl *VolumeLayout) SetVolumeUnavailable(dn *DataNode, vid storage.VolumeId) bool {
if vl.vid2location[vid].Remove(dn) {
if vl.vid2location[vid].Length() < vl.repType.GetCopyCount() {
- fmt.Println("Volume", vid, "has", vl.vid2location[vid].Length(), "replica, less than required", vl.repType.GetCopyCount())
+ log.Println("Volume", vid, "has", vl.vid2location[vid].Length(), "replica, less than required", vl.repType.GetCopyCount())
return vl.removeFromWritable(vid)
}
}