diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-02-09 11:38:42 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-02-09 11:38:42 -0800 |
| commit | 2bf5ea87d6788fc1b82d36ffaed42ce0345b955e (patch) | |
| tree | b83fdc9ec478696ff43ebdf05f556ac6cd4e5724 /weed/server/filer_server_handlers_write.go | |
| parent | d221a937df38ff587e2392a313681b0a0f48138b (diff) | |
| parent | 821c46edf10097200b986bd17dc01d3991cf57ff (diff) | |
| download | seaweedfs-2bf5ea87d6788fc1b82d36ffaed42ce0345b955e.tar.xz seaweedfs-2bf5ea87d6788fc1b82d36ffaed42ce0345b955e.zip | |
Merge branch 'support_ssd_volume'
Diffstat (limited to 'weed/server/filer_server_handlers_write.go')
| -rw-r--r-- | weed/server/filer_server_handlers_write.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/server/filer_server_handlers_write.go b/weed/server/filer_server_handlers_write.go index 6f33e8494..28dff07c6 100644 --- a/weed/server/filer_server_handlers_write.go +++ b/weed/server/filer_server_handlers_write.go @@ -61,6 +61,7 @@ func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request) { query.Get("collection"), query.Get("replication"), query.Get("ttl"), + query.Get("disk"), query.Get("dataCenter"), query.Get("rack"), ) @@ -104,7 +105,7 @@ func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusNoContent) } -func (fs *FilerServer) detectStorageOption(requestURI, qCollection, qReplication string, ttlSeconds int32, dataCenter, rack string) *operation.StorageOption { +func (fs *FilerServer) detectStorageOption(requestURI, qCollection, qReplication string, ttlSeconds int32, diskType string, dataCenter, rack string) *operation.StorageOption { collection := util.Nvl(qCollection, fs.option.Collection) replication := util.Nvl(qReplication, fs.option.DefaultReplication) @@ -134,17 +135,18 @@ func (fs *FilerServer) detectStorageOption(requestURI, qCollection, qReplication DataCenter: util.Nvl(dataCenter, fs.option.DataCenter), Rack: util.Nvl(rack, fs.option.Rack), TtlSeconds: ttlSeconds, + DiskType: util.Nvl(diskType, rule.DiskType), Fsync: fsync || rule.Fsync, VolumeGrowthCount: rule.VolumeGrowthCount, } } -func (fs *FilerServer) detectStorageOption0(requestURI, qCollection, qReplication string, qTtl string, dataCenter, rack string) *operation.StorageOption { +func (fs *FilerServer) detectStorageOption0(requestURI, qCollection, qReplication string, qTtl string, diskType string, dataCenter, rack string) *operation.StorageOption { ttl, err := needle.ReadTTL(qTtl) if err != nil { glog.Errorf("fail to parse ttl %s: %v", qTtl, err) } - return fs.detectStorageOption(requestURI, qCollection, qReplication, int32(ttl.Minutes())*60, dataCenter, rack) + return fs.detectStorageOption(requestURI, qCollection, qReplication, int32(ttl.Minutes())*60, diskType, dataCenter, rack) } |
