Commit c2388562 authored by wangxuefeng's avatar wangxuefeng

rename ThriftBinary* to ThriftFramed*

parent c332d839
......@@ -6,7 +6,7 @@ include config.mk
# 2. Added -D__const__= : Avoid over-optimizations of TLS variables by GCC>=4.8
# 3. Removed -Werror: Not block compilation for non-vital warnings, especially when the
# code is tested on newer systems. If the code is used in production, add -Werror back
CPPFLAGS+=-DENABLE_THRIFT_FRAMED_PROTOCOL -DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -DBRPC_REVISION=\"$(shell git rev-parse --short HEAD)\"
CPPFLAGS+=-DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -DBRPC_REVISION=\"$(shell git rev-parse --short HEAD)\"
CXXFLAGS=$(CPPFLAGS) -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x
CFLAGS=$(CPPFLAGS) -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer
DEBUG_CXXFLAGS = $(filter-out -DNDEBUG,$(CXXFLAGS)) -DUNIT_TEST -DBVAR_NOT_LINK_DEFAULT_VARIABLES
......
......@@ -90,7 +90,7 @@ int main(int argc, char* argv[]) {
<< "Sending thrift requests at qps=" << g_latency_recorder.qps(1)
<< " latency=" << g_latency_recorder.latency(1);
sleep(1);
//sleep(1);
}
......
......@@ -48,10 +48,10 @@ public:
// Adapt your own thrift-based protocol to use brpc
class MyThriftProtocol : public brpc::ThriftFramedService {
public:
void ProcessThriftBinaryRequest(const brpc::Server&,
void ProcessThriftFramedRequest(const brpc::Server&,
brpc::Controller* cntl,
const brpc::ThriftBinaryMessage& request,
brpc::ThriftBinaryMessage* response,
const brpc::ThriftFramedMessage& request,
brpc::ThriftFramedMessage* response,
brpc::ThriftFramedClosure* done) {
// This object helps you to call done->Run() in RAII style. If you need
// to process the request asynchronously, pass done_guard.release().
......@@ -81,10 +81,10 @@ public:
// Adapt your own thrift-based protocol to use brpc
class MyThriftProtocolAnother : public brpc::ThriftFramedService {
public:
void ProcessThriftBinaryRequest(const brpc::Server&,
void ProcessThriftFramedRequest(const brpc::Server&,
brpc::Controller* cntl,
const brpc::ThriftBinaryMessage& request,
brpc::ThriftBinaryMessage* response,
const brpc::ThriftFramedMessage& request,
brpc::ThriftFramedMessage* response,
brpc::ThriftFramedClosure* done) {
// This object helps you to call done->Run() in RAII style. If you need
// to process the request asynchronously, pass done_guard.release().
......@@ -97,7 +97,7 @@ public:
return;
}
brpc::ThriftBinaryMessage request_ref = request;
brpc::ThriftFramedMessage request_ref = request;
example::EchoRequest* req = request_ref.cast<example::EchoRequest>();
example::EchoResponse* res = response->cast<example::EchoResponse>();
......
......@@ -423,10 +423,10 @@ static void GlobalInitializeOrDieImpl() {
}
#ifdef ENABLE_THRIFT_FRAMED_PROTOCOL
Protocol thrift_binary_protocol = { ParseThriftBinaryMessage,
SerializeThriftBinaryRequest, PackThriftBinaryRequest,
ProcessThriftBinaryRequest, ProcessThriftBinaryResponse,
VerifyThriftBinaryRequest, NULL, NULL,
Protocol thrift_binary_protocol = { ParseThriftFramedMessage,
SerializeThriftFramedRequest, PackThriftFramedRequest,
ProcessThriftFramedRequest, ProcessThriftFramedResponse,
VerifyThriftFramedRequest, NULL, NULL,
CONNECTION_TYPE_POOLED_AND_SHORT, "thrift" };
if (RegisterProtocol(PROTOCOL_THRIFT, thrift_binary_protocol) != 0) {
exit(1);
......
......@@ -192,7 +192,7 @@ void ThriftFramedClosure::SetMethodName(const std::string& full_method_name) {
namespace policy {
ParseResult ParseThriftBinaryMessage(butil::IOBuf* source,
ParseResult ParseThriftFramedMessage(butil::IOBuf* source,
Socket*, bool /*read_eof*/, const void* /*arg*/) {
char header_buf[sizeof(thrift_binary_head_t) + 3];
......@@ -230,14 +230,14 @@ struct CallMethodInBackupThreadArgs {
ThriftFramedService* service;
const Server* server;
Controller* controller;
const ThriftBinaryMessage* request;
ThriftBinaryMessage* response;
const ThriftFramedMessage* request;
ThriftFramedMessage* response;
ThriftFramedClosure* done;
};
static void CallMethodInBackupThread(void* void_args) {
CallMethodInBackupThreadArgs* args = (CallMethodInBackupThreadArgs*)void_args;
args->service->ProcessThriftBinaryRequest(*args->server, args->controller,
args->service->ProcessThriftFramedRequest(*args->server, args->controller,
*args->request, args->response,
args->done);
delete args;
......@@ -246,8 +246,8 @@ static void CallMethodInBackupThread(void* void_args) {
static void EndRunningCallMethodInPool(ThriftFramedService* service,
const Server& server,
Controller* controller,
const ThriftBinaryMessage& request,
ThriftBinaryMessage* response,
const ThriftFramedMessage& request,
ThriftFramedMessage* response,
ThriftFramedClosure* done) {
CallMethodInBackupThreadArgs* args = new CallMethodInBackupThreadArgs;
args->service = service;
......@@ -259,7 +259,7 @@ static void EndRunningCallMethodInPool(ThriftFramedService* service,
return EndRunningUserCodeInPool(CallMethodInBackupThread, args);
};
void ProcessThriftBinaryRequest(InputMessageBase* msg_base) {
void ProcessThriftFramedRequest(InputMessageBase* msg_base) {
const int64_t start_parse_us = butil::cpuwide_time_us();
......@@ -302,8 +302,8 @@ void ProcessThriftBinaryRequest(InputMessageBase* msg_base) {
}
ThriftFramedClosure* thrift_done = new (space) ThriftFramedClosure(sub_space);
Controller* cntl = &(thrift_done->_controller);
ThriftBinaryMessage* req = &(thrift_done->_request);
ThriftBinaryMessage* res = &(thrift_done->_response);
ThriftFramedMessage* req = &(thrift_done->_request);
ThriftFramedMessage* res = &(thrift_done->_response);
req->head = *req_head;
msg->payload.swap(req->body);
......@@ -369,10 +369,10 @@ void ProcessThriftBinaryRequest(InputMessageBase* msg_base) {
span->AsParent();
}
if (!FLAGS_usercode_in_pthread) {
return service->ProcessThriftBinaryRequest(*server, cntl, *req, res, thrift_done);
return service->ProcessThriftFramedRequest(*server, cntl, *req, res, thrift_done);
}
if (BeginRunningUserCode()) {
service->ProcessThriftBinaryRequest(*server, cntl, *req, res, thrift_done);
service->ProcessThriftFramedRequest(*server, cntl, *req, res, thrift_done);
return EndRunningUserCodeInPlace();
} else {
return EndRunningCallMethodInPool(
......@@ -381,11 +381,11 @@ void ProcessThriftBinaryRequest(InputMessageBase* msg_base) {
}
void ProcessThriftBinaryResponse(InputMessageBase* msg_base) {
void ProcessThriftFramedResponse(InputMessageBase* msg_base) {
const int64_t start_parse_us = butil::cpuwide_time_us();
DestroyingPtr<MostCommonMessage> msg(static_cast<MostCommonMessage*>(msg_base));
// Fetch correlation id that we saved before in `PacThriftBinaryRequest'
// Fetch correlation id that we saved before in `PacThriftFramedRequest'
const CallId cid = { static_cast<uint64_t>(msg->socket()->correlation_id()) };
Controller* cntl = NULL;
const int rc = bthread_id_lock(cid, (void**)&cntl);
......@@ -404,8 +404,8 @@ void ProcessThriftBinaryResponse(InputMessageBase* msg_base) {
span->set_start_parse_us(start_parse_us);
}
// MUST be ThriftBinaryMessage (checked in SerializeThriftBinaryRequest)
ThriftBinaryMessage* response = (ThriftBinaryMessage*)cntl->response();
// MUST be ThriftFramedMessage (checked in SerializeThriftFramedRequest)
ThriftFramedMessage* response = (ThriftFramedMessage*)cntl->response();
const int saved_error = cntl->ErrorCode();
if (response != NULL) {
msg->meta.copy_to(&response->head, sizeof(thrift_binary_head_t));
......@@ -506,7 +506,7 @@ void ProcessThriftBinaryResponse(InputMessageBase* msg_base) {
accessor.OnResponse(cid, saved_error);
}
bool VerifyThriftBinaryRequest(const InputMessageBase* msg_base) {
bool VerifyThriftFramedRequest(const InputMessageBase* msg_base) {
Server* server = (Server*)msg_base->arg();
if (server->options().auth) {
LOG(WARNING) << "thrift does not support authentication";
......@@ -515,14 +515,14 @@ bool VerifyThriftBinaryRequest(const InputMessageBase* msg_base) {
return true;
}
void SerializeThriftBinaryRequest(butil::IOBuf* request_buf, Controller* cntl,
void SerializeThriftFramedRequest(butil::IOBuf* request_buf, Controller* cntl,
const google::protobuf::Message* req_base) {
if (req_base == NULL) {
return cntl->SetFailed(EREQUEST, "request is NULL");
}
ControllerPrivateAccessor accessor(cntl);
const ThriftBinaryMessage* req = (const ThriftBinaryMessage*)req_base;
const ThriftFramedMessage* req = (const ThriftFramedMessage*)req_base;
thrift_binary_head_t head = req->head;
......@@ -556,7 +556,7 @@ void SerializeThriftBinaryRequest(butil::IOBuf* request_buf, Controller* cntl,
xfer += out_portocol->writeFieldBegin("request", ::apache::thrift::protocol::T_STRUCT, 1);
// request's write
ThriftBinaryMessage* r = const_cast<ThriftBinaryMessage*>(req);
ThriftFramedMessage* r = const_cast<ThriftFramedMessage*>(req);
xfer += r->write(out_portocol.get());
// end request's write
......@@ -583,7 +583,7 @@ void SerializeThriftBinaryRequest(butil::IOBuf* request_buf, Controller* cntl,
}
void PackThriftBinaryRequest(
void PackThriftFramedRequest(
butil::IOBuf* packet_buf,
SocketMessage**,
uint64_t correlation_id,
......
......@@ -24,18 +24,18 @@ namespace brpc {
namespace policy {
// Parse binary protocol format of thrift framed
ParseResult ParseThriftBinaryMessage(butil::IOBuf* source, Socket* socket, bool read_eof, const void *arg);
ParseResult ParseThriftFramedMessage(butil::IOBuf* source, Socket* socket, bool read_eof, const void *arg);
// Actions to a (client) request in thrift binary framed format
void ProcessThriftBinaryRequest(InputMessageBase* msg);
void ProcessThriftFramedRequest(InputMessageBase* msg);
// Actions to a (server) response in thrift binary framed format
void ProcessThriftBinaryResponse(InputMessageBase* msg);
void ProcessThriftFramedResponse(InputMessageBase* msg);
void SerializeThriftBinaryRequest(butil::IOBuf* request_buf, Controller* controller,
void SerializeThriftFramedRequest(butil::IOBuf* request_buf, Controller* controller,
const google::protobuf::Message* request);
void PackThriftBinaryRequest(
void PackThriftFramedRequest(
butil::IOBuf* packet_buf,
SocketMessage**,
uint64_t correlation_id,
......@@ -45,7 +45,7 @@ void PackThriftBinaryRequest(
const Authenticator*);
// Verify authentication information in thrift binary format
bool VerifyThriftBinaryRequest(const InputMessageBase *msg);
bool VerifyThriftFramedRequest(const InputMessageBase *msg);
} // namespace policy
} // namespace brpc
......
......@@ -31,7 +31,7 @@
namespace brpc {
namespace {
const ::google::protobuf::Descriptor* ThriftBinaryMessage_descriptor_ = NULL;
const ::google::protobuf::Descriptor* ThriftFramedMessage_descriptor_ = NULL;
} // namespace
......@@ -41,7 +41,7 @@ void protobuf_AssignDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto() {
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"baidu/rpc/thrift_binary_message.proto");
GOOGLE_CHECK(file != NULL);
ThriftBinaryMessage_descriptor_ = file->message_type(0);
ThriftFramedMessage_descriptor_ = file->message_type(0);
}
namespace {
......@@ -55,13 +55,13 @@ inline void protobuf_AssignDescriptorsOnce() {
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
ThriftBinaryMessage_descriptor_, &ThriftBinaryMessage::default_instance());
ThriftFramedMessage_descriptor_, &ThriftFramedMessage::default_instance());
}
} // namespace
void protobuf_ShutdownFile_baidu_2frpc_2fthrift_binary_5fmessage_2eproto() {
delete ThriftBinaryMessage::default_instance_;
delete ThriftFramedMessage::default_instance_;
}
void protobuf_AddDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto_impl() {
......@@ -77,8 +77,8 @@ void protobuf_AddDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto_impl() {
"hriftBinaryMessage", 58);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"thrift_binary_message.proto", &protobuf_RegisterTypes);
ThriftBinaryMessage::default_instance_ = new ThriftBinaryMessage();
ThriftBinaryMessage::default_instance_->InitAsDefaultInstance();
ThriftFramedMessage::default_instance_ = new ThriftFramedMessage();
ThriftFramedMessage::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_baidu_2frpc_2fthrift_binary_5fmessage_2eproto);
}
......@@ -103,59 +103,59 @@ struct StaticDescriptorInitializer_baidu_2frpc_2fthrift_binary_5fmessage_2eproto
#ifndef _MSC_VER
#endif // !_MSC_VER
ThriftBinaryMessage::ThriftBinaryMessage()
ThriftFramedMessage::ThriftFramedMessage()
: ::google::protobuf::Message() {
SharedCtor();
}
void ThriftBinaryMessage::InitAsDefaultInstance() {
void ThriftFramedMessage::InitAsDefaultInstance() {
}
ThriftBinaryMessage::ThriftBinaryMessage(const ThriftBinaryMessage& from)
ThriftFramedMessage::ThriftFramedMessage(const ThriftFramedMessage& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void ThriftBinaryMessage::SharedCtor() {
void ThriftFramedMessage::SharedCtor() {
memset(&head, 0, sizeof(head));
}
ThriftBinaryMessage::~ThriftBinaryMessage() {
ThriftFramedMessage::~ThriftFramedMessage() {
SharedDtor();
if (thrift_raw_instance && thrift_raw_instance_deleter) {
thrift_raw_instance_deleter(thrift_raw_instance);
}
}
void ThriftBinaryMessage::SharedDtor() {
void ThriftFramedMessage::SharedDtor() {
if (this != default_instance_) {
}
}
const ::google::protobuf::Descriptor* ThriftBinaryMessage::descriptor() {
const ::google::protobuf::Descriptor* ThriftFramedMessage::descriptor() {
protobuf_AssignDescriptorsOnce();
return ThriftBinaryMessage_descriptor_;
return ThriftFramedMessage_descriptor_;
}
const ThriftBinaryMessage& ThriftBinaryMessage::default_instance() {
const ThriftFramedMessage& ThriftFramedMessage::default_instance() {
if (default_instance_ == NULL)
protobuf_AddDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto();
return *default_instance_;
}
ThriftBinaryMessage* ThriftBinaryMessage::default_instance_ = NULL;
ThriftFramedMessage* ThriftFramedMessage::default_instance_ = NULL;
ThriftBinaryMessage* ThriftBinaryMessage::New() const {
return new ThriftBinaryMessage;
ThriftFramedMessage* ThriftFramedMessage::New() const {
return new ThriftFramedMessage;
}
void ThriftBinaryMessage::Clear() {
void ThriftFramedMessage::Clear() {
memset(&head, 0, sizeof(head));
body.clear();
}
bool ThriftBinaryMessage::MergePartialFromCodedStream(
bool ThriftFramedMessage::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
......@@ -169,55 +169,55 @@ bool ThriftBinaryMessage::MergePartialFromCodedStream(
#undef DO_
}
void ThriftBinaryMessage::SerializeWithCachedSizes(
void ThriftFramedMessage::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream*) const {
}
::google::protobuf::uint8* ThriftBinaryMessage::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* ThriftFramedMessage::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
return target;
}
int ThriftBinaryMessage::ByteSize() const {
int ThriftFramedMessage::ByteSize() const {
return sizeof(thrift_binary_head_t) + body.size();
}
void ThriftBinaryMessage::MergeFrom(const ::google::protobuf::Message& from) {
void ThriftFramedMessage::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const ThriftBinaryMessage* source =
::google::protobuf::internal::dynamic_cast_if_available<const ThriftBinaryMessage*>(
const ThriftFramedMessage* source =
::google::protobuf::internal::dynamic_cast_if_available<const ThriftFramedMessage*>(
&from);
if (source == NULL) {
LOG(ERROR) << "Can only merge from ThriftBinaryMessage";
LOG(ERROR) << "Can only merge from ThriftFramedMessage";
return;
} else {
MergeFrom(*source);
}
}
void ThriftBinaryMessage::MergeFrom(const ThriftBinaryMessage& from) {
void ThriftFramedMessage::MergeFrom(const ThriftFramedMessage& from) {
GOOGLE_CHECK_NE(&from, this);
head = from.head;
body = from.body;
}
void ThriftBinaryMessage::CopyFrom(const ::google::protobuf::Message& from) {
void ThriftFramedMessage::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void ThriftBinaryMessage::CopyFrom(const ThriftBinaryMessage& from) {
void ThriftFramedMessage::CopyFrom(const ThriftFramedMessage& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool ThriftBinaryMessage::IsInitialized() const {
bool ThriftFramedMessage::IsInitialized() const {
return true;
}
void ThriftBinaryMessage::Swap(ThriftBinaryMessage* other) {
void ThriftFramedMessage::Swap(ThriftFramedMessage* other) {
if (other != this) {
const thrift_binary_head_t tmp = other->head;
other->head = head;
......@@ -226,10 +226,10 @@ void ThriftBinaryMessage::Swap(ThriftBinaryMessage* other) {
}
}
::google::protobuf::Metadata ThriftBinaryMessage::GetMetadata() const {
::google::protobuf::Metadata ThriftFramedMessage::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = ThriftBinaryMessage_descriptor_;
metadata.descriptor = ThriftFramedMessage_descriptor_;
metadata.reflection = NULL;
return metadata;
}
......
......@@ -20,6 +20,8 @@
#include <functional>
#include <string>
#include <boost/make_shared.hpp>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/repeated_field.h>
......@@ -53,7 +55,7 @@ void protobuf_AssignDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto();
void protobuf_ShutdownFile_baidu_2frpc_2fthrift_binary_5fmessage_2eproto();
// Representing a thrift_binary request or response.
class ThriftBinaryMessage : public ::google::protobuf::Message {
class ThriftFramedMessage : public ::google::protobuf::Message {
public:
thrift_binary_head_t head;
butil::IOBuf body;
......@@ -62,28 +64,28 @@ public:
void* thrift_raw_instance;
public:
ThriftBinaryMessage();
virtual ~ThriftBinaryMessage();
ThriftFramedMessage();
virtual ~ThriftFramedMessage();
ThriftBinaryMessage(const ThriftBinaryMessage& from);
ThriftFramedMessage(const ThriftFramedMessage& from);
inline ThriftBinaryMessage& operator=(const ThriftBinaryMessage& from) {
inline ThriftFramedMessage& operator=(const ThriftFramedMessage& from) {
CopyFrom(from);
return *this;
}
static const ::google::protobuf::Descriptor* descriptor();
static const ThriftBinaryMessage& default_instance();
static const ThriftFramedMessage& default_instance();
void Swap(ThriftBinaryMessage* other);
void Swap(ThriftFramedMessage* other);
// implements Message ----------------------------------------------
ThriftBinaryMessage* New() const;
ThriftFramedMessage* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const ThriftBinaryMessage& from);
void MergeFrom(const ThriftBinaryMessage& from);
void CopyFrom(const ThriftFramedMessage& from);
void MergeFrom(const ThriftFramedMessage& from);
void Clear();
bool IsInitialized() const;
......@@ -188,11 +190,11 @@ friend void protobuf_AssignDesc_baidu_2frpc_2fthrift_binary_5fmessage_2eproto();
friend void protobuf_ShutdownFile_baidu_2frpc_2fthrift_binary_5fmessage_2eproto();
void InitAsDefaultInstance();
static ThriftBinaryMessage* default_instance_;
static ThriftFramedMessage* default_instance_;
};
template <typename T>
class ThriftMessage : public ThriftBinaryMessage {
class ThriftMessage : public ThriftFramedMessage {
public:
ThriftMessage() {
......
......@@ -18,7 +18,7 @@
#define BRPC_THRIFT_SERVICE_H
#include "brpc/controller.h" // Controller
#include "brpc/thrift_binary_message.h" // ThriftBinaryMessage
#include "brpc/thrift_binary_message.h" // ThriftFramedMessage
#include "brpc/describable.h"
......@@ -29,7 +29,7 @@ class Server;
class MethodStatus;
class StatusService;
namespace policy {
void ProcessThriftBinaryRequest(InputMessageBase* msg_base);
void ProcessThriftFramedRequest(InputMessageBase* msg_base);
}
// The continuation of request processing. Namely send response back to client.
......@@ -56,7 +56,7 @@ public:
void DoNotRespond();
private:
friend void policy::ProcessThriftBinaryRequest(InputMessageBase* msg_base);
friend void policy::ProcessThriftFramedRequest(InputMessageBase* msg_base);
friend class DeleteThriftFramedClosure;
// Only callable by Run().
~ThriftFramedClosure();
......@@ -64,8 +64,8 @@ friend class DeleteThriftFramedClosure;
Socket* _socket_ptr;
const Server* _server;
int64_t _start_parse_us;
ThriftBinaryMessage _request;
ThriftBinaryMessage _response;
ThriftFramedMessage _request;
ThriftFramedMessage _response;
bool _do_respond;
void* _additional_space;
Controller _controller;
......@@ -98,10 +98,10 @@ public:
// request The thrift_binary request received.
// response The thrift_binary response that you should fill in.
// done You must call done->Run() to end the processing.
virtual void ProcessThriftBinaryRequest(const Server& server,
virtual void ProcessThriftFramedRequest(const Server& server,
Controller* controller,
const ThriftBinaryMessage& request,
ThriftBinaryMessage* response,
const ThriftFramedMessage& request,
ThriftFramedMessage* response,
ThriftFramedClosure* done) = 0;
// Put descriptions into the stream.
......@@ -110,14 +110,14 @@ public:
private:
DISALLOW_COPY_AND_ASSIGN(ThriftFramedService);
friend class ThriftFramedClosure;
friend void policy::ProcessThriftBinaryRequest(InputMessageBase* msg_base);
friend void policy::ProcessThriftFramedRequest(InputMessageBase* msg_base);
friend class StatusService;
friend class Server;
private:
void Expose(const butil::StringPiece& prefix);
// Tracking status of non ThriftBinaryPbService
// Tracking status of non ThriftFramedPbService
MethodStatus* _status;
size_t _additional_space;
std::string _cached_name;
......
......@@ -28,8 +28,8 @@
namespace brpc {
bool brpc_thrift_server_helper(const brpc::ThriftBinaryMessage& request,
brpc::ThriftBinaryMessage* response,
bool brpc_thrift_server_helper(const brpc::ThriftFramedMessage& request,
brpc::ThriftFramedMessage* response,
boost::shared_ptr<::apache::thrift::TDispatchProcessor> processor) {
auto in_buffer =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment