Commit Graph

575 Commits

Author SHA1 Message Date
zhangkun83 c01af90d18 Polish javadoc for stub/* 2015-02-25 15:20:36 -08:00
Mugur Marculescu 961ecc5a2c Update CONTRIBUTING.md
Fix typos.
2015-02-25 14:47:42 -08:00
Xiao Hang dcff315dc3 Add nano support to Java codegen. Now the user can specify a flag nano=true
to generate naon related code in grpc service interface

Commandline example:
protoc --plugin=protoc-gen-java_rpc=build/binaries/java_pluginExecutable/java_plugin \
  --java_rpc_out=nano=true:"$OUTPUT_FILE" --javanano_out=ignore_services=true:"$OUTPUT_FILE" \
  --proto_path="$DIR_OF_PROTO_FILE" "$PROTO_FILE
2015-02-25 14:38:03 -08:00
Louis Ryan 46dd47f86b Cleanup Javadoc for Channel, ServerCall and their related classes. 2015-02-25 14:22:12 -08:00
Jakob Buchgraber 1961402104 Revert "Have SendGrpcFrameCommand constructor take an AbstractStream object instead of a stream id."
This reverts commit 0d78268b83.

Some unit tests aren't compiling due to this change.
2015-02-25 14:05:57 -08:00
Jakob Buchgraber 7ef1781016 Cleanup and Nitpicking
- Renamed 'eventGroup' property to 'group' as this what's used elsewhere.
- Moved assignment of the channel before the listener is added as currently
  there is a (theoretical) chance that the listener is executed before the assignment
  to channel happens, namely in case the Future is already done when the listener
  is added.
- Removed comment that seemed out of place / relict.
2015-02-25 12:28:25 -08:00
Jakob Buchgraber 0d78268b83 Have SendGrpcFrameCommand constructor take an AbstractStream object instead of a stream id.
As part of the effort to remove all blocking bits from the NettyClientStream with
this commit the SendGrpcFrameCommand now takes a stream object instead of the
stream id. This will be necessary as in a non blocking world the stream id might
not have yet been allocated when the SendGrpcFrameCommand gets instantiated.
2015-02-25 12:20:35 -08:00
Nathan Mittler 1a39f7b248 Merge pull request #128 from jpinner/bump_hpack
Upgrade com.twitter.hpack to v0.10.1
2015-02-25 11:08:21 -08:00
Nathan Mittler 194cad3f60 Merge pull request #127 from nmittler/helloworld
Adding HelloWorld example to grpc-java repo.
2015-02-25 10:58:56 -08:00
nmittler 87daf0e0dc Adding HelloWorld example to grpc-java repo. 2015-02-25 10:56:51 -08:00
Jeff Pinner b1cc7cc09d Upgrade com.twitter.hpack to v0.10.1 2015-02-25 10:17:23 -08:00
Nathan Mittler 488f8a9989 Merge pull request #117 from nmittler/stream_removal_fix
Fixing memory leak in stream removal policy
2015-02-25 09:55:40 -08:00
Eric Anderson 61179abcaa Set encoding for Java source to UTF-8
Our new example uses UTF-8 characters. On systems that don't have UTF-8 as
their default locale, the build fails without the override.
2015-02-24 23:02:50 +00:00
Nathan Mittler 360a84f42a Merge pull request #108 from nmittler/route_guide
Adding RouteGuide example and deleting others.
2015-02-24 13:59:07 -08:00
nmittler b897a89e78 Adding RouteGuide example and deleting others. 2015-02-24 13:58:16 -08:00
Nathan Mittler 494d273b05 Merge pull request #112 from nmittler/comments
Some comment cleanup in the Netty builders.
2015-02-24 13:17:47 -08:00
nmittler 23f513c0d2 Some comment cleanup in the Netty builders. 2015-02-24 13:16:21 -08:00
nmittler cc170418ea Fixing memory leak in stream removal policy
The stream removal policy was never being added as a handler, so it was
never starting its periodic timer to remove streams.
2015-02-24 12:55:26 -08:00
Louis Ryan 425e3c0b7f Remove dead GrpcFramingUtil class 2015-02-23 17:44:23 -08:00
Mugur Marculescu 5b1bc15182 Create CONTRIBUTING.md
Adding a half filled contributing readme file.
2015-02-23 17:26:08 -08:00
Louis Ryan 95c6f5082c Udate TODOs to use Github user names 2015-02-23 12:46:28 -08:00
Eric Anderson 7b25aaf7e7 Remove target from .gitignore
We are no longer using Maven, so target/ directories should not longer
be ignored.
2015-02-23 11:59:13 -08:00
Eric Anderson 3af5add7b2 Add java_package proto option for portability
Some protoc Java environments have a package to put all proto namespaces
under, since proto namespaces aren't aligned with Java packages.
2015-02-23 10:38:08 -08:00
Jakob Buchgraber c6c0a3bf69 Remove user prefix from NettyServerBuilder.userBossEventLoopGroup(). Fixes #73 2015-02-20 13:43:20 -08:00
Jakob Buchgraber bd81a58c42 Add duration paramter to QPS Client and remove "server_threads" parameter.
The QpsClient no longer executes a fixed number of RPCs but runs for a period of time now (see #83).
After some discussion with @ejona86, we also agreed to remove the "server_threads" parameter
and to no longer use a `DirectExecutor` and thus run the QPS Server without any tweaks and
modifications. We believe/hope that this change will make the comparison between the C++ and
Java versions less "Apples and Oranges".

The "client_threads" parameter was renamed to "concurrent_calls" to better reflect what it
acutally does.

Furthermore, I updated the gradle build script to create separate executables for the
client and the server.

I also added a README.
2015-02-20 13:32:55 -08:00
Eric Anderson ee6c9d7b52 Add scary JavaDoc to Metadata.setAuthority() 2015-02-20 08:54:08 -08:00
Eric Anderson dbf7d529bd Make sure to close InputStream even if cancelled 2015-02-20 08:52:51 -08:00
Jakob Buchgraber f2f120922d Fix race for stream id in OkHttpClientTransport.
When running benchmarks using the okhttp transport with lots of
streams per channel we would see the occasional GOAWAY frame with
the server logging exceptions of the like "io.netty.handler.codec.http2.Http2Exception: Request stream 575 is behind the next expected stream 583".

As quickly identified by @ejona86, there is a race between creating a new stream id and writing the header on the wire.
Putting both under the same lock ensures that those two always go together.

After this change the errors disappeared. The perf impact should be small as the actual write to
the socket doesn't happen within the lock, but only the scheduling of the write.
2015-02-19 21:29:31 -08:00
Eric Anderson b10aaf8c77 Inform users they need Maven 3.2 to build our deps 2015-02-19 13:14:00 -08:00
Eric Anderson 746eccaced Fix inbound flow control for Calls.blockingServerStreamingCall
asyncServerStreamingCall provides the initial request(1).

Fixes #93
2015-02-19 09:37:09 -08:00
Louis Ryan 161ac95300 Allow IntelliJ to refer to generated sources for benchmark protos 2015-02-18 16:14:24 -08:00
Jakob Buchgraber 07d0917b94 Add ServerImpl#awaitTerminated() method. Fixes #80 2015-02-18 16:00:34 -08:00
Jakob Buchgraber 246e8b52bb Add build file and instructions to examples directory. Fixes #43 2015-02-18 15:58:27 -08:00
Jakob Buchgraber 62f4399e26 Add 10s timeouts to integration tests 2015-02-18 15:56:40 -08:00
Louis Ryan 65d64cd934 Add more detailed instructions for enabling protoc when built from repo 2015-02-18 14:51:42 -08:00
Eric Anderson 31179ec995 Allow running test scripts from any directory
This was actually a feature lost when swapping to Gradle, and is used by
the grpc/java Dockerfile. But it is useful in general.
2015-02-17 13:46:09 -08:00
Eric Anderson 5d37b29ef8 Use ./gradlew instead of gradle in run scripts 2015-02-17 12:44:28 -08:00
Jakob Buchgraber 7ddcdfd26c Define ALPN package as an extra variable, to be reused by subprojects. 2015-02-17 10:46:17 -08:00
Jakob Buchgraber 6ceb37ae4c Add QPS Server and TLS support to QPS Client. 2015-02-17 10:45:27 -08:00
Eric Anderson e26608fe91 Avoid MoreObjects for "old guava" compatibility
Some early grpc users on Android are using a very old Guava. They are
working on upgrading, but it will take time. This alone is not enough
for "old guava" compilibility; expect more to come.
2015-02-13 17:06:46 -08:00
Jakob Buchgraber 44574944b9 Move TLS certificates.
- Move certificates to src/main/resources folder.
- Update the code that loads the certificates to make use of Java's resources API.
2015-02-13 11:37:59 -08:00
Eric Anderson 303482ad3c Fix race in OkHttp test
transportTerminated() is called after closing the streams, so we can't
just wait on the streams and expect it to have been called.
2015-02-13 08:54:50 -08:00
Eric Anderson b55b200408 Add missing dependency to benchmarks project 2015-02-12 17:54:48 -08:00
Eric Anderson 74f231a6dd Remove Guava Service from ClientTransport
OkHttp no longer cancels all calls on shutdown, as we want to allow
graceful shutdown. Such cancelling behavior will likely be provided by
Channel in the future.
2015-02-12 15:20:22 -08:00
Eric Anderson db0d8ad8c4 Only run terminationRunnable once 2015-02-12 15:17:12 -08:00
Jakob Buchgraber 3fd7d0675c Add QPS Client to perform throughput and latency tests. 2015-02-11 17:47:45 -08:00
Eric Anderson 127270bd5f Fix shutdown race with negotiation
If the transport had started but negotiation had not completed then
previously channel would be null and shutdown would have no effect. Now
we set channel eagerly, but use a separate variable for determining if
it is safe for general use.
2015-02-10 12:47:53 -08:00
nabeelmian d2e35b0d02 Added utility class, ForwardingServerListener, that forwards calls to
underlying ServerCall.Listener.

-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=85910420
2015-02-09 13:09:19 -08:00
Eric Anderson 8aa79b39fc Improve thread safety of newStream()
OkHttp should now have a thread-safe implementation of newStream.
Previously 'lock' was not held when checking goAway and the checking in
AbstractClientTransport was redundant.

Netty was thread-safe, but it was very hard to tell what guarantees were
necessary and what guarantees each piece was providing.
2015-02-06 14:12:01 -08:00
Eric Anderson c84ef8332e Simplify connection callback handling in Netty
Channel is available immediately after connect(), so register callbacks
immediately instead of delaying.

Setting channel is now delayed until it is actually safe to use.
2015-02-05 13:35:49 -08:00