Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

adding topology related types

Chris Lu03f4c0b83269
diff --git a/weed-fs/src/pkg/topology/data_center.go b/weed-fs/src/pkg/topology/data_center.go
index 022f733cc8..92e8b0055e 100644
--- a/weed-fs/src/pkg/topology/data_center.go
+++ b/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
+}
diff --git a/weed-fs/src/pkg/topology/ip_range.go b/weed-fs/src/pkg/topology/ip_range.go
new file mode 100644
index 0000000000..e7bd5a0fea
--- /dev/null
+++ b/weed-fs/src/pkg/topology/ip_range.go
@@ -0,0 +1,11 @@
+package topology
+
+import (
+
+)
+
+
+type IpRange struct {
+ inclusives []string
+ exclusives []string
+}
diff --git a/weed-fs/src/pkg/topology/node.go b/weed-fs/src/pkg/topology/node.go
index 2a556e5ada..91f9a13737 100644
--- a/weed-fs/src/pkg/topology/node.go
+++ b/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
}
diff --git a/weed-fs/src/pkg/topology/rack.go b/weed-fs/src/pkg/topology/rack.go
index 69895a2431..3e06ea3af3 100644
--- a/weed-fs/src/pkg/topology/rack.go
+++ b/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
}
diff --git a/weed-fs/src/pkg/topology/topology.go b/weed-fs/src/pkg/topology/topology.go
new file mode 100644
index 0000000000..7db3d0e32f
--- /dev/null
+++ b/weed-fs/src/pkg/topology/topology.go
@@ -0,0 +1,9 @@
+package topology
+
+import (
+
+)
+
+type Topology struct {
+ datacenters map[DataCenterId]*DataCenter
+}