Skip to content
Permalink
Browse files
Merge remote-tracking branch 'upstream/master'
sync with master
  • Loading branch information
cdjgit committed Oct 18, 2018
2 parents 5261158 + ede2bf5 commit c7cbfb372b9961be646305efd24b57ef72116a89
Showing 103 changed files with 2,985 additions and 898 deletions.
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug (描述bug)**
A clear and concise description of what the bug is. 请准确描述bug是什么.

**To Reproduce (复现方法)**
Please describe the steps to reproduce the behavior. 请描述复现问题的步骤.

**Expected behavior (期望行为)**
A clear and concise description of what you expected to happen. 请准确描述你期望发生什么.

**Versions (各种版本)**
OS:
Compiler:
brpc:
protobuf:

**Additional context (更多上下文)**
Add any other context or screenshots here. 这里添加更多上下文或截图.
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
A clear and concise description of what the problem is. 请清晰和准确地描述那个问题是什么.

**Describe the solution you'd like (描述你期望的解决方法)**
A clear and concise description of what you want to happen. 请清晰和准确地描述你期望发生什么.

**Describe alternatives you've considered (描述你想到的折衷方案)**
A clear and concise description of any alternative solutions or features you've considered. 请准确描述你想到的其他折衷方案。

**Additional context (更多上下文)**
Add any other context or screenshots here. 这里添加更多上下文或截图.
@@ -12,6 +12,7 @@
*.prof
*.so
*.dylib
*.rej
/output
/test/output

1 BUILD
@@ -216,6 +216,7 @@ BUTIL_SRCS = [
"src/butil/crc32c.cc",
"src/butil/containers/case_ignored_flat_map.cpp",
"src/butil/iobuf.cpp",
"src/butil/binary_printer.cpp",
"src/butil/popen.cpp",
] + select({
":darwin": [
@@ -305,6 +305,7 @@ set(BUTIL_SOURCES
${PROJECT_SOURCE_DIR}/src/butil/crc32c.cc
${PROJECT_SOURCE_DIR}/src/butil/containers/case_ignored_flat_map.cpp
${PROJECT_SOURCE_DIR}/src/butil/iobuf.cpp
${PROJECT_SOURCE_DIR}/src/butil/binary_printer.cpp
${PROJECT_SOURCE_DIR}/src/butil/popen.cpp
)

@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at jge666@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
@@ -0,0 +1,29 @@
If you meet any problem or request a new feature, you're welcome to [create an issue](https://github.com/brpc/brpc/issues/new/choose).

If you can solve any of [the issues](https://github.com/brpc/brpc/issues), you're welcome to send the PR to us.

Before the PR:

* Make sure your code style conforms to [google C++ coding style](https://google.github.io/styleguide/cppguide.html). Indentation is preferred to be 4 spaces.
* The code appears where it should be. For example the code to support an extra protocol should not be put in general classes like server.cpp, channel.cpp, while a general modification would better not be hidden inside a very specific protocol.
* Has unittests.

After the PR:

* Make sure the [travis-ci](https://travis-ci.org/brpc/brpc/pull_requests) passed.

# Chinese version

如果你遇到问题或需要新功能,欢迎[创建issue](https://github.com/brpc/brpc/issues/new/choose)。

如果你可以解决某个[issue](https://github.com/brpc/brpc/issues), 欢迎发送PR。

发送PR前请确认:

* 你的代码符合[google C++代码规范](https://google.github.io/styleguide/cppguide.html)。缩进最好为4个空格。
* 代码出现的位置和其定位相符。比如对于某特定协议的扩展代码不该出现在server.cpp, channel.cpp这些较为通用的类中,而一些非常通用的改动也不该深藏在某个特定协议的cpp中。
* 有对应的单测代码。

提交PR后请确认:

* [travis-ci](https://travis-ci.org/brpc/brpc/pull_requests)成功通过。
@@ -145,6 +145,7 @@ BUTIL_SOURCES = \
src/butil/crc32c.cc \
src/butil/containers/case_ignored_flat_map.cpp \
src/butil/iobuf.cpp \
src/butil/binary_printer.cpp \
src/butil/popen.cpp

ifeq ($(SYSTEM), Linux)
@@ -275,6 +276,14 @@ output/bin:protoc-gen-mcpack
@echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(CXXFLAGS) $< -o $@

%http2_rpc_protocol.dbg.o:%http2_rpc_protocol.cpp
@echo "Compiling $@ with O2"
@$(CXX) -c $(HDRPATHS) -O2 $(DEBUG_CXXFLAGS) $< -o $@

%hpack.dbg.o:%hpack.cpp
@echo "Compiling $@ with O2"
@$(CXX) -c $(HDRPATHS) -O2 $(DEBUG_CXXFLAGS) $< -o $@

%.dbg.o:%.cpp
@echo "Compiling $@"
@$(CXX) -c $(HDRPATHS) $(DEBUG_CXXFLAGS) $< -o $@
@@ -8,14 +8,13 @@ An industrial-grade RPC framework used throughout [Baidu](http://ir.baidu.com/ph

You can use it to:
* Build a server that can talk in multiple protocols (**on same port**), or access all sorts of services
* restful http/https, h2/h2c (compatible with [grpc](https://github.com/grpc/grpc), will be opensourced). using http in brpc is much more friendly than [libcurl](https://curl.haxx.se/libcurl/).
* restful http/https, [h2](https://http2.github.io/http2-spec)/[gRPC](https://grpc.io). using http/h2 in brpc is much more friendly than [libcurl](https://curl.haxx.se/libcurl/). Access protobuf-based protocols with HTTP/h2+json, probably from another language.
* [redis](docs/en/redis_client.md) and [memcached](docs/en/memcache_client.md), thread-safe, more friendly and performant than the official clients.
* [rtmp](https://github.com/brpc/brpc/blob/master/src/brpc/rtmp.h)/[flv](https://en.wikipedia.org/wiki/Flash_Video)/[hls](https://en.wikipedia.org/wiki/HTTP_Live_Streaming), for building [streaming services](https://github.com/brpc/media-server).
* hadoop_rpc (may be opensourced)
* [rdma](https://en.wikipedia.org/wiki/Remote_direct_memory_access) support (will be opensourced)
* [thrift](docs/en/thrift.md) support, thread-safe, more friendly and performant than the official clients.
* all sorts of protocols used in Baidu: [baidu_std](docs/cn/baidu_std.md), [streaming_rpc](docs/en/streaming_rpc.md), hulu_pbrpc, [sofa_pbrpc](https://github.com/baidu/sofa-pbrpc), nova_pbrpc, public_pbrpc, ubrpc and nshead-based ones.
* Access protobuf-based protocols with HTTP+json, probably from another language.
* Build [HA](https://en.wikipedia.org/wiki/High_availability) distributed services using an industrial-grade implementation of [RAFT consensus algorithm](https://raft.github.io) which is opensourced at [braft](https://github.com/brpc/braft)
* Servers can handle requests [synchronously](docs/en/server.md) or [asynchronously](docs/en/server.md#asynchronous-service).
* Clients can access servers [synchronously](docs/en/client.md#synchronus-call), [asynchronously](docs/en/client.md#asynchronous-call), [semi-synchronously](docs/en/client.md#semi-synchronous-call), or use [combo channels](docs/en/combo_channel.md) to simplify sharded or parallel accesses declaratively.
@@ -39,7 +38,8 @@ You can use it to:
* [Basics](docs/en/client.md)
* [Error code](docs/en/error_code.md)
* [Combo channels](docs/en/combo_channel.md)
* [Access HTTP](docs/en/http_client.md)
* [Access http/h2](docs/en/http_client.md)
* [Access gRPC](docs/en/http_derivatives.md#h2grpc)
* [Access thrift](docs/en/thrift.md#client-accesses-thrift-server)
* [Access UB](docs/cn/ub_client.md)
* [Streaming RPC](docs/en/streaming_rpc.md)
@@ -49,7 +49,8 @@ You can use it to:
* [Dummy server](docs/en/dummy_server.md)
* Server
* [Basics](docs/en/server.md)
* [Serve HTTP](docs/en/http_service.md)
* [Serve http/h2](docs/en/http_service.md)
* [Serve gRPC](docs/en/http_derivatives.md#h2grpc)
* [Serve thrift](docs/en/thrift.md#server-processes-thrift-requests)
* [Serve Nshead](docs/cn/nshead_service.md)
* [Debug server issues](docs/cn/server_debugging.md)
@@ -98,18 +99,7 @@ You can use it to:
* [云平台代理服务](docs/cn/case_ubrpc.md)

# Contribute code

**If you can fix any of the issues or add new features, you're welcome to send the PR to us. If the PR is accepted, your contribution will be scored from 0 to 5 points according to the difficulty and quality (higher is better). If you accumulate 10 points, you can contact us for interviewing opportunities or recommendation letter for your future jobs.**

Make sure your code meets following requirements before submitting the PR:

- The code conforms to [google C++ coding style](https://google.github.io/styleguide/cppguide.html) and is indented by 4 spaces.
- The code appears where it should be. For example the code to support an extra protocol should not be put in general classes like server.cpp, channel.cpp, while a general modification would better not be hidden inside a very specific protocol.
- Has unittests.

Check following items after submitting the PR:

- Compilations and unittests in [travis-ci](https://travis-ci.org/brpc/brpc/pull_requests) are passed.
Please refer to [here](CONTRIBUTING.md).

# Feedback
Please report bugs, concerns, suggestions by issues, or join QQ-group 498837325 to discuss problems around source code.
@@ -9,14 +9,13 @@
你可以使用它:

* 搭建能在**一个端口**支持多协议的服务, 或访问各种服务
* restful http/https, h2/h2c (与[grpc](https://github.com/grpc/grpc)兼容, 即将开源). 使用brpc的http实现比[libcurl](https://curl.haxx.se/libcurl/)方便多了。
* restful http/https, [h2](https://http2.github.io/http2-spec)/[gRPC](https://grpc.io)。使用brpc的http实现比[libcurl](https://curl.haxx.se/libcurl/)方便多了。从其他语言通过HTTP/h2+json访问基于protobuf的协议.
* [redis](docs/cn/redis_client.md)和[memcached](docs/cn/memcache_client.md), 线程安全,比官方client更方便。
* [rtmp](https://github.com/brpc/brpc/blob/master/src/brpc/rtmp.h)/[flv](https://en.wikipedia.org/wiki/Flash_Video)/[hls](https://en.wikipedia.org/wiki/HTTP_Live_Streaming), 可用于搭建[流媒体服务](https://github.com/brpc/media-server).
* hadoop_rpc(可能开源)
* 支持[rdma](https://en.wikipedia.org/wiki/Remote_direct_memory_access)(即将开源)
* 支持[thrift](docs/cn/thrift.md) , 线程安全,比官方client更方便
* 各种百度内使用的协议: [baidu_std](docs/cn/baidu_std.md), [streaming_rpc](docs/cn/streaming_rpc.md), hulu_pbrpc, [sofa_pbrpc](https://github.com/baidu/sofa-pbrpc), nova_pbrpc, public_pbrpc, ubrpc和使用nshead的各种协议.
* 从其他语言通过HTTP+json访问基于protobuf的协议.
* 基于工业级的[RAFT算法](https://raft.github.io)实现搭建[高可用](https://en.wikipedia.org/wiki/High_availability)分布式系统,已在[braft](https://github.com/brpc/braft)开源。
* Server能[同步](docs/cn/server.md)或[异步](docs/cn/server.md#异步service)处理请求。
* Client支持[同步](docs/cn/client.md#同步访问)、[异步](docs/cn/client.md#异步访问)、[半同步](docs/cn/client.md#半同步),或使用[组合channels](docs/cn/combo_channel.md)简化复杂的分库或并发访问。
@@ -40,7 +39,8 @@
* [基础功能](docs/cn/client.md)
* [错误码](docs/cn/error_code.md)
* [组合channels](docs/cn/combo_channel.md)
* [访问HTTP](docs/cn/http_client.md)
* [访问http/h2](docs/cn/http_client.md)
* [访问gRPC](docs/cn/http_derivatives.md#h2grpc)
* [访问thrift](docs/cn/thrift.md#client端访问thrift-server)
* [访问UB](docs/cn/ub_client.md)
* [Streaming RPC](docs/cn/streaming_rpc.md)
@@ -50,7 +50,8 @@
* [Dummy server](docs/cn/dummy_server.md)
* Server
* [基础功能](docs/cn/server.md)
* [搭建HTTP服务](docs/cn/http_service.md)
* [搭建http/h2服务](docs/cn/http_service.md)
* [搭建gRPC服务](docs/cn/http_derivatives.md#h2grpc)
* [搭建thrift服务](docs/cn/thrift.md#server端处理thrift请求)
* [搭建Nshead服务](docs/cn/nshead_service.md)
* [高效率排查server卡顿](docs/cn/server_debugging.md)
@@ -100,17 +101,7 @@

# 贡献代码

**如果你可以修复某个issue或增加一个新功能, 欢迎给我们发送PR. 如果对应的PR被接受了, 你的贡献将会根据难度和质量在0-5区间内打分(越高越好). 如果你累计获得了10分, 可以联系我们获得面试机会或为你写推荐信。**

提交PR前请确认你的代码符合如下要求:

* 符合[google C++代码规范](https://google.github.io/styleguide/cppguide.html), 且一次缩进为4个空格。
* 代码出现的位置和其定位相符。比如对于某特定协议的扩展代码不该出现在server.cpp, channel.cpp这些较为通用的类中,而一些非常通用的改动也不该深藏在某个特定协议的cpp中。
* 有对应的单测代码。

提交PR后请检查如下内容:

* [travis-ci](https://travis-ci.org/brpc/brpc/pull_requests)中的编译和单测均已成功。
请参考[这里](CONTRIBUTING.md#chinese-version)。

# 反馈问题

0 comments on commit c7cbfb3

Please sign in to comment.