Documentation ¶
Index ¶
Constants ¶
const ( // Reduced redundancy storage class RRS = "REDUCED_REDUNDANCY" // Standard storage class STANDARD = "STANDARD" // DMA storage class DMA = "DMA" // Valid values are "write" and "read+write" DMAWrite = "write" DMAReadWrite = "read+write" )
Standard constants for all storage class
const ( ClassStandard = "standard" ClassRRS = "rrs" ClassDMA = "dma" // Reduced redundancy storage class environment variable RRSEnv = "MINIO_STORAGE_CLASS_RRS" // Standard storage class environment variable StandardEnv = "MINIO_STORAGE_CLASS_STANDARD" // DMA storage class environment variable DMAEnv = "MINIO_STORAGE_CLASS_DMA" )
Standard constats for config info storage class
Variables ¶
var ConfigLock = sync.RWMutex{}
ConfigLock is a global lock for storage-class config
var ( DefaultKVS = config.KVS{ config.KV{ Key: ClassStandard, Value: "", }, config.KV{ Key: ClassRRS, Value: "EC:2", }, config.KV{ Key: ClassDMA, Value: defaultDMA, }, } )
DefaultKVS - default storage class config
var ( Help = config.HelpKVS{ config.HelpKV{ Key: ClassStandard, Description: `set the parity count for default standard storage class e.g. "EC:4"`, Optional: true, Type: "string", }, config.HelpKV{ Key: ClassRRS, Description: `set the parity count for reduced redundancy storage class e.g. "EC:2"`, Optional: true, Type: "string", }, config.HelpKV{ Key: ClassDMA, Description: `enable O_DIRECT for both read and write, defaults to "write" e.g. "read+write"`, Optional: true, Type: "string", }, config.HelpKV{ Key: config.Comment, Description: config.DefaultComment, Optional: true, Type: "sentence", }, } )
Help template for storageclass feature.
Functions ¶
func SetStorageClass ¶
SetStorageClass - One time migration code needed, for migrating from older config to new for StorageClass.
func ValidateParity ¶
ValidateParity validate standard storage class parity.
Types ¶
type Config ¶
type Config struct { Standard StorageClass `json:"standard"` RRS StorageClass `json:"rrs"` DMA string `json:"dma"` }
Config storage class configuration
func LookupConfig ¶
LookupConfig - lookup storage class config and override with valid environment settings if any.
func (Config) GetParityForSC ¶
GetParityForSC - Returns the data and parity drive count based on storage class If storage class is set using the env vars MINIO_STORAGE_CLASS_RRS and MINIO_STORAGE_CLASS_STANDARD or server config fields corresponding values are returned.
-- if input storage class is empty then standard is assumed -- if input is RRS but RRS is not configured default '2' parity
for RRS is assumed
-- if input is STANDARD but STANDARD is not configured '0' parity
is returned, the caller is expected to choose the right parity at that point.
func (*Config) UnmarshalJSON ¶
UnmarshalJSON - Validate SS and RRS parity when unmarshalling JSON.
type StorageClass ¶
type StorageClass struct {
Parity int
}
StorageClass - holds storage class information
func (*StorageClass) MarshalText ¶
func (sc *StorageClass) MarshalText() ([]byte, error)
MarshalText - marshals storage class string.
func (*StorageClass) String ¶
func (sc *StorageClass) String() string
func (*StorageClass) UnmarshalText ¶
func (sc *StorageClass) UnmarshalText(b []byte) error
UnmarshalText unmarshals storage class from its textual form into storageClass structure.