|
@ -27,6 +27,12 @@ type SeaweedMessagingClient interface { |
|
|
AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error) |
|
|
AssignSegmentBrokers(ctx context.Context, in *AssignSegmentBrokersRequest, opts ...grpc.CallOption) (*AssignSegmentBrokersResponse, error) |
|
|
CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error) |
|
|
CheckSegmentStatus(ctx context.Context, in *CheckSegmentStatusRequest, opts ...grpc.CallOption) (*CheckSegmentStatusResponse, error) |
|
|
CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error) |
|
|
CheckBrokerLoad(ctx context.Context, in *CheckBrokerLoadRequest, opts ...grpc.CallOption) (*CheckBrokerLoadResponse, error) |
|
|
|
|
|
// control plane for topic partitions
|
|
|
|
|
|
FindTopicBrokers(ctx context.Context, in *FindTopicBrokersRequest, opts ...grpc.CallOption) (*FindTopicBrokersResponse, error) |
|
|
|
|
|
// a pub client will call this to get the topic partitions assignment
|
|
|
|
|
|
RequestTopicPartitions(ctx context.Context, in *RequestTopicPartitionsRequest, opts ...grpc.CallOption) (*RequestTopicPartitionsResponse, error) |
|
|
|
|
|
AssignTopicPartitions(ctx context.Context, in *AssignTopicPartitionsRequest, opts ...grpc.CallOption) (*AssignTopicPartitionsResponse, error) |
|
|
|
|
|
CheckTopicPartitionsStatus(ctx context.Context, in *CheckTopicPartitionsStatusRequest, opts ...grpc.CallOption) (*CheckTopicPartitionsStatusResponse, error) |
|
|
// data plane
|
|
|
// data plane
|
|
|
Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) |
|
|
Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) |
|
|
} |
|
|
} |
|
@ -75,6 +81,42 @@ func (c *seaweedMessagingClient) CheckBrokerLoad(ctx context.Context, in *CheckB |
|
|
return out, nil |
|
|
return out, nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *seaweedMessagingClient) FindTopicBrokers(ctx context.Context, in *FindTopicBrokersRequest, opts ...grpc.CallOption) (*FindTopicBrokersResponse, error) { |
|
|
|
|
|
out := new(FindTopicBrokersResponse) |
|
|
|
|
|
err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/FindTopicBrokers", in, out, opts...) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
return out, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *seaweedMessagingClient) RequestTopicPartitions(ctx context.Context, in *RequestTopicPartitionsRequest, opts ...grpc.CallOption) (*RequestTopicPartitionsResponse, error) { |
|
|
|
|
|
out := new(RequestTopicPartitionsResponse) |
|
|
|
|
|
err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/RequestTopicPartitions", in, out, opts...) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
return out, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *seaweedMessagingClient) AssignTopicPartitions(ctx context.Context, in *AssignTopicPartitionsRequest, opts ...grpc.CallOption) (*AssignTopicPartitionsResponse, error) { |
|
|
|
|
|
out := new(AssignTopicPartitionsResponse) |
|
|
|
|
|
err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/AssignTopicPartitions", in, out, opts...) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
return out, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *seaweedMessagingClient) CheckTopicPartitionsStatus(ctx context.Context, in *CheckTopicPartitionsStatusRequest, opts ...grpc.CallOption) (*CheckTopicPartitionsStatusResponse, error) { |
|
|
|
|
|
out := new(CheckTopicPartitionsStatusResponse) |
|
|
|
|
|
err := c.cc.Invoke(ctx, "/messaging_pb.SeaweedMessaging/CheckTopicPartitionsStatus", in, out, opts...) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
return out, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) { |
|
|
func (c *seaweedMessagingClient) Publish(ctx context.Context, opts ...grpc.CallOption) (SeaweedMessaging_PublishClient, error) { |
|
|
stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/Publish", opts...) |
|
|
stream, err := c.cc.NewStream(ctx, &SeaweedMessaging_ServiceDesc.Streams[0], "/messaging_pb.SeaweedMessaging/Publish", opts...) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@ -115,6 +157,12 @@ type SeaweedMessagingServer interface { |
|
|
AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error) |
|
|
AssignSegmentBrokers(context.Context, *AssignSegmentBrokersRequest) (*AssignSegmentBrokersResponse, error) |
|
|
CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error) |
|
|
CheckSegmentStatus(context.Context, *CheckSegmentStatusRequest) (*CheckSegmentStatusResponse, error) |
|
|
CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) |
|
|
CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) |
|
|
|
|
|
// control plane for topic partitions
|
|
|
|
|
|
FindTopicBrokers(context.Context, *FindTopicBrokersRequest) (*FindTopicBrokersResponse, error) |
|
|
|
|
|
// a pub client will call this to get the topic partitions assignment
|
|
|
|
|
|
RequestTopicPartitions(context.Context, *RequestTopicPartitionsRequest) (*RequestTopicPartitionsResponse, error) |
|
|
|
|
|
AssignTopicPartitions(context.Context, *AssignTopicPartitionsRequest) (*AssignTopicPartitionsResponse, error) |
|
|
|
|
|
CheckTopicPartitionsStatus(context.Context, *CheckTopicPartitionsStatusRequest) (*CheckTopicPartitionsStatusResponse, error) |
|
|
// data plane
|
|
|
// data plane
|
|
|
Publish(SeaweedMessaging_PublishServer) error |
|
|
Publish(SeaweedMessaging_PublishServer) error |
|
|
mustEmbedUnimplementedSeaweedMessagingServer() |
|
|
mustEmbedUnimplementedSeaweedMessagingServer() |
|
@ -136,6 +184,18 @@ func (UnimplementedSeaweedMessagingServer) CheckSegmentStatus(context.Context, * |
|
|
func (UnimplementedSeaweedMessagingServer) CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) { |
|
|
func (UnimplementedSeaweedMessagingServer) CheckBrokerLoad(context.Context, *CheckBrokerLoadRequest) (*CheckBrokerLoadResponse, error) { |
|
|
return nil, status.Errorf(codes.Unimplemented, "method CheckBrokerLoad not implemented") |
|
|
return nil, status.Errorf(codes.Unimplemented, "method CheckBrokerLoad not implemented") |
|
|
} |
|
|
} |
|
|
|
|
|
func (UnimplementedSeaweedMessagingServer) FindTopicBrokers(context.Context, *FindTopicBrokersRequest) (*FindTopicBrokersResponse, error) { |
|
|
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method FindTopicBrokers not implemented") |
|
|
|
|
|
} |
|
|
|
|
|
func (UnimplementedSeaweedMessagingServer) RequestTopicPartitions(context.Context, *RequestTopicPartitionsRequest) (*RequestTopicPartitionsResponse, error) { |
|
|
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method RequestTopicPartitions not implemented") |
|
|
|
|
|
} |
|
|
|
|
|
func (UnimplementedSeaweedMessagingServer) AssignTopicPartitions(context.Context, *AssignTopicPartitionsRequest) (*AssignTopicPartitionsResponse, error) { |
|
|
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method AssignTopicPartitions not implemented") |
|
|
|
|
|
} |
|
|
|
|
|
func (UnimplementedSeaweedMessagingServer) CheckTopicPartitionsStatus(context.Context, *CheckTopicPartitionsStatusRequest) (*CheckTopicPartitionsStatusResponse, error) { |
|
|
|
|
|
return nil, status.Errorf(codes.Unimplemented, "method CheckTopicPartitionsStatus not implemented") |
|
|
|
|
|
} |
|
|
func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error { |
|
|
func (UnimplementedSeaweedMessagingServer) Publish(SeaweedMessaging_PublishServer) error { |
|
|
return status.Errorf(codes.Unimplemented, "method Publish not implemented") |
|
|
return status.Errorf(codes.Unimplemented, "method Publish not implemented") |
|
|
} |
|
|
} |
|
@ -224,6 +284,78 @@ func _SeaweedMessaging_CheckBrokerLoad_Handler(srv interface{}, ctx context.Cont |
|
|
return interceptor(ctx, in, info, handler) |
|
|
return interceptor(ctx, in, info, handler) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func _SeaweedMessaging_FindTopicBrokers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
|
|
|
|
in := new(FindTopicBrokersRequest) |
|
|
|
|
|
if err := dec(in); err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
if interceptor == nil { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).FindTopicBrokers(ctx, in) |
|
|
|
|
|
} |
|
|
|
|
|
info := &grpc.UnaryServerInfo{ |
|
|
|
|
|
Server: srv, |
|
|
|
|
|
FullMethod: "/messaging_pb.SeaweedMessaging/FindTopicBrokers", |
|
|
|
|
|
} |
|
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).FindTopicBrokers(ctx, req.(*FindTopicBrokersRequest)) |
|
|
|
|
|
} |
|
|
|
|
|
return interceptor(ctx, in, info, handler) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func _SeaweedMessaging_RequestTopicPartitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
|
|
|
|
in := new(RequestTopicPartitionsRequest) |
|
|
|
|
|
if err := dec(in); err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
if interceptor == nil { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).RequestTopicPartitions(ctx, in) |
|
|
|
|
|
} |
|
|
|
|
|
info := &grpc.UnaryServerInfo{ |
|
|
|
|
|
Server: srv, |
|
|
|
|
|
FullMethod: "/messaging_pb.SeaweedMessaging/RequestTopicPartitions", |
|
|
|
|
|
} |
|
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).RequestTopicPartitions(ctx, req.(*RequestTopicPartitionsRequest)) |
|
|
|
|
|
} |
|
|
|
|
|
return interceptor(ctx, in, info, handler) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func _SeaweedMessaging_AssignTopicPartitions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
|
|
|
|
in := new(AssignTopicPartitionsRequest) |
|
|
|
|
|
if err := dec(in); err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
if interceptor == nil { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).AssignTopicPartitions(ctx, in) |
|
|
|
|
|
} |
|
|
|
|
|
info := &grpc.UnaryServerInfo{ |
|
|
|
|
|
Server: srv, |
|
|
|
|
|
FullMethod: "/messaging_pb.SeaweedMessaging/AssignTopicPartitions", |
|
|
|
|
|
} |
|
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).AssignTopicPartitions(ctx, req.(*AssignTopicPartitionsRequest)) |
|
|
|
|
|
} |
|
|
|
|
|
return interceptor(ctx, in, info, handler) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func _SeaweedMessaging_CheckTopicPartitionsStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
|
|
|
|
|
in := new(CheckTopicPartitionsStatusRequest) |
|
|
|
|
|
if err := dec(in); err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
if interceptor == nil { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).CheckTopicPartitionsStatus(ctx, in) |
|
|
|
|
|
} |
|
|
|
|
|
info := &grpc.UnaryServerInfo{ |
|
|
|
|
|
Server: srv, |
|
|
|
|
|
FullMethod: "/messaging_pb.SeaweedMessaging/CheckTopicPartitionsStatus", |
|
|
|
|
|
} |
|
|
|
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
|
|
|
|
|
return srv.(SeaweedMessagingServer).CheckTopicPartitionsStatus(ctx, req.(*CheckTopicPartitionsStatusRequest)) |
|
|
|
|
|
} |
|
|
|
|
|
return interceptor(ctx, in, info, handler) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error { |
|
|
func _SeaweedMessaging_Publish_Handler(srv interface{}, stream grpc.ServerStream) error { |
|
|
return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream}) |
|
|
return srv.(SeaweedMessagingServer).Publish(&seaweedMessagingPublishServer{stream}) |
|
|
} |
|
|
} |
|
@ -273,6 +405,22 @@ var SeaweedMessaging_ServiceDesc = grpc.ServiceDesc{ |
|
|
MethodName: "CheckBrokerLoad", |
|
|
MethodName: "CheckBrokerLoad", |
|
|
Handler: _SeaweedMessaging_CheckBrokerLoad_Handler, |
|
|
Handler: _SeaweedMessaging_CheckBrokerLoad_Handler, |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
MethodName: "FindTopicBrokers", |
|
|
|
|
|
Handler: _SeaweedMessaging_FindTopicBrokers_Handler, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
MethodName: "RequestTopicPartitions", |
|
|
|
|
|
Handler: _SeaweedMessaging_RequestTopicPartitions_Handler, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
MethodName: "AssignTopicPartitions", |
|
|
|
|
|
Handler: _SeaweedMessaging_AssignTopicPartitions_Handler, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
MethodName: "CheckTopicPartitionsStatus", |
|
|
|
|
|
Handler: _SeaweedMessaging_CheckTopicPartitionsStatus_Handler, |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
Streams: []grpc.StreamDesc{ |
|
|
Streams: []grpc.StreamDesc{ |
|
|
{ |
|
|
{ |
|
|
xxxxxxxxxx