Commit Graph

588 Commits

Author SHA1 Message Date
Kun Zhang c73b75e477 Change AbstractServiceDescriptor.methods() to Collection. Resolves #573 2015-07-09 14:24:51 -07:00
Carl Mastrangelo 3ee5b5a752 Try to simplify server method definition 2015-07-09 14:06:47 -07:00
Kun Zhang 73acc73dbf Remove Method and switch its users to MethodDescriptor.
Resolves #511.

- In generated code, make CONFIG private and METHOD_* fields public.
  METHOD_* fields are MethodDescriptors now, users of the CONFIG field
  should switch to using the METHOD_* fields.
- Move MethodType into MethodDescriptor (#529).
- Unify the fully qualified method name. It is fully qualified service
  name + slash + short method name. It doesn't have the leading slash.
- HandlerRegistry switches the key from short method name to fully
  qualified method name.
2015-07-09 09:29:03 -07:00
Kun Zhang 35f77ee84b Upgrade to protobuf-gradle-plugin 0.5.0 2015-07-08 16:24:59 -07:00
nmittler a6c51e7e14 Fixing some compiler warnings. 2015-07-08 16:10:54 -07:00
nmittler 8c1d38a0d8 Adding default User-Agent for netty and okhttp. 2015-07-08 15:56:54 -07:00
nmittler efbb65522b Simplifying flow control window config for Netty.
Fixes #494
2015-07-08 15:43:03 -07:00
Eric Anderson 35ff624eb2 Metadata.Key's name is non-null; don't check for null
There is a Preconditions.checkNotNull guaranteeing name is not null.
2015-07-08 15:10:02 -07:00
Eric Anderson d27cbc8aa3 Improve docs to describe close as being last method called
This isn't changing any of the semantics we already had, but more
informing users of the guarantees we provide.
2015-07-08 15:08:26 -07:00
Kun Zhang 7fff088e19 Fix a javadoc warning 2015-07-07 16:02:47 -07:00
Kun Zhang d3c5b00827 Add CallOptions.
- Pass CallOptions to Channel.newCall() and
  ClientInterceptor.interceptCall().
- Remove timeout from AbstractStub.StubConfigBuilder and add deadline,
  which is stored in a CallOptions inside the stub.
- Deadline is in nanoseconds in the clock defined by System.nanoTime().
  It is converted to timeout before transmitting on the wire. Fail the
  call with DEADLINE_EXCEEDED if it's already expired.
2015-07-07 14:28:38 -07:00
Xudong Ma 12d57974c0 Android interop test: Use proto plugin to generate the needed code. 2015-07-07 10:11:00 -07:00
Eric Anderson 30455fd2f4 Remove unused variables 2015-07-06 16:27:22 -07:00
Eric Anderson cb15779e59 Use class name, not instance, for invoking static method 2015-07-06 16:27:21 -07:00
Eric Anderson 10578e31c0 param in JavaDoc is lower-case 2015-07-06 16:27:21 -07:00
Eric Anderson 68efade3f5 Set hard-coded deadline to just under 1 year
10 years exceeds the maximum for some systems at the moment. Change to 1
year to workaround such systems while they get changed. And since "have
the default be a large number instead of not present" is a temporary fix
anyway.
2015-07-06 12:48:26 -07:00
Xudong Ma 1b3f9a3cde Add an option to Android interop test, to configure TLS protocol on SSLCertificateSocketFactory directly.
This is how our current internal users configure the TLS protocol, with this option, we can test and verify future changes will not break internal users.
2015-07-06 11:11:38 -07:00
Eric Anderson 74b5d29c8a Improve Exception backtrace for blocked streaming
Delaying creating the exception produces a much more useful exception.
The status code, description, and exception type are all identical. The
only difference in the backtrace.
2015-07-01 16:39:15 -07:00
Eric Anderson 7233077cdf Fake infinite timeout; 1s is not a good hard-coded timeout
Stubs don't have any timeout. However, MethodDescriptor does and
requires a timeout. We really want "no timeout," which is infinite, but
we use 10 years as the next best thing. CallOptions will end up fixing
this hack as MethodDescriptor will no longer have timeout.

Before, the hard-coded 1s didn't matter, because nobody was observing
it. Since 77878a0 it is now being sent to servers, and some servers
enforce it. Oops.
2015-07-01 16:24:39 -07:00
Eric Anderson 05f5a4fb3b Suggest -PskipCodegen in run-test-{client,server}
Just helps new users wanting to try things out from thinking they need
to deal with compiling our protoc plugin. As seen in #581
2015-07-01 13:44:28 -07:00
Kun Zhang af9fb6de77 Migrate from PARSER to parser() as a way of getting the parser of a protobuf message.
Upgrade to protobuf-3.0.0-alpha-3.1 that adds parser(). PARSER will go away eventually.
2015-06-30 23:14:21 -07:00
Kun Zhang 7a71627e86 Add the bintray repository for Maven protoc-plugin in the example 2015-06-30 23:11:41 -07:00
zsurocking af70397d88 Merge pull request #579 from zsurocking/master
Use hostname instead of InetAddress for Socket creation.
2015-06-30 21:52:13 -07:00
Xudong Ma a0241d8d88 Use default type of KeyStore in Android interop test App, so that it can work on lower versions.
The previously used "AndroidKeyStore" was introduced in Android 4.3
2015-06-30 15:18:14 -07:00
Xiao Hang 3777b8bf65 Use hostname instead of InetAddress for Socket creation.
On Android platform, the constructor using hostname will iterate through all solved ip address for making connection.
Before we implement happy eyeballs, this could be a workaround for Android users.
2015-06-29 19:12:15 -07:00
Xudong Ma f88779e422 Add the Android interop test App.
So far, it is built separately from the other gRpc components.
2015-06-26 15:31:14 -07:00
Eric Anderson a479c9116a Move timeout marshaller tests to ChannelImplTest
Now that ChannelImplTest exists, it makes more sense for them to be
there, since the implementation is in ChannelImpl.
2015-06-26 12:19:42 -07:00
Eric Anderson 45da9c5766 Add a few ChannelImpl tests and improve error status 2015-06-26 12:19:41 -07:00
Eric Anderson 9a2db9d7d9 Make ChannelImpl.obtainActiveTransport's fast path lock-free
Resolves #479
2015-06-26 12:19:41 -07:00
Xudong Ma 6e406ac4a5 Refactor OkHttpProtocolNegotiator, move Android related operations into an inner class. 2015-06-26 09:59:22 -07:00
Xudong Ma 27b36483f7 Update usage of deprecated API, and add back the blank lines removed by Intellij's reformat. 2015-06-25 14:55:29 -07:00
Xudong Ma 8f51457ee1 Rename getSslSocketFactoryForCertainCert to be newSslSocketFactoryForCa.
Fixes #560
2015-06-25 14:46:05 -07:00
Eric Anderson c7403127ea Revert swapping to the "canonical HTTP mapping"
The mapping is poorly suited for gRPC. C and Go don't even do any
mapping. We can improve the mapping in the future, but it is very
important that users don't start depending on the current mapping.

This change is "inspired by" the original code, but is even more
conservative.

Fixes #477
2015-06-25 12:15:34 -07:00
Louis Ryan a02503ada7 Add instructions for setting up traffic shaping on loopback
Enable benchmarks to detect shaped loopback binding and use it
2015-06-24 15:49:59 -07:00
Louis Ryan a69fbb0a2b Use 1MB as the max payload size in benchmarks to avoid exceeding Netty's buffer pool
default max buffer size.
2015-06-24 14:34:06 -07:00
nmittler ae2b5bfda7 Exposing AbstractBufferingHandler so it can be used by custom protocol negotiators. 2015-06-24 13:59:33 -07:00
Eric Anderson 74490d5f6b In compiler documentation, use grpc-java as plugin name
grpc-java is the implicit name of our plugin, due to its file name. No
need to use another name for it.
2015-06-24 13:13:03 -07:00
Xudong Ma 131ba5d1da Make the code clearer, fixes #531. 2015-06-19 12:59:52 -07:00
Eric Anderson fd52a765ed Blocking calls should error with StatusRuntimeException
Previously, it always threw a RuntimeExecutionException with a
StatusRuntimeException within (since the only callers of setException()
provide a StatusRuntimeException).

Resolves #507
2015-06-18 17:59:32 -07:00
Eric Anderson 4d5caf83fb Use exit() for integration test client
On my machine, the client currently takes ~3s to run a test. However,
with exit() it takes < 1s. When doing lots of integration tests, those
seconds add up.

We know one of those seconds is the DESTROY_DELAY_SECONDS of
SharedResourceHolder. Part of another second appears to be Netty
creating any threads that weren't previously created when shutting down.
2015-06-18 17:24:16 -07:00
Xudong Ma eb15eb2821 Some cleanup for okhttp:
1. Move DEFAULT_CONNECTION_SPEC to OkHttpChannelBuilder
2. make OkHttpClientTransport package-private
3. Rename OkHttpChannelBuilder.setConnectionSpec to connectionSpec
2015-06-18 13:29:18 -07:00
Eric Anderson 794fdf1615 Update Travis to use protobuf3-alpha3
It's only working today because alpha2 is still in the cache.
2015-06-17 16:12:11 -07:00
Jack Coughlin 77878a04ee Pass timeout header in ChannelImpl 2015-06-17 16:03:13 -07:00
nmittler 4322a43824 Throw error for Netty when Jetty ALPN not configured. 2015-06-17 14:19:55 -07:00
nmittler 9a6ded523a Cleanup of NettyClientTransportTest. 2015-06-16 13:11:03 -07:00
Eric Anderson 424c7e64c3 Avoid GCM in unit tests
GCM is very slow, and doesn't provide any benefit in unit tests. Even if
we were using tcnative and GCM is fast, using more available ciphers in
tests still makes sense. With this change building with Java 7 works
again, although that isn't the reason for the change.

On my machine with parallel building, it cuts full build time from
92 seconds to 39 seconds. For an incremental build after only changing
an interop test, the build time is cut from 73 seconds to 15 seconds.
2015-06-16 12:36:57 -07:00
nmittler cb486e461d Testing that buffered streams clean up properly upon disconnect. 2015-06-15 13:10:21 -07:00
David Connelly 15104cdc69 Make sure we enter terminated state when transport server has been shut down and all server transports have been closed. Previously, we had only been checking if server transports were closed. Also, make sure termination cleanup is performed at most once with an AssertionError if checkForTermination() called when server has already been terminated 2015-06-15 13:04:11 -07:00
nmittler d94fedc854 Updating master README.md to 0.7.1 release. 2015-06-12 07:32:50 -07:00
nmittler 491aad2659 Changing Netty handlers to properly set initialSettings. 2015-06-11 15:06:20 -07:00