aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_server.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-01-03 00:37:24 -0800
committerChris Lu <chris.lu@gmail.com>2020-01-03 00:37:26 -0800
commit3eafec4b29b9a5090eb6dd5f0ddee6ee1f713792 (patch)
tree9614ba54b9e746bb05d3559aeee63d64f241da75 /weed/server/volume_server.go
parenta3a2e69900290256646f24d9bbd2f204c188af2f (diff)
downloadseaweedfs-3eafec4b29b9a5090eb6dd5f0ddee6ee1f713792.tar.xz
seaweedfs-3eafec4b29b9a5090eb6dd5f0ddee6ee1f713792.zip
volume: add option to limit file size
Diffstat (limited to 'weed/server/volume_server.go')
-rw-r--r--weed/server/volume_server.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go
index 6cf654738..a406b36cc 100644
--- a/weed/server/volume_server.go
+++ b/weed/server/volume_server.go
@@ -4,13 +4,15 @@ import (
"fmt"
"net/http"
- "github.com/chrislusf/seaweedfs/weed/stats"
"google.golang.org/grpc"
+ "github.com/chrislusf/seaweedfs/weed/stats"
+
+ "github.com/spf13/viper"
+
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/storage"
- "github.com/spf13/viper"
)
type VolumeServer struct {
@@ -29,6 +31,7 @@ type VolumeServer struct {
compactionBytePerSecond int64
MetricsAddress string
MetricsIntervalSec int
+ fileSizeLimitBytes int64
}
func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
@@ -41,6 +44,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
fixJpgOrientation bool,
readRedirect bool,
compactionMBPerSecond int,
+ fileSizeLimitMB int,
) *VolumeServer {
v := viper.GetViper()
@@ -62,6 +66,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
ReadRedirect: readRedirect,
grpcDialOption: security.LoadClientTLS(viper.Sub("grpc"), "volume"),
compactionBytePerSecond: int64(compactionMBPerSecond) * 1024 * 1024,
+ fileSizeLimitBytes: int64(fileSizeLimitMB) * 1024 * 1024,
}
vs.SeedMasterNodes = masterNodes
vs.store = storage.NewStore(vs.grpcDialOption, port, ip, publicUrl, folders, maxCounts, vs.needleMapKind)