mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 23:17:23 +08:00
adding volume type
This commit is contained in:
@@ -14,6 +14,7 @@ type VolumeInfo struct {
|
||||
Size uint64
|
||||
ReplicaPlacement *super_block.ReplicaPlacement
|
||||
Ttl *needle.TTL
|
||||
VolumeType VolumeType
|
||||
Collection string
|
||||
Version needle.Version
|
||||
FileCount int
|
||||
|
23
weed/storage/volume_type.go
Normal file
23
weed/storage/volume_type.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package storage
|
||||
|
||||
import "fmt"
|
||||
|
||||
type VolumeType string
|
||||
|
||||
const (
|
||||
HardDriveType VolumeType = ""
|
||||
SsdType = "ssd"
|
||||
)
|
||||
|
||||
func ToVolumeType(vt string) (volumeType VolumeType, err error) {
|
||||
volumeType = HardDriveType
|
||||
switch vt {
|
||||
case "", "hdd":
|
||||
volumeType = HardDriveType
|
||||
case "ssd":
|
||||
volumeType = SsdType
|
||||
default:
|
||||
err = fmt.Errorf("parse VolumeType %s: expecting hdd or ssd\n", vt)
|
||||
}
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user