From 60c17068a689552343d7382283f3a295fcf7764b Mon Sep 17 00:00:00 2001 From: "chris.lu@gmail.com" Date: Tue, 27 Dec 2011 06:09:21 +0000 Subject: [PATCH] correct sequence generating git-svn-id: https://weed-fs.googlecode.com/svn/trunk@30 282b0af5-e82d-9cf1-ede4-77906d7719d0 --- weed-fs/src/cmd/weeds.go | 6 ++++-- weed-fs/src/pkg/directory/volume_mapping.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/weed-fs/src/cmd/weeds.go b/weed-fs/src/cmd/weeds.go index 065813ae1..1965daf85 100644 --- a/weed-fs/src/cmd/weeds.go +++ b/weed-fs/src/cmd/weeds.go @@ -17,7 +17,7 @@ var ( metaFolder = flag.String("mdir", "/tmp", "data directory to store mappings") capacity = flag.Int("capacity", 100, "maximum number of volumes to hold") mapper *directory.Mapper - IsDebug = flag.Bool("debug", false, "verbose debug information") + IsDebug = flag.Bool("debug", false, "verbose debug information") ) func dirLookupHandler(w http.ResponseWriter, r *http.Request) { @@ -43,7 +43,9 @@ func dirJoinHandler(w http.ResponseWriter, r *http.Request) { publicUrl := r.FormValue("publicUrl") volumes := new([]storage.VolumeInfo) json.Unmarshal([]byte(r.FormValue("volumes")), volumes) - log.Println(s, "volumes", r.FormValue("volumes")) + if *IsDebug { + log.Println(s, "volumes", r.FormValue("volumes")) + } mapper.Add(*directory.NewMachine(s, publicUrl, *volumes)) } func dirStatusHandler(w http.ResponseWriter, r *http.Request) { diff --git a/weed-fs/src/pkg/directory/volume_mapping.go b/weed-fs/src/pkg/directory/volume_mapping.go index 2280b8cae..bee1f78dd 100644 --- a/weed-fs/src/pkg/directory/volume_mapping.go +++ b/weed-fs/src/pkg/directory/volume_mapping.go @@ -69,6 +69,7 @@ func (m *Mapper) PickForWrite() (string, MachineInfo) { func (m *Mapper) NextFileId() uint64 { if m.fileIdCounter <= 0 { m.fileIdCounter = FileIdSaveInterval + m.FileIdSequence += FileIdSaveInterval m.saveSequence() } m.fileIdCounter--