mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
78b3728169
configure s3 circuit breaker by 'command_s3_circuitbreaker.go': usage eg: # Configure the number of simultaneous global (current s3api node) requests s3.circuit.breaker -global -type count -actions Write -values 1000 -apply # Configure the number of simultaneous requests for bucket x read and write s3.circuit.breaker -buckets -type count -actions Read,Write -values 1000 -apply # Configure the total bytes of simultaneous requests for bucket write s3.circuit.breaker -buckets -type bytes -actions Write -values 100MiB -apply # Disable circuit breaker config of bucket 'x' s3.circuit.breaker -buckets x -enable false -apply # Delete circuit breaker config of bucket 'x' s3.circuit.breaker -buckets x -delete -apply
26 lines
483 B
Go
26 lines
483 B
Go
package filer
|
|
|
|
import (
|
|
"bytes"
|
|
"github.com/golang/protobuf/jsonpb"
|
|
"github.com/golang/protobuf/proto"
|
|
"io"
|
|
)
|
|
|
|
func ParseS3ConfigurationFromBytes[T proto.Message](content []byte, config T) error {
|
|
if err := jsonpb.Unmarshal(bytes.NewBuffer(content), config); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func ProtoToText(writer io.Writer, config proto.Message) error {
|
|
|
|
m := jsonpb.Marshaler{
|
|
EmitDefaults: false,
|
|
Indent: " ",
|
|
}
|
|
|
|
return m.Marshal(writer, config)
|
|
}
|