Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
fa311e61
Commit
fa311e61
authored
Oct 16, 2017
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove deprecated fields
parent
c5710867
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1 addition
and
37 deletions
+1
-37
parallel_channel.cpp
src/brpc/parallel_channel.cpp
+0
-4
parallel_channel.h
src/brpc/parallel_channel.h
+0
-3
protocol.h
src/brpc/protocol.h
+0
-4
stream.cpp
src/brpc/stream.cpp
+0
-1
execution_queue.h
src/bthread/execution_queue.h
+0
-5
execution_queue_inl.h
src/bthread/execution_queue_inl.h
+0
-1
iobuf.h
src/butil/iobuf.h
+0
-9
bthread_execution_queue_unittest.cpp
test/bthread_execution_queue_unittest.cpp
+0
-9
iobuf_unittest.cpp
test/iobuf_unittest.cpp
+1
-1
No files found.
src/brpc/parallel_channel.cpp
View file @
fa311e61
...
...
@@ -717,8 +717,4 @@ void ParallelChannel::Describe(
os
<<
"]"
;
}
// Avoid linking errors in ccover g++.
const
ResponseMerger
::
Result
ResponseMerger
::
IGNORED
;
const
ResponseMerger
::
Result
ResponseMerger
::
CALL_FAILED
;
}
// namespace brpc
src/brpc/parallel_channel.h
View file @
fa311e61
...
...
@@ -124,9 +124,6 @@ public:
// make the call to ParallelChannel fail.
FAIL_ALL
};
// [Deprecated]
static
const
Result
IGNORED
=
FAIL
;
// Use FAIL instead.
static
const
Result
CALL_FAILED
=
FAIL_ALL
;
// Use FAIL_ALL instead.
ResponseMerger
()
{
}
virtual
Result
Merge
(
google
::
protobuf
::
Message
*
response
,
...
...
src/brpc/protocol.h
View file @
fa311e61
...
...
@@ -167,10 +167,6 @@ const ConnectionType CONNECTION_TYPE_ALL =
(
int
)
CONNECTION_TYPE_POOLED
|
(
int
)
CONNECTION_TYPE_SHORT
);
// DEPRECATED: old names.
const
ProtocolType
PROTOCOL_BAIDU_RPC
=
PROTOCOL_BAIDU_STD
;
const
ProtocolType
PROTOCOL_MEMCACHE_BINARY
=
PROTOCOL_MEMCACHE
;
// [thread-safe]
// Register `protocol' using key=`type'.
// Returns 0 on success, -1 otherwise
...
...
src/brpc/stream.cpp
View file @
fa311e61
...
...
@@ -81,7 +81,6 @@ int Stream::Create(const StreamOptions &options,
return
-
1
;
}
bthread
::
ExecutionQueueOptions
q_opt
;
q_opt
.
max_tasks_size
=
options
.
messages_in_batch
;
q_opt
.
bthread_attr
=
FLAGS_usercode_in_pthread
?
BTHREAD_ATTR_PTHREAD
:
BTHREAD_ATTR_NORMAL
;
if
(
bthread
::
execution_queue_start
(
&
s
->
_consumer_queue
,
&
q_opt
,
Consume
,
s
)
!=
0
)
{
...
...
src/bthread/execution_queue.h
View file @
fa311e61
...
...
@@ -133,11 +133,6 @@ struct ExecutionQueueOptions {
// Attribute of the bthread which execute runs on
// default: BTHREAD_ATTR_NORMAL
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
...
...
src/bthread/execution_queue_inl.h
View file @
fa311e61
...
...
@@ -318,7 +318,6 @@ public:
inline
ExecutionQueueOptions
::
ExecutionQueueOptions
()
:
bthread_attr
(
BTHREAD_ATTR_NORMAL
)
,
max_tasks_size
(
1
)
{}
template
<
typename
T
>
...
...
src/butil/iobuf.h
View file @
fa311e61
...
...
@@ -59,9 +59,6 @@ public:
static
const
size_t
MAX_PAYLOAD
=
MAX_BLOCK_SIZE
-
16
/*impl dependent*/
;
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
;
// can't directly use `struct iovec' here because we also need to access the
...
...
@@ -271,24 +268,18 @@ public:
// Copy min(n, length()) bytes starting from `pos' at front side into `buf'.
// Returns bytes copied.
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
// a pointer of std::string by mistake, in which case, compiler would
// 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
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
// `cstr' and end it with '\0'.
// `cstr' must be as long as min(n, length())+1.
// 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
;
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.
std
::
string
to_string
()
const
;
...
...
test/bthread_execution_queue_unittest.cpp
View file @
fa311e61
...
...
@@ -48,7 +48,6 @@ TEST_F(ExecutionQueueTest, single_thread) {
stopped
=
false
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
;
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
10000
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
add
,
&
result
));
for
(
int
i
=
0
;
i
<
100
;
++
i
)
{
...
...
@@ -127,7 +126,6 @@ TEST_F(ExecutionQueueTest, performance) {
pthread_t
threads
[
8
];
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to supress warns
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
100
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
add
,
&
result
));
...
...
@@ -224,7 +222,6 @@ TEST_F(ExecutionQueueTest, execute_urgent) {
pthread_t
threads
[
10
];
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to supress warns
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
10240
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
add_with_suspend
,
&
result
));
...
...
@@ -267,7 +264,6 @@ TEST_F(ExecutionQueueTest, urgent_task_is_the_last_task) {
g_suspending
=
false
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to supress warns
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
10240
;
int64_t
result
=
0
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
add_with_suspend
,
&
result
));
...
...
@@ -325,7 +321,6 @@ TEST_F(ExecutionQueueTest, multi_threaded_order) {
long
disorder_times
=
0
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to supress warns
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
1024
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
check_order
,
&
disorder_times
));
pthread_t
threads
[
12
];
...
...
@@ -353,7 +348,6 @@ TEST_F(ExecutionQueueTest, in_place_task) {
pthread_t
thread_id
=
pthread_self
();
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to supress warns
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
1024
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
check_running_thread
,
(
void
*
)
thread_id
));
...
...
@@ -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
)
{
bthread
::
ExecutionQueueId
<
InPlaceTask
>
queue_id
=
{
0
};
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
1
;
butil
::
atomic
<
int
>
futex
(
0
);
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
stuck_and_check_running_thread
,
...
...
@@ -443,7 +436,6 @@ TEST_F(ExecutionQueueTest, inplace_and_order) {
long
disorder_times
=
0
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
=
{
0
};
// to supress warns
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
1024
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
check_order
,
&
disorder_times
));
pthread_t
threads
[
12
];
...
...
@@ -638,7 +630,6 @@ TEST_F(ExecutionQueueTest, not_do_iterate_at_all) {
int64_t
expected_result
=
0
;
bthread
::
ExecutionQueueId
<
LongIntTask
>
queue_id
;
bthread
::
ExecutionQueueOptions
options
;
options
.
max_tasks_size
=
100
;
ASSERT_EQ
(
0
,
bthread
::
execution_queue_start
(
&
queue_id
,
&
options
,
add2
,
&
result
));
for
(
int
i
=
0
;
i
<
100
;
++
i
)
{
...
...
test/iobuf_unittest.cpp
View file @
fa311e61
...
...
@@ -504,7 +504,7 @@ TEST_F(IOBufTest, iobuf_sanity) {
TEST_F
(
IOBufTest
,
copy_and_assign
)
{
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
;
buf0
.
append
(
"hello"
);
ASSERT_EQ
(
1u
,
buf0
.
_ref_num
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment