mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
adding topology related types
This commit is contained in:
parent
31e4dbfe38
commit
03f4c0b832
|
@ -1,6 +1,10 @@
|
||||||
package topology
|
package topology
|
||||||
|
|
||||||
import (
|
import ()
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
|
type DataCenterId uint32
|
||||||
|
type DataCenter struct {
|
||||||
|
Id DataCenterId
|
||||||
|
racks map[RackId]*Rack
|
||||||
|
ipRange IpRange
|
||||||
|
}
|
||||||
|
|
11
weed-fs/src/pkg/topology/ip_range.go
Normal file
11
weed-fs/src/pkg/topology/ip_range.go
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
package topology
|
||||||
|
|
||||||
|
import (
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
type IpRange struct {
|
||||||
|
inclusives []string
|
||||||
|
exclusives []string
|
||||||
|
}
|
|
@ -1,18 +1,17 @@
|
||||||
package topology
|
package topology
|
||||||
|
|
||||||
import (
|
import ()
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
|
type NodeId uint32
|
||||||
type VolumeId uint32
|
type VolumeId uint32
|
||||||
type VolumeInfo struct {
|
type VolumeInfo struct {
|
||||||
Id VolumeId
|
Id VolumeId
|
||||||
Size int64
|
Size int64
|
||||||
}
|
}
|
||||||
type Node struct {
|
type Node struct {
|
||||||
volumes map[VolumeId]VolumeInfo
|
volumes map[VolumeId]VolumeInfo
|
||||||
volumeLimit int
|
volumeLimit int
|
||||||
Ip string
|
Ip string
|
||||||
Port int
|
Port int
|
||||||
PublicUrl string
|
PublicUrl string
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package topology
|
package topology
|
||||||
|
|
||||||
import (
|
import ()
|
||||||
|
|
||||||
)
|
|
||||||
|
|
||||||
|
type RackId uint32
|
||||||
type Rack struct {
|
type Rack struct {
|
||||||
nodes map[uint64]*Node
|
Id RackId
|
||||||
IpRanges []string
|
nodes map[NodeId]*Node
|
||||||
|
ipRange IpRange
|
||||||
}
|
}
|
||||||
|
|
9
weed-fs/src/pkg/topology/topology.go
Normal file
9
weed-fs/src/pkg/topology/topology.go
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
package topology
|
||||||
|
|
||||||
|
import (
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
type Topology struct {
|
||||||
|
datacenters map[DataCenterId]*DataCenter
|
||||||
|
}
|
Loading…
Reference in a new issue