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/operation/submit.go | |
| parent | d221a937df38ff587e2392a313681b0a0f48138b (diff) | |
| parent | 821c46edf10097200b986bd17dc01d3991cf57ff (diff) | |
| download | seaweedfs-2bf5ea87d6788fc1b82d36ffaed42ce0345b955e.tar.xz seaweedfs-2bf5ea87d6788fc1b82d36ffaed42ce0345b955e.zip | |
Merge branch 'support_ssd_volume'
Diffstat (limited to 'weed/operation/submit.go')
| -rw-r--r-- | weed/operation/submit.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/operation/submit.go b/weed/operation/submit.go index e785b68a9..c34b33577 100644 --- a/weed/operation/submit.go +++ b/weed/operation/submit.go @@ -25,6 +25,7 @@ type FilePart struct { Collection string DataCenter string Ttl string + DiskType string Server string //this comes from assign result Fid string //this comes from assign result, but customizable Fsync bool @@ -38,7 +39,7 @@ type SubmitResult struct { Error string `json:"error,omitempty"` } -func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart, replication string, collection string, dataCenter string, ttl string, maxMB int, usePublicUrl bool) ([]SubmitResult, error) { +func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart, replication string, collection string, dataCenter string, ttl string, diskType string, maxMB int, usePublicUrl bool) ([]SubmitResult, error) { results := make([]SubmitResult, len(files)) for index, file := range files { results[index].FileName = file.FileName @@ -49,6 +50,7 @@ func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart Collection: collection, DataCenter: dataCenter, Ttl: ttl, + DiskType: diskType, } ret, err := Assign(master, grpcDialOption, ar) if err != nil { @@ -70,6 +72,7 @@ func SubmitFiles(master string, grpcDialOption grpc.DialOption, files []FilePart file.Collection = collection file.DataCenter = dataCenter file.Ttl = ttl + file.DiskType = diskType results[index].Size, err = file.Upload(maxMB, master, usePublicUrl, ret.Auth, grpcDialOption) if err != nil { results[index].Error = err.Error() @@ -143,6 +146,7 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt secur Replication: fi.Replication, Collection: fi.Collection, Ttl: fi.Ttl, + DiskType: fi.DiskType, } ret, err = Assign(master, grpcDialOption, ar) if err != nil { @@ -156,6 +160,7 @@ func (fi FilePart) Upload(maxMB int, master string, usePublicUrl bool, jwt secur Replication: fi.Replication, Collection: fi.Collection, Ttl: fi.Ttl, + DiskType: fi.DiskType, } ret, err = Assign(master, grpcDialOption, ar) if err != nil { |
