aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/volume_layout.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-12-13 00:58:58 -0800
committerChris Lu <chris.lu@gmail.com>2020-12-13 00:58:58 -0800
commite9cd798bd372741753efcba2af594b00fe7b8437 (patch)
treee291019e7394a874a292ee90c832a65745f57fd4 /weed/topology/volume_layout.go
parent16cd6fb27838db95054701f5567c93d51bf24d5f (diff)
downloadseaweedfs-e9cd798bd372741753efcba2af594b00fe7b8437.tar.xz
seaweedfs-e9cd798bd372741753efcba2af594b00fe7b8437.zip
adding volume type
Diffstat (limited to 'weed/topology/volume_layout.go')
-rw-r--r--weed/topology/volume_layout.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go
index 0db95d289..3d391cd84 100644
--- a/weed/topology/volume_layout.go
+++ b/weed/topology/volume_layout.go
@@ -103,6 +103,7 @@ func (v *volumesBinaryState) copyState(list *VolumeLocationList) copyState {
type VolumeLayout struct {
rp *super_block.ReplicaPlacement
ttl *needle.TTL
+ volumeType storage.VolumeType
vid2location map[needle.VolumeId]*VolumeLocationList
writables []needle.VolumeId // transient array of writable volume id
readonlyVolumes *volumesBinaryState // readonly volumes
@@ -118,10 +119,11 @@ type VolumeLayoutStats struct {
FileCount uint64
}
-func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, volumeSizeLimit uint64, replicationAsMin bool) *VolumeLayout {
+func NewVolumeLayout(rp *super_block.ReplicaPlacement, ttl *needle.TTL, volumeType storage.VolumeType, volumeSizeLimit uint64, replicationAsMin bool) *VolumeLayout {
return &VolumeLayout{
rp: rp,
ttl: ttl,
+ volumeType: volumeType,
vid2location: make(map[needle.VolumeId]*VolumeLocationList),
writables: *new([]needle.VolumeId),
readonlyVolumes: NewVolumesBinaryState(readOnlyState, rp, ExistCopies()),