Browse Source

passing disk type along

pull/1794/head
Chris Lu 4 years ago
parent
commit
1d88865869
  1. 2
      weed/server/filer_server_handlers_write.go
  2. 4
      weed/storage/store.go
  3. 1
      weed/storage/volume_info.go

2
weed/server/filer_server_handlers_write.go

@ -135,7 +135,7 @@ func (fs *FilerServer) detectStorageOption(requestURI, qCollection, qReplication
DataCenter: util.Nvl(dataCenter, fs.option.DataCenter), DataCenter: util.Nvl(dataCenter, fs.option.DataCenter),
Rack: util.Nvl(rack, fs.option.Rack), Rack: util.Nvl(rack, fs.option.Rack),
TtlSeconds: ttlSeconds, TtlSeconds: ttlSeconds,
DiskType: diskType,
DiskType: util.Nvl(diskType, rule.DiskType),
Fsync: fsync || rule.Fsync, Fsync: fsync || rule.Fsync,
VolumeGrowthCount: rule.VolumeGrowthCount, VolumeGrowthCount: rule.VolumeGrowthCount,
} }

4
weed/storage/store.go

@ -133,6 +133,7 @@ func (s *Store) addVolume(vid needle.VolumeId, collection string, needleMapKind
ReplicaPlacement: uint32(replicaPlacement.Byte()), ReplicaPlacement: uint32(replicaPlacement.Byte()),
Version: uint32(volume.Version()), Version: uint32(volume.Version()),
Ttl: ttl.ToUint32(), Ttl: ttl.ToUint32(),
DiskType: string(diskType),
} }
return nil return nil
} else { } else {
@ -381,6 +382,7 @@ func (s *Store) MountVolume(i needle.VolumeId) error {
ReplicaPlacement: uint32(v.ReplicaPlacement.Byte()), ReplicaPlacement: uint32(v.ReplicaPlacement.Byte()),
Version: uint32(v.Version()), Version: uint32(v.Version()),
Ttl: v.Ttl.ToUint32(), Ttl: v.Ttl.ToUint32(),
DiskType: string(v.location.DiskType),
} }
return nil return nil
} }
@ -400,6 +402,7 @@ func (s *Store) UnmountVolume(i needle.VolumeId) error {
ReplicaPlacement: uint32(v.ReplicaPlacement.Byte()), ReplicaPlacement: uint32(v.ReplicaPlacement.Byte()),
Version: uint32(v.Version()), Version: uint32(v.Version()),
Ttl: v.Ttl.ToUint32(), Ttl: v.Ttl.ToUint32(),
DiskType: string(v.location.DiskType),
} }
for _, location := range s.Locations { for _, location := range s.Locations {
@ -424,6 +427,7 @@ func (s *Store) DeleteVolume(i needle.VolumeId) error {
ReplicaPlacement: uint32(v.ReplicaPlacement.Byte()), ReplicaPlacement: uint32(v.ReplicaPlacement.Byte()),
Version: uint32(v.Version()), Version: uint32(v.Version()),
Ttl: v.Ttl.ToUint32(), Ttl: v.Ttl.ToUint32(),
DiskType: string(v.location.DiskType),
} }
for _, location := range s.Locations { for _, location := range s.Locations {
if err := location.DeleteVolume(i); err == nil { if err := location.DeleteVolume(i); err == nil {

1
weed/storage/volume_info.go

@ -64,6 +64,7 @@ func NewVolumeInfoFromShort(m *master_pb.VolumeShortInformationMessage) (vi Volu
} }
vi.ReplicaPlacement = rp vi.ReplicaPlacement = rp
vi.Ttl = needle.LoadTTLFromUint32(m.Ttl) vi.Ttl = needle.LoadTTLFromUint32(m.Ttl)
vi.DiskType = m.DiskType
return vi, nil return vi, nil
} }

Loading…
Cancel
Save