forked from TrueCloudLab/frostfs-sdk-go
[#317] api: Revert easyproto marshaler usage
It has caused a noticeable degradation in node. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
bab4d5a692
commit
328d214d2d
110 changed files with 47773 additions and 37555 deletions
|
@ -45,24 +45,24 @@ func (f *Filter) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func FiltersToGRPC(fs []Filter) (res []netmap.Filter) {
|
||||
func FiltersToGRPC(fs []Filter) (res []*netmap.Filter) {
|
||||
if fs != nil {
|
||||
res = make([]netmap.Filter, 0, len(fs))
|
||||
res = make([]*netmap.Filter, 0, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
res = append(res, *fs[i].ToGRPCMessage().(*netmap.Filter))
|
||||
res = append(res, fs[i].ToGRPCMessage().(*netmap.Filter))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func FiltersFromGRPC(fs []netmap.Filter) (res []Filter, err error) {
|
||||
func FiltersFromGRPC(fs []*netmap.Filter) (res []Filter, err error) {
|
||||
if fs != nil {
|
||||
res = make([]Filter, len(fs))
|
||||
|
||||
for i := range fs {
|
||||
err = res[i].FromGRPCMessage(&fs[i])
|
||||
err = res[i].FromGRPCMessage(fs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -103,24 +103,24 @@ func (s *Selector) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func SelectorsToGRPC(ss []Selector) (res []netmap.Selector) {
|
||||
func SelectorsToGRPC(ss []Selector) (res []*netmap.Selector) {
|
||||
if ss != nil {
|
||||
res = make([]netmap.Selector, 0, len(ss))
|
||||
res = make([]*netmap.Selector, 0, len(ss))
|
||||
|
||||
for i := range ss {
|
||||
res = append(res, *ss[i].ToGRPCMessage().(*netmap.Selector))
|
||||
res = append(res, ss[i].ToGRPCMessage().(*netmap.Selector))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func SelectorsFromGRPC(ss []netmap.Selector) (res []Selector, err error) {
|
||||
func SelectorsFromGRPC(ss []*netmap.Selector) (res []Selector, err error) {
|
||||
if ss != nil {
|
||||
res = make([]Selector, len(ss))
|
||||
|
||||
for i := range ss {
|
||||
err = res[i].FromGRPCMessage(&ss[i])
|
||||
err = res[i].FromGRPCMessage(ss[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -138,8 +138,8 @@ func (r *Replica) ToGRPCMessage() grpc.Message {
|
|||
|
||||
m.SetSelector(r.selector)
|
||||
m.SetCount(r.count)
|
||||
m.EcDataCount = r.ecDataCount
|
||||
m.EcParityCount = r.ecParityCount
|
||||
m.SetEcDataCount(r.ecDataCount)
|
||||
m.SetEcParityCount(r.ecParityCount)
|
||||
}
|
||||
|
||||
return m
|
||||
|
@ -159,24 +159,24 @@ func (r *Replica) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func ReplicasToGRPC(rs []Replica) (res []netmap.Replica) {
|
||||
func ReplicasToGRPC(rs []Replica) (res []*netmap.Replica) {
|
||||
if rs != nil {
|
||||
res = make([]netmap.Replica, 0, len(rs))
|
||||
res = make([]*netmap.Replica, 0, len(rs))
|
||||
|
||||
for i := range rs {
|
||||
res = append(res, *rs[i].ToGRPCMessage().(*netmap.Replica))
|
||||
res = append(res, rs[i].ToGRPCMessage().(*netmap.Replica))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func ReplicasFromGRPC(rs []netmap.Replica) (res []Replica, err error) {
|
||||
func ReplicasFromGRPC(rs []*netmap.Replica) (res []Replica, err error) {
|
||||
if rs != nil {
|
||||
res = make([]Replica, len(rs))
|
||||
|
||||
for i := range rs {
|
||||
err = res[i].FromGRPCMessage(&rs[i])
|
||||
err = res[i].FromGRPCMessage(rs[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -283,24 +283,24 @@ func (a *Attribute) FromGRPCMessage(m grpc.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func AttributesToGRPC(as []Attribute) (res []netmap.NodeInfo_Attribute) {
|
||||
func AttributesToGRPC(as []Attribute) (res []*netmap.NodeInfo_Attribute) {
|
||||
if as != nil {
|
||||
res = make([]netmap.NodeInfo_Attribute, 0, len(as))
|
||||
res = make([]*netmap.NodeInfo_Attribute, 0, len(as))
|
||||
|
||||
for i := range as {
|
||||
res = append(res, *as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute))
|
||||
res = append(res, as[i].ToGRPCMessage().(*netmap.NodeInfo_Attribute))
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func AttributesFromGRPC(as []netmap.NodeInfo_Attribute) (res []Attribute, err error) {
|
||||
func AttributesFromGRPC(as []*netmap.NodeInfo_Attribute) (res []Attribute, err error) {
|
||||
if as != nil {
|
||||
res = make([]Attribute, len(as))
|
||||
|
||||
for i := range as {
|
||||
err = res[i].FromGRPCMessage(&as[i])
|
||||
err = res[i].FromGRPCMessage(as[i])
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -520,13 +520,13 @@ func (x *NetworkConfig) ToGRPCMessage() grpc.Message {
|
|||
if x != nil {
|
||||
m = new(netmap.NetworkConfig)
|
||||
|
||||
var ps []netmap.NetworkConfig_Parameter
|
||||
var ps []*netmap.NetworkConfig_Parameter
|
||||
|
||||
if ln := len(x.ps); ln > 0 {
|
||||
ps = make([]netmap.NetworkConfig_Parameter, 0, ln)
|
||||
ps = make([]*netmap.NetworkConfig_Parameter, 0, ln)
|
||||
|
||||
for i := range ln {
|
||||
ps = append(ps, *x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter))
|
||||
ps = append(ps, x.ps[i].ToGRPCMessage().(*netmap.NetworkConfig_Parameter))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -553,7 +553,7 @@ func (x *NetworkConfig) FromGRPCMessage(m grpc.Message) error {
|
|||
ps = make([]NetworkParameter, ln)
|
||||
|
||||
for i := range ln {
|
||||
if err := ps[i].FromGRPCMessage(&psV2[i]); err != nil {
|
||||
if err := ps[i].FromGRPCMessage(psV2[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -746,10 +746,10 @@ func (x *NetMap) ToGRPCMessage() grpc.Message {
|
|||
m.SetEpoch(x.epoch)
|
||||
|
||||
if x.nodes != nil {
|
||||
nodes := make([]netmap.NodeInfo, len(x.nodes))
|
||||
nodes := make([]*netmap.NodeInfo, len(x.nodes))
|
||||
|
||||
for i := range x.nodes {
|
||||
nodes[i] = *x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo)
|
||||
nodes[i] = x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo)
|
||||
}
|
||||
|
||||
m.SetNodes(nodes)
|
||||
|
@ -774,7 +774,7 @@ func (x *NetMap) FromGRPCMessage(m grpc.Message) error {
|
|||
x.nodes = make([]NodeInfo, len(nodes))
|
||||
|
||||
for i := range nodes {
|
||||
err = x.nodes[i].FromGRPCMessage(&nodes[i])
|
||||
err = x.nodes[i].FromGRPCMessage(nodes[i])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
1417
api/netmap/grpc/service.pb.go
generated
Normal file
1417
api/netmap/grpc/service.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
2180
api/netmap/grpc/service_frostfs.pb.go
generated
2180
api/netmap/grpc/service_frostfs.pb.go
generated
File diff suppressed because it is too large
Load diff
|
@ -1,121 +0,0 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzProtoLocalNodeInfoRequest(data []byte) int {
|
||||
msg := new(LocalNodeInfoRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLocalNodeInfoRequest(data []byte) int {
|
||||
msg := new(LocalNodeInfoRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoLocalNodeInfoResponse(data []byte) int {
|
||||
msg := new(LocalNodeInfoResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONLocalNodeInfoResponse(data []byte) int {
|
||||
msg := new(LocalNodeInfoResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfoRequest(data []byte) int {
|
||||
msg := new(NetworkInfoRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfoRequest(data []byte) int {
|
||||
msg := new(NetworkInfoRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfoResponse(data []byte) int {
|
||||
msg := new(NetworkInfoResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfoResponse(data []byte) int {
|
||||
msg := new(NetworkInfoResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmapSnapshotRequest(data []byte) int {
|
||||
msg := new(NetmapSnapshotRequest)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmapSnapshotRequest(data []byte) int {
|
||||
msg := new(NetmapSnapshotRequest)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmapSnapshotResponse(data []byte) int {
|
||||
msg := new(NetmapSnapshotResponse)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmapSnapshotResponse(data []byte) int {
|
||||
msg := new(NetmapSnapshotResponse)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoLocalNodeInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLocalNodeInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLocalNodeInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLocalNodeInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoLocalNodeInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoLocalNodeInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONLocalNodeInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONLocalNodeInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfoRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfoRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfoResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfoResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmapSnapshotRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmapSnapshotRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmapSnapshotRequest(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmapSnapshotRequest(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmapSnapshotResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmapSnapshotResponse(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmapSnapshotResponse(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmapSnapshotResponse(data)
|
||||
})
|
||||
}
|
46
api/netmap/grpc/service_grpc.pb.go
generated
46
api/netmap/grpc/service_grpc.pb.go
generated
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc v5.27.2
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v5.29.2
|
||||
// source: api/netmap/grpc/service.proto
|
||||
|
||||
package netmap
|
||||
|
@ -15,8 +15,8 @@ import (
|
|||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
NetmapService_LocalNodeInfo_FullMethodName = "/neo.fs.v2.netmap.NetmapService/LocalNodeInfo"
|
||||
|
@ -27,6 +27,11 @@ const (
|
|||
// NetmapServiceClient is the client API for NetmapService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
//
|
||||
// `NetmapService` provides methods to work with `Network Map` and the
|
||||
// information required to build it. The resulting `Network Map` is stored in
|
||||
// sidechain `Netmap` smart contract, while related information can be obtained
|
||||
// from other FrostFS nodes.
|
||||
type NetmapServiceClient interface {
|
||||
// Get NodeInfo structure from the particular node directly.
|
||||
// Node information can be taken from `Netmap` smart contract. In some cases,
|
||||
|
@ -65,8 +70,9 @@ func NewNetmapServiceClient(cc grpc.ClientConnInterface) NetmapServiceClient {
|
|||
}
|
||||
|
||||
func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeInfoRequest, opts ...grpc.CallOption) (*LocalNodeInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LocalNodeInfoResponse)
|
||||
err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, NetmapService_LocalNodeInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -74,8 +80,9 @@ func (c *netmapServiceClient) LocalNodeInfo(ctx context.Context, in *LocalNodeIn
|
|||
}
|
||||
|
||||
func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRequest, opts ...grpc.CallOption) (*NetworkInfoResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NetworkInfoResponse)
|
||||
err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, NetmapService_NetworkInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -83,8 +90,9 @@ func (c *netmapServiceClient) NetworkInfo(ctx context.Context, in *NetworkInfoRe
|
|||
}
|
||||
|
||||
func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnapshotRequest, opts ...grpc.CallOption) (*NetmapSnapshotResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NetmapSnapshotResponse)
|
||||
err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, NetmapService_NetmapSnapshot_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -93,7 +101,12 @@ func (c *netmapServiceClient) NetmapSnapshot(ctx context.Context, in *NetmapSnap
|
|||
|
||||
// NetmapServiceServer is the server API for NetmapService service.
|
||||
// All implementations should embed UnimplementedNetmapServiceServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
//
|
||||
// `NetmapService` provides methods to work with `Network Map` and the
|
||||
// information required to build it. The resulting `Network Map` is stored in
|
||||
// sidechain `Netmap` smart contract, while related information can be obtained
|
||||
// from other FrostFS nodes.
|
||||
type NetmapServiceServer interface {
|
||||
// Get NodeInfo structure from the particular node directly.
|
||||
// Node information can be taken from `Netmap` smart contract. In some cases,
|
||||
|
@ -123,9 +136,12 @@ type NetmapServiceServer interface {
|
|||
NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedNetmapServiceServer should be embedded to have forward compatible implementations.
|
||||
type UnimplementedNetmapServiceServer struct {
|
||||
}
|
||||
// UnimplementedNetmapServiceServer should be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedNetmapServiceServer struct{}
|
||||
|
||||
func (UnimplementedNetmapServiceServer) LocalNodeInfo(context.Context, *LocalNodeInfoRequest) (*LocalNodeInfoResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LocalNodeInfo not implemented")
|
||||
|
@ -136,6 +152,7 @@ func (UnimplementedNetmapServiceServer) NetworkInfo(context.Context, *NetworkInf
|
|||
func (UnimplementedNetmapServiceServer) NetmapSnapshot(context.Context, *NetmapSnapshotRequest) (*NetmapSnapshotResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NetmapSnapshot not implemented")
|
||||
}
|
||||
func (UnimplementedNetmapServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeNetmapServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to NetmapServiceServer will
|
||||
|
@ -145,6 +162,13 @@ type UnsafeNetmapServiceServer interface {
|
|||
}
|
||||
|
||||
func RegisterNetmapServiceServer(s grpc.ServiceRegistrar, srv NetmapServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedNetmapServiceServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&NetmapService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
|
|
1377
api/netmap/grpc/service_protoopaque.pb.go
generated
Normal file
1377
api/netmap/grpc/service_protoopaque.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
1857
api/netmap/grpc/types.pb.go
generated
Normal file
1857
api/netmap/grpc/types.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
2749
api/netmap/grpc/types_frostfs.pb.go
generated
2749
api/netmap/grpc/types_frostfs.pb.go
generated
File diff suppressed because it is too large
Load diff
|
@ -1,159 +0,0 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
func DoFuzzProtoFilter(data []byte) int {
|
||||
msg := new(Filter)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONFilter(data []byte) int {
|
||||
msg := new(Filter)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoSelector(data []byte) int {
|
||||
msg := new(Selector)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONSelector(data []byte) int {
|
||||
msg := new(Selector)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoReplica(data []byte) int {
|
||||
msg := new(Replica)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONReplica(data []byte) int {
|
||||
msg := new(Replica)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoPlacementPolicy(data []byte) int {
|
||||
msg := new(PlacementPolicy)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONPlacementPolicy(data []byte) int {
|
||||
msg := new(PlacementPolicy)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNodeInfo(data []byte) int {
|
||||
msg := new(NodeInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNodeInfo(data []byte) int {
|
||||
msg := new(NodeInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetmap(data []byte) int {
|
||||
msg := new(Netmap)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetmap(data []byte) int {
|
||||
msg := new(Netmap)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkConfig(data []byte) int {
|
||||
msg := new(NetworkConfig)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkConfig(data []byte) int {
|
||||
msg := new(NetworkConfig)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
||||
func DoFuzzProtoNetworkInfo(data []byte) int {
|
||||
msg := new(NetworkInfo)
|
||||
if err := msg.UnmarshalProtobuf(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_ = msg.MarshalProtobuf(nil)
|
||||
return 1
|
||||
}
|
||||
func DoFuzzJSONNetworkInfo(data []byte) int {
|
||||
msg := new(NetworkInfo)
|
||||
if err := msg.UnmarshalJSON(data); err != nil {
|
||||
return 0
|
||||
}
|
||||
_, err := msg.MarshalJSON()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return 1
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
//go:build gofuzz
|
||||
// +build gofuzz
|
||||
|
||||
// Code generated by protoc-gen-go-frostfs. DO NOT EDIT.
|
||||
|
||||
package netmap
|
||||
|
||||
import (
|
||||
testing "testing"
|
||||
)
|
||||
|
||||
func FuzzProtoFilter(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoFilter(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONFilter(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONFilter(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoSelector(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoSelector(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONSelector(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONSelector(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoReplica(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoReplica(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONReplica(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONReplica(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoPlacementPolicy(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoPlacementPolicy(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONPlacementPolicy(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONPlacementPolicy(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNodeInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNodeInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNodeInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNodeInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetmap(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetmap(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetmap(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetmap(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkConfig(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkConfig(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkConfig(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkConfig(data)
|
||||
})
|
||||
}
|
||||
func FuzzProtoNetworkInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzProtoNetworkInfo(data)
|
||||
})
|
||||
}
|
||||
func FuzzJSONNetworkInfo(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, data []byte) {
|
||||
DoFuzzJSONNetworkInfo(data)
|
||||
})
|
||||
}
|
2001
api/netmap/grpc/types_protoopaque.pb.go
generated
Normal file
2001
api/netmap/grpc/types_protoopaque.pb.go
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -14,12 +14,10 @@ func (x Clause) String() string {
|
|||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Clause) FromString(s string) bool {
|
||||
var g netmap.Clause
|
||||
|
||||
ok := g.FromString(s)
|
||||
g, ok := netmap.Clause_value[s]
|
||||
|
||||
if ok {
|
||||
*x = ClauseFromGRPCMessage(g)
|
||||
*x = ClauseFromGRPCMessage(netmap.Clause(g))
|
||||
}
|
||||
|
||||
return ok
|
||||
|
@ -35,12 +33,10 @@ func (x Operation) String() string {
|
|||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *Operation) FromString(s string) bool {
|
||||
var g netmap.Operation
|
||||
|
||||
ok := g.FromString(s)
|
||||
g, ok := netmap.Operation_value[s]
|
||||
|
||||
if ok {
|
||||
*x = OperationFromGRPCMessage(g)
|
||||
*x = OperationFromGRPCMessage(netmap.Operation(g))
|
||||
}
|
||||
|
||||
return ok
|
||||
|
@ -56,12 +52,10 @@ func (x NodeState) String() string {
|
|||
//
|
||||
// Returns true if s was parsed successfully.
|
||||
func (x *NodeState) FromString(s string) bool {
|
||||
var g netmap.NodeInfo_State
|
||||
|
||||
ok := g.FromString(s)
|
||||
g, ok := netmap.NodeInfo_State_value[s]
|
||||
|
||||
if ok {
|
||||
*x = NodeStateFromRPCMessage(g)
|
||||
*x = NodeStateFromRPCMessage(netmap.NodeInfo_State(g))
|
||||
}
|
||||
|
||||
return ok
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue