s3: load storage-class disk mapping from filer grpc config

This commit is contained in:
Chris Lu committed 2026-02-09 13:53:04 -08:00
1 parent 5e4b3f0078
commit 4f1fce0882
13 files changed
+215 -176

No files matched your search

+2 -8
View File
@@ -56,7 +56,7 @@ type S3ApiServerOption struct {
Cipher bool // encrypt data on volume servers
BindIp string
GrpcPort int
StorageClassDiskTypeMap string // e.g. "STANDARD_IA=ssd,GLACIER=hdd"
StorageClassDiskTypeMap map[string]string
}
type S3ApiServer struct {
@@ -170,13 +170,7 @@ func NewS3ApiServerWithStore(router *mux.Router, option *S3ApiServerOption, expl
inFlightDataLimitCond: sync.NewCond(new(sync.Mutex)),
cipher: option.Cipher,
}
if option.StorageClassDiskTypeMap != "" {
parsedMappings, parseErr := parseStorageClassDiskTypeMap(option.StorageClassDiskTypeMap)
if parseErr != nil {
return nil, fmt.Errorf("invalid -s3.storageClassDiskTypeMap: %w", parseErr)
}
s3ApiServer.storageClassDiskTypes = parsedMappings
}
s3ApiServer.storageClassDiskTypes = loadStorageClassDiskTypeMap(option.StorageClassDiskTypeMap)
// Set s3a reference in circuit breaker for upload limiting
s3ApiServer.cb.s3a = s3ApiServer