Commit fa311e61 authored by gejun's avatar gejun

remove deprecated fields

parent c5710867
...@@ -717,8 +717,4 @@ void ParallelChannel::Describe( ...@@ -717,8 +717,4 @@ void ParallelChannel::Describe(
os << "]"; os << "]";
} }
// Avoid linking errors in ccover g++.
const ResponseMerger::Result ResponseMerger::IGNORED;
const ResponseMerger::Result ResponseMerger::CALL_FAILED;
} // namespace brpc } // namespace brpc
...@@ -124,9 +124,6 @@ public: ...@@ -124,9 +124,6 @@ public:
// make the call to ParallelChannel fail. // make the call to ParallelChannel fail.
FAIL_ALL FAIL_ALL
}; };
// [Deprecated]
static const Result IGNORED = FAIL; // Use FAIL instead.
static const Result CALL_FAILED = FAIL_ALL; // Use FAIL_ALL instead.
ResponseMerger() { } ResponseMerger() { }
virtual Result Merge(google::protobuf::Message* response, virtual Result Merge(google::protobuf::Message* response,
......
...@@ -167,10 +167,6 @@ const ConnectionType CONNECTION_TYPE_ALL = ...@@ -167,10 +167,6 @@ const ConnectionType CONNECTION_TYPE_ALL =
(int)CONNECTION_TYPE_POOLED | (int)CONNECTION_TYPE_POOLED |
(int)CONNECTION_TYPE_SHORT); (int)CONNECTION_TYPE_SHORT);
// DEPRECATED: old names.
const ProtocolType PROTOCOL_BAIDU_RPC = PROTOCOL_BAIDU_STD;
const ProtocolType PROTOCOL_MEMCACHE_BINARY = PROTOCOL_MEMCACHE;
// [thread-safe] // [thread-safe]
// Register `protocol' using key=`type'. // Register `protocol' using key=`type'.
// Returns 0 on success, -1 otherwise // Returns 0 on success, -1 otherwise
......
...@@ -81,7 +81,6 @@ int Stream::Create(const StreamOptions &options, ...@@ -81,7 +81,6 @@ int Stream::Create(const StreamOptions &options,
return -1; return -1;
} }
bthread::ExecutionQueueOptions q_opt; bthread::ExecutionQueueOptions q_opt;
q_opt.max_tasks_size = options.messages_in_batch;
q_opt.bthread_attr q_opt.bthread_attr
= FLAGS_usercode_in_pthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL; = FLAGS_usercode_in_pthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL;
if (bthread::execution_queue_start(&s->_consumer_queue, &q_opt, Consume, s) != 0) { if (bthread::execution_queue_start(&s->_consumer_queue, &q_opt, Consume, s) != 0) {
......
...@@ -133,11 +133,6 @@ struct ExecutionQueueOptions { ...@@ -133,11 +133,6 @@ struct ExecutionQueueOptions {
// Attribute of the bthread which execute runs on // Attribute of the bthread which execute runs on
// default: BTHREAD_ATTR_NORMAL // default: BTHREAD_ATTR_NORMAL
bthread_attr_t bthread_attr; bthread_attr_t bthread_attr;
// DEPRECATED!!!
// max size of tasks passed to execute
// default: 1
size_t max_tasks_size;
}; };
// Start a ExecutionQueue. If |options| is NULL, the queue will be created with // Start a ExecutionQueue. If |options| is NULL, the queue will be created with
......
...@@ -318,7 +318,6 @@ public: ...@@ -318,7 +318,6 @@ public:
inline ExecutionQueueOptions::ExecutionQueueOptions() inline ExecutionQueueOptions::ExecutionQueueOptions()
: bthread_attr(BTHREAD_ATTR_NORMAL) : bthread_attr(BTHREAD_ATTR_NORMAL)
, max_tasks_size(1)
{} {}
template <typename T> template <typename T>
......
...@@ -59,9 +59,6 @@ public: ...@@ -59,9 +59,6 @@ public:
static const size_t MAX_PAYLOAD = MAX_BLOCK_SIZE - 16/*impl dependent*/; static const size_t MAX_PAYLOAD = MAX_BLOCK_SIZE - 16/*impl dependent*/;
static const size_t INITIAL_CAP = 32; // must be power of 2 static const size_t INITIAL_CAP = 32; // must be power of 2
// [Deprecated] be here only because older base-rpc still uses it.
static const size_t BLOCK_SIZE = DEFAULT_BLOCK_SIZE;
struct Block; struct Block;
// can't directly use `struct iovec' here because we also need to access the // can't directly use `struct iovec' here because we also need to access the
...@@ -271,24 +268,18 @@ public: ...@@ -271,24 +268,18 @@ public:
// Copy min(n, length()) bytes starting from `pos' at front side into `buf'. // Copy min(n, length()) bytes starting from `pos' at front side into `buf'.
// Returns bytes copied. // Returns bytes copied.
size_t copy_to(void* buf, size_t n = (size_t)-1L, size_t pos = 0) const; size_t copy_to(void* buf, size_t n = (size_t)-1L, size_t pos = 0) const;
BAIDU_DEPRECATED size_t copy(void* buf, size_t n = (size_t)-1L) const
{ return copy_to(buf, n, 0); }
// NOTE: first parameter is not std::string& because user may passes // NOTE: first parameter is not std::string& because user may passes
// a pointer of std::string by mistake, in which case, compiler would // a pointer of std::string by mistake, in which case, compiler would
// call the void* version which crashes definitely. // call the void* version which crashes definitely.
size_t copy_to(std::string* s, size_t n = (size_t)-1L, size_t pos = 0) const; size_t copy_to(std::string* s, size_t n = (size_t)-1L, size_t pos = 0) const;
size_t append_to(std::string* s, size_t n = (size_t)-1L, size_t pos = 0) const; size_t append_to(std::string* s, size_t n = (size_t)-1L, size_t pos = 0) const;
BAIDU_DEPRECATED size_t copy(std::string* s, size_t n = (size_t)-1L) const
{ return copy_to(s, n, 0); }
// Copy min(n, length()) bytes staring from `pos' at front side into // Copy min(n, length()) bytes staring from `pos' at front side into
// `cstr' and end it with '\0'. // `cstr' and end it with '\0'.
// `cstr' must be as long as min(n, length())+1. // `cstr' must be as long as min(n, length())+1.
// Returns bytes copied (not including ending '\0') // Returns bytes copied (not including ending '\0')
size_t copy_to_cstr(char* cstr, size_t n = (size_t)-1L, size_t pos = 0) const; size_t copy_to_cstr(char* cstr, size_t n = (size_t)-1L, size_t pos = 0) const;
BAIDU_DEPRECATED size_t copy_cstr(char* s, size_t n = (size_t)-1L) const
{ return copy_to_cstr(s, n, 0); }
// Convert all data in this buffer to a std::string. // Convert all data in this buffer to a std::string.
std::string to_string() const; std::string to_string() const;
......
...@@ -48,7 +48,6 @@ TEST_F(ExecutionQueueTest, single_thread) { ...@@ -48,7 +48,6 @@ TEST_F(ExecutionQueueTest, single_thread) {
stopped = false; stopped = false;
bthread::ExecutionQueueId<LongIntTask> queue_id; bthread::ExecutionQueueId<LongIntTask> queue_id;
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 10000;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
add, &result)); add, &result));
for (int i = 0; i < 100; ++i) { for (int i = 0; i < 100; ++i) {
...@@ -127,7 +126,6 @@ TEST_F(ExecutionQueueTest, performance) { ...@@ -127,7 +126,6 @@ TEST_F(ExecutionQueueTest, performance) {
pthread_t threads[8]; pthread_t threads[8];
bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 100;
int64_t result = 0; int64_t result = 0;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
add, &result)); add, &result));
...@@ -224,7 +222,6 @@ TEST_F(ExecutionQueueTest, execute_urgent) { ...@@ -224,7 +222,6 @@ TEST_F(ExecutionQueueTest, execute_urgent) {
pthread_t threads[10]; pthread_t threads[10];
bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 10240;
int64_t result = 0; int64_t result = 0;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
add_with_suspend, &result)); add_with_suspend, &result));
...@@ -267,7 +264,6 @@ TEST_F(ExecutionQueueTest, urgent_task_is_the_last_task) { ...@@ -267,7 +264,6 @@ TEST_F(ExecutionQueueTest, urgent_task_is_the_last_task) {
g_suspending = false; g_suspending = false;
bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 10240;
int64_t result = 0; int64_t result = 0;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
add_with_suspend, &result)); add_with_suspend, &result));
...@@ -325,7 +321,6 @@ TEST_F(ExecutionQueueTest, multi_threaded_order) { ...@@ -325,7 +321,6 @@ TEST_F(ExecutionQueueTest, multi_threaded_order) {
long disorder_times = 0; long disorder_times = 0;
bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 1024;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
check_order, &disorder_times)); check_order, &disorder_times));
pthread_t threads[12]; pthread_t threads[12];
...@@ -353,7 +348,6 @@ TEST_F(ExecutionQueueTest, in_place_task) { ...@@ -353,7 +348,6 @@ TEST_F(ExecutionQueueTest, in_place_task) {
pthread_t thread_id = pthread_self(); pthread_t thread_id = pthread_self();
bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 1024;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
check_running_thread, check_running_thread,
(void*)thread_id)); (void*)thread_id));
...@@ -404,7 +398,6 @@ int stuck_and_check_running_thread(void* arg, bthread::TaskIterator<InPlaceTask> ...@@ -404,7 +398,6 @@ int stuck_and_check_running_thread(void* arg, bthread::TaskIterator<InPlaceTask>
TEST_F(ExecutionQueueTest, should_start_new_thread_on_more_tasks) { TEST_F(ExecutionQueueTest, should_start_new_thread_on_more_tasks) {
bthread::ExecutionQueueId<InPlaceTask> queue_id = { 0 }; bthread::ExecutionQueueId<InPlaceTask> queue_id = { 0 };
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 1;
butil::atomic<int> futex(0); butil::atomic<int> futex(0);
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
stuck_and_check_running_thread, stuck_and_check_running_thread,
...@@ -443,7 +436,6 @@ TEST_F(ExecutionQueueTest, inplace_and_order) { ...@@ -443,7 +436,6 @@ TEST_F(ExecutionQueueTest, inplace_and_order) {
long disorder_times = 0; long disorder_times = 0;
bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns bthread::ExecutionQueueId<LongIntTask> queue_id = { 0 }; // to supress warns
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 1024;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
check_order, &disorder_times)); check_order, &disorder_times));
pthread_t threads[12]; pthread_t threads[12];
...@@ -638,7 +630,6 @@ TEST_F(ExecutionQueueTest, not_do_iterate_at_all) { ...@@ -638,7 +630,6 @@ TEST_F(ExecutionQueueTest, not_do_iterate_at_all) {
int64_t expected_result = 0; int64_t expected_result = 0;
bthread::ExecutionQueueId<LongIntTask> queue_id; bthread::ExecutionQueueId<LongIntTask> queue_id;
bthread::ExecutionQueueOptions options; bthread::ExecutionQueueOptions options;
options.max_tasks_size = 100;
ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options, ASSERT_EQ(0, bthread::execution_queue_start(&queue_id, &options,
add2, &result)); add2, &result));
for (int i = 0; i < 100; ++i) { for (int i = 0; i < 100; ++i) {
......
...@@ -504,7 +504,7 @@ TEST_F(IOBufTest, iobuf_sanity) { ...@@ -504,7 +504,7 @@ TEST_F(IOBufTest, iobuf_sanity) {
TEST_F(IOBufTest, copy_and_assign) { TEST_F(IOBufTest, copy_and_assign) {
install_debug_allocator(); install_debug_allocator();
const size_t TARGET_SIZE = butil::IOBuf::BLOCK_SIZE * 2; const size_t TARGET_SIZE = butil::IOBuf::DEFAULT_BLOCK_SIZE * 2;
butil::IOBuf buf0; butil::IOBuf buf0;
buf0.append("hello"); buf0.append("hello");
ASSERT_EQ(1u, buf0._ref_num()); ASSERT_EQ(1u, buf0._ref_num());
......
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