forked from TrueCloudLab/frostfs-node
[#59] Add grpc payload splitter in object service chain
GRPC has default message limit of 4MiB. Since every transmitted neofs message has to be signed, then original message should be split into transfer fit structures before signature service. This commit introduce transport payload splitter for object service pipeline. This splitter works with stream response for methods: - object.Get - object.Range - object.Search Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
64691e6248
commit
d2009c8731
3 changed files with 220 additions and 9 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
nmwrapper "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/services/object"
|
||||
tokenStorage "github.com/nspcc-dev/neofs-node/pkg/services/session/storage"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
||||
"github.com/spf13/viper"
|
||||
|
@ -91,6 +92,10 @@ type cfgGRPC struct {
|
|||
listener net.Listener
|
||||
|
||||
server *grpc.Server
|
||||
|
||||
maxChunkSize uint64
|
||||
|
||||
maxAddrAmount uint64
|
||||
}
|
||||
|
||||
type cfgMorph struct {
|
||||
|
@ -186,6 +191,10 @@ func initCfg(path string) *cfg {
|
|||
cfgObject: cfgObject{
|
||||
maxObjectSize: viperCfg.GetUint64(cfgMaxObjectSize),
|
||||
},
|
||||
cfgGRPC: cfgGRPC{
|
||||
maxChunkSize: object.GRPCPayloadChunkSize,
|
||||
maxAddrAmount: object.GRPCSearchAddrAmount,
|
||||
},
|
||||
localAddr: netAddr,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue