コード例 #1
0
ファイル: topology.go プロジェクト: tnextday/seaweedfs
func NewTopology(id string, confFile string, cs *storage.CollectionSettings, seq sequence.Sequencer, volumeSizeLimit uint64, pulse int) (*Topology, error) {
	t := &Topology{}
	t.id = NodeId(id)
	t.nodeType = "Topology"
	t.NodeImpl.value = t
	t.children = make(map[NodeId]Node)
	t.collectionMap = util.NewConcurrentMap()
	t.pulse = int64(pulse)
	t.volumeSizeLimit = volumeSizeLimit
	t.CollectionSettings = cs
	t.ReGenJoinKey()

	t.Sequence = seq

	t.chanDeadDataNodes = make(chan *DataNode)
	t.chanRecoveredDataNodes = make(chan *DataNode)
	t.chanFullVolumes = make(chan storage.VolumeInfo)

	err := t.loadConfiguration(confFile)

	return t, err
}
コード例 #2
0
ファイル: collection.go プロジェクト: tnextday/seaweedfs
func NewCollection(name string, rp *storage.ReplicaPlacement, volumeSizeLimit uint64) *Collection {
	c := &Collection{Name: name, volumeSizeLimit: volumeSizeLimit, rp: rp}
	c.storageType2VolumeLayout = util.NewConcurrentMap()
	return c
}