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

Grpc Support #383

Closed
wants to merge 24 commits into from
Closed

Grpc Support #383

wants to merge 24 commits into from

Conversation

NeGnail
Copy link
Contributor

@NeGnail NeGnail commented Dec 1, 2018

Motivation:

Support GRPC.

Modification:

Provides the GRPC bootstrap(consumer/provider), server, client transport and other abstractions
Add proxy for GRPC base class.
The stub for GRPC is abstracted mainly at the Transport layer.
update sofa-tracer version to 2.1.2.
update guava version to 20.0.

Result:

Trace back to the #57
Docking of the main modes of use. Set up the basic architecture for GRPC's more complete extension in sofarpc.
Next we can support tracer and client-side streaming calls.

# Conflicts:
#	extension-impl/tracer-opentracing/src/test/java/com/alipay/sofa/rpc/tracer/sofatracer/base/AbstractTracerBase.java
#	test/test-integration/src/test/java/com/alipay/sofa/rpc/server/rest/RestTracerTest.java
@khotyn
Copy link
Member

khotyn commented Dec 2, 2018

文档的 PR 也请同步提交哈。 @NeGnail

@NeGnail
Copy link
Contributor Author

NeGnail commented Dec 2, 2018

恩呐,文档也会提的。

@NeGnail
Copy link
Contributor Author

NeGnail commented Dec 2, 2018

GRPC需要jdk7以上版本。 这里CI跑jdk6所以挂了。

@leizhiyuan
Copy link
Contributor

#384

@NeGnail
Copy link
Contributor Author

NeGnail commented Dec 2, 2018

ok。那这个版本开始就可以去掉6的ci了。

@leizhiyuan
Copy link
Contributor

恩,等下周5.4.8 发布后,有了 jdk8的分支,这个再合并。

@leizhiyuan leizhiyuan added the jdk8 only available in jdk8 label Dec 3, 2018
@leizhiyuan leizhiyuan mentioned this pull request Dec 3, 2018
@codecov
Copy link

codecov bot commented Dec 15, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@2536ae0). Click here to learn what that means.
The diff coverage is 71%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #383   +/-   ##
=========================================
  Coverage          ?   71.19%           
  Complexity        ?     1150           
=========================================
  Files             ?      375           
  Lines             ?    15674           
  Branches          ?     2517           
=========================================
  Hits              ?    11159           
  Misses            ?     3174           
  Partials          ?     1341
Impacted Files Coverage Δ Complexity Δ
...n/java/com/alipay/sofa/rpc/proxy/jdk/JDKProxy.java 72.72% <0%> (ø) 0 <0> (?)
...ofa/rpc/bootstrap/grpc/GrpcClientProxyInvoker.java 100% <100%> (ø) 2 <2> (?)
...y/sofa/rpc/bootstrap/DefaultConsumerBootstrap.java 68.64% <100%> (ø) 0 <0> (?)
...sofa/rpc/bootstrap/grpc/GrpcProviderBootstrap.java 38.46% <38.46%> (ø) 2 <2> (?)
...sofa/rpc/bootstrap/grpc/GrpcConsumerBootstrap.java 63.63% <63.63%> (ø) 3 <3> (?)
...va/com/alipay/sofa/rpc/server/grpc/GrpcServer.java 69.35% <69.35%> (ø) 11 <11> (?)
...lipay/sofa/rpc/proxy/javassist/JavassistProxy.java 77.19% <72.72%> (ø) 0 <0> (?)
...y/sofa/rpc/transport/grpc/GrpcClientTransport.java 74.35% <74.35%> (ø) 12 <12> (?)
...pay/sofa/rpc/transport/grpc/GrpcClientInvoker.java 75% <75%> (ø) 4 <4> (?)
...fa/rpc/transport/grpc/GrpcClientTransportUtil.java 80% <80%> (ø) 6 <6> (?)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2536ae0...8f0a0cb. Read the comment docs.

@NeGnail
Copy link
Contributor Author

NeGnail commented Dec 15, 2018

暂时别合。今天我优化一下。

@leizhiyuan
Copy link
Contributor

暂时别合。今天我优化一下。

嗯,只是解决了一下冲突。和hytrix和nocos的代码pom有冲突。

@leizhiyuan leizhiyuan added this to the 6.0.0 milestone Dec 29, 2018
@@ -66,6 +69,41 @@
*/
private static final Map<Class, Class> PROXY_CLASS_MAP = new ConcurrentHashMap<Class, Class>();

public <T> T getProxyForClass(final Class<T> clazz, final Invoker proxyInvoker) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个方法是为了?

@zonghaishang
Copy link
Member

@NeGnail 解决下冲突

try {
// 关闭端口,不关闭线程池
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Stop the http rest server at port {}", serverConfig.getPort());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should change rest to grpc ??

}
server.shutdown();
} catch (Exception e) {
LOGGER.error("Stop the http rest server at port " + serverConfig.getPort() + " error !", e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should change rest to grpc ??

try {
server.start();
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Start the http rest server at port {}", serverConfig.getPort());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should change rest to grpc ??

@zonghaishang zonghaishang modified the milestones: 5.6.0, 6.0.0 Jun 17, 2019
@leizhiyuan leizhiyuan modified the milestones: 6.0.0, some day Jun 17, 2019
@neokidd neokidd mentioned this pull request Jul 11, 2019
@leizhiyuan leizhiyuan closed this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jdk8 only available in jdk8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants