comment out etcd support due to its os specific system calls

This commit is contained in:
Chris Lu 2013-11-19 01:43:16 -08:00
parent fa1bb3cee3
commit bd0c7a3d28
3 changed files with 14 additions and 12 deletions

View file

@ -1,3 +1,5 @@
// +build ignore
package metastore package metastore
import ( import (

View file

@ -34,12 +34,12 @@ func NewFileSequencer(filepath string) (m *SequencerImpl) {
return return
} }
func NewEtcdSequencer(etcdCluster string) (m *SequencerImpl) { //func NewEtcdSequencer(etcdCluster string) (m *SequencerImpl) {
m = &SequencerImpl{fileFullPath: "/weedfs/default/sequence"} // m = &SequencerImpl{fileFullPath: "/weedfs/default/sequence"}
m.metaStore = &metastore.MetaStore{metastore.NewMetaStoreEtcdBacking(etcdCluster)} // m.metaStore = &metastore.MetaStore{metastore.NewMetaStoreEtcdBacking(etcdCluster)}
m.initilize() // m.initilize()
return // return
} //}
func (m *SequencerImpl) initilize() { func (m *SequencerImpl) initilize() {
if !m.metaStore.Has(m.fileFullPath) { if !m.metaStore.Has(m.fileFullPath) {

View file

@ -45,7 +45,7 @@ var (
mMaxCpu = cmdMaster.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs") mMaxCpu = cmdMaster.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
garbageThreshold = cmdMaster.Flag.String("garbageThreshold", "0.3", "threshold to vacuum and reclaim spaces") garbageThreshold = cmdMaster.Flag.String("garbageThreshold", "0.3", "threshold to vacuum and reclaim spaces")
masterWhiteListOption = cmdMaster.Flag.String("whiteList", "", "comma separated Ip addresses having write permission. No limit if empty.") masterWhiteListOption = cmdMaster.Flag.String("whiteList", "", "comma separated Ip addresses having write permission. No limit if empty.")
etcdCluster = cmdMaster.Flag.String("etcd", "", "comma separated etcd urls, e.g., http://localhost:4001, See github.com/coreos/go-etcd/etcd") //etcdCluster = cmdMaster.Flag.String("etcd", "", "comma separated etcd urls, e.g., http://localhost:4001, See github.com/coreos/go-etcd/etcd")
masterWhiteList []string masterWhiteList []string
) )
@ -221,11 +221,11 @@ func runMaster(cmd *Command, args []string) bool {
masterWhiteList = strings.Split(*masterWhiteListOption, ",") masterWhiteList = strings.Split(*masterWhiteListOption, ",")
} }
var seq sequence.Sequencer var seq sequence.Sequencer
if len(*etcdCluster) == 0 { //if len(*etcdCluster) == 0 {
seq = sequence.NewFileSequencer(path.Join(*metaFolder, "weed.seq")) seq = sequence.NewFileSequencer(path.Join(*metaFolder, "weed.seq"))
} else { //} else {
seq = sequence.NewEtcdSequencer(*etcdCluster) // seq = sequence.NewEtcdSequencer(*etcdCluster)
} //}
var e error var e error
if topo, e = topology.NewTopology("topo", *confFile, seq, if topo, e = topology.NewTopology("topo", *confFile, seq,
uint64(*volumeSizeLimitMB)*1024*1024, *mpulse); e != nil { uint64(*volumeSizeLimitMB)*1024*1024, *mpulse); e != nil {