Browse Source

adding topology related types

pull/2/head
Chris Lu 13 years ago
parent
commit
03f4c0b832
  1. 10
      weed-fs/src/pkg/topology/data_center.go
  2. 11
      weed-fs/src/pkg/topology/ip_range.go
  3. 19
      weed-fs/src/pkg/topology/node.go
  4. 10
      weed-fs/src/pkg/topology/rack.go
  5. 9
      weed-fs/src/pkg/topology/topology.go

10
weed-fs/src/pkg/topology/data_center.go

@ -1,6 +1,10 @@
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

@ -0,0 +1,11 @@
package topology
import (
)
type IpRange struct {
inclusives []string
exclusives []string
}

19
weed-fs/src/pkg/topology/node.go

@ -1,18 +1,17 @@
package topology
import (
)
import ()
type NodeId uint32
type VolumeId uint32
type VolumeInfo struct {
Id VolumeId
Size int64
Id VolumeId
Size int64
}
type Node struct {
volumes map[VolumeId]VolumeInfo
volumeLimit int
Ip string
Port int
PublicUrl string
volumes map[VolumeId]VolumeInfo
volumeLimit int
Ip string
Port int
PublicUrl string
}

10
weed-fs/src/pkg/topology/rack.go

@ -1,10 +1,10 @@
package topology
import (
)
import ()
type RackId uint32
type Rack struct {
nodes map[uint64]*Node
IpRanges []string
Id RackId
nodes map[NodeId]*Node
ipRange IpRange
}

9
weed-fs/src/pkg/topology/topology.go

@ -0,0 +1,9 @@
package topology
import (
)
type Topology struct {
datacenters map[DataCenterId]*DataCenter
}
Loading…
Cancel
Save