Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用DynamicPartitionChannel时,request map的接口没有提供分片总数 #2055

Closed
cdjingit opened this issue Dec 23, 2022 · 3 comments

Comments

@cdjingit
Copy link
Contributor

cdjingit commented Dec 23, 2022

Describe the bug (描述bug)

使用DynamicPartitionChannel时,各个片库的分片数是变化的, Request Map里只有channel_idx, 没有分片总数的信息。
https://github.com/apache/incubator-brpc/blob/master/src/brpc/parallel_channel.h#L94

virtual SubCall Map(int channel_index/*starting from 0*/,
                        const google::protobuf::MethodDescriptor* method,
                        const google::protobuf::Message* request,
                        google::protobuf::Message* response) = 0;

接口改为:
virtual SubCall Map(int channel_index/*starting from 0*/,
                        int channel_count,
                        const google::protobuf::MethodDescriptor* method,
                        const google::protobuf::Message* request,
                        google::protobuf::Message* response) = 0;
@wwbmmm
Copy link
Contributor

wwbmmm commented Dec 23, 2022

是否可以改为

virtual SubCall Map(int channel_index/*starting from 0*/,
                        int /*channel_count*/,
                        const google::protobuf::MethodDescriptor* method,
                        const google::protobuf::Message* request,
                        google::protobuf::Message* response) {
    return Map(channel_index, method, request, response);
}

兼容一下现有代码

@cdjingit
Copy link
Contributor Author

可以

@cdjingit
Copy link
Contributor Author

#2057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants