Commit Graph

207 Commits

Author SHA1 Message Date
Jihun Cho 16ba163291 stub: fix javadoc to indicate correct version(1.25.0 -> 1.26.0) 2019-12-16 17:08:04 -08:00
Jihun Cho 7db873f1f6
Roll-forward of stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub #6196 (#6458)
This reverts commit 2eb3f8c34e (#6317).
2019-11-25 09:41:16 -08:00
Eric Anderson 44b26dab9d stub: Provide bread-crumb to user how to configure StreamObserver before start
This is already in the documentation in CallStreamObserver, but if the user
gets here the error didn't provide an actionable next step. The message now
provides more help of how they should have called the methods instead of
feeling more like a brick wall.
2019-11-20 15:10:39 -08:00
Ran 258a95d0c4
Revert "stub: ignore unary response msg if status is not OK (#6288)" (#6342)
This reverts commit fe46edac
2019-10-28 10:05:28 -07:00
sanjaypujare 7dbf12fe2a
api,stub : fix 2 typos (CallCredentials2 to CallCredentials and javadoc comment in AbstractStub) (#6343) 2019-10-28 10:03:49 -07:00
Jihun Cho 2eb3f8c34e
stub,compiler: Rollback Abstract{Future,Blocking,Async}Stub (#6317)
rollback of #6304 & #6196
2019-10-22 13:27:30 -07:00
Jihun Cho ae11b9facc
api,core,stub: fix lint errors (#6305) 2019-10-18 17:30:00 -07:00
Jihun Cho ecbc5e4f47
stub: add RunWith for AbstractStub tests (#6304) 2019-10-18 16:30:48 -07:00
Ran fe46edacea
stub: ignore unary response msg if status is not OK (#6288)
* stub: ignore unary response msg if status is not OK

* stub: throw if no msg with OK status

* address the comment, improve tests.

* fix error message

* fix error message

* improve naming of the tests

* call onCompleted on success unary flow

* fix test

* handle errors for delayed unary message sending

* clean up the onCompleted/onError logic

* use hasMessageThat to produce better error message when fail
2019-10-17 14:49:53 -07:00
Jihun Cho 45d49a56cc
stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub (#6196) 2019-10-17 14:49:24 -07:00
Chengyuan Zhang 0ec31c683e
Revert "Revert "stub: Wait for onClose when blocking stub is interrupted"" (#6255)
This reverts commit 0604e14154.
2019-10-07 11:40:20 -07:00
Eric Anderson 2b945774b6 Apply animalsniffer plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 4215b80b81 Apply java plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson e13221b503 Apply japicmp plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 5b838e5284 Apply maven-publish plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Carl Mastrangelo 148b7de357
stub: avoid race in onHalfClose server StreamObserver 2019-07-19 12:24:34 -07:00
Carl Mastrangelo 7657523b28
all: update to error prone 2.3.3 2019-06-05 15:28:43 -07:00
Eric Anderson bc2e1764f6 api,stub: Clarify isReady()/onReady() interaction semantics 2019-05-29 17:28:45 -07:00
Jihun Cho d50c8d4ec1
stub: improve error message for Client/ServerCalls (#5656) 2019-05-01 17:13:07 -07:00
Eric Anderson 0604e14154 Revert "stub: Wait for onClose when blocking stub is interrupted"
This reverts commit 6d44f46f18.

This is causing a test to hang internally. I am currently expecting that
the shutdown logic of the test is broken, but it will take time to
diagnose. Thus, revert this for the moment.
2019-04-26 08:59:45 -07:00
Vladimir Gordiychuk f631b3d249 stub: release server-streaming reference on request after method call 2019-04-26 08:58:42 -07:00
Eric Anderson 6d44f46f18
stub: Wait for onClose when blocking stub is interrupted
Interceptors need to see the onClose to clean up properly.

This also changes an isInterrupted() to interrupted(), since previously
the interrupted flag was still set when InterruptedException was thrown.
This caused an infinite loop with the new code. Previously, all callers
immediately re-set the interrupted flag, so there was no issue.

Fixes #5576
2019-04-22 16:32:06 -07:00
Eric Anderson 80c3c992a6 core: Move io.grpc to grpc-api
io.grpc has fewer dependencies than io.grpc.internal. Moving it to a
separate artifact lets users use the API without bringing in the deps.
If the library has an optional dependency on grpc, that can be quite
convenient.

We now version-pin both grpc-api and grpc-core, since both contain
internal APIs.

I had to change a few tests in grpc-api to avoid FakeClock. Moving
FakeClock to grpc-api was difficult because it uses
io.grpc.internal.TimeProvider, which can't be moved since it is a
production class. Having grpc-api's tests depend on grpc-core's test
classes would be weird and cause a circular dependincy. Having
grpc-api's tests depend on grpc-core is likely possible, but weird and
fairly unnecessary at this point. So instead I rewrote the tests to
avoid FakeClock.

Fixes #1447
2019-04-16 21:45:40 -07:00
Nick Hill 5f88bc42bf stub: optimize ThreadlessExecutor used for blocking calls
The `ThreadlessExecutor` currently used for blocking calls uses `LinkedBlockingQueue` which is relatively heavy both in terms of allocations and synchronization overhead (e.g. when compared to `ConcurrentLinkedQueue`). It accounts for ~10% of allocations and ~5% of allocated bytes per-call in the `TransportBenchmark` when using in-process transport with [stats and tracing disabled](https://github.com/grpc/grpc-java/issues/5510).

Changing to use a `ConcurrentLinkedQueue` results in a ~5% speedup of that benchmark.

Before:
```
Benchmark                         (direct)  (transport)  Mode  Cnt      Score     Error  Units
TransportBenchmark.unaryCall1024      true    INPROCESS  avgt   60   1877.339 ±  46.309  ns/op
TransportBenchmark.unaryCall1024     false    INPROCESS  avgt   60  12680.525 ± 208.684  ns/op
```

After:
```
Benchmark                         (direct)  (transport)  Mode  Cnt      Score     Error  Units
TransportBenchmark.unaryCall1024      true    INPROCESS  avgt   60   1779.188 ±  36.769  ns/op
TransportBenchmark.unaryCall1024     false    INPROCESS  avgt   60  12532.470 ± 238.271  ns/op
```
2019-03-29 10:45:23 -07:00
Eric Anderson 656dcc1c7c core,stub: Document grpc performs compression nego on server 2019-03-11 15:36:21 -06:00
Carl Mastrangelo 3a39b81cf5
all: remove java6 type args 2019-02-04 10:03:50 -08:00
Kun Zhang 8706a37a3b
doc: fix a javadoc warning (#5136) 2018-12-06 21:51:34 -08:00
Ze'ev Klapow 9111602d7c StreamObservers: make sure onComplete only gets called once from onReadyHandler
Fixes #4558
2018-12-05 12:59:09 -08:00
Venil Noronha 3f4c3f0406 stub: disable exception if onCancelHandler set
This restrains a cancellation Exception when an onCancelHandler
is set in ServerCallStreamObserverImpl.

Signed-off-by: Venil Noronha <veniln@vmware.com>
2018-11-30 18:36:12 -06:00
Rodrigo Queiro 8481943866 Add missing j2objc dependency to Bazel build
This avoids a warning when building artifacts that depend on Guava.

Fixes #5046.
2018-11-13 13:39:35 -08:00
ST-DDT 417c41b6cb stub: fix null check in MetadataUtils.
Fixes #5045
2018-11-13 08:35:47 -08:00
Carl Mastrangelo b0f423295b
all: use Java7 brackets 2018-09-14 13:52:29 -07:00
ZHANG Dapeng a18abfbf9f
stub: stablize AbstractStub.withExecutor API
Resolves #3605
2018-08-29 11:58:13 -07:00
zpencer 0d79e7a13c
stub: disableAutoInboundFlowControl javadoc correction (#4785)
The docs refer to the wrong places where this feature is ignored.
2018-08-23 15:54:47 -07:00
Carl Mastrangelo 6d4841a8c2
stub: update docs about Call lifetime + minor cleanups
* Reflowed some method parameters to be on the same line, else one
  parameter per line
* Used `@link` where appropriate
* Made some parameters non-final where it had no effect
* Renamed some parameters to be consistent
2018-08-13 14:36:32 -07:00
Eric Gribkoff 79b24709b9
all: update animalsniffer to Java 7 and add Android 14 (#4727) 2018-08-09 09:09:21 -07:00
Carl Mastrangelo 85448189ee
all: add tracking issues for all experimental APIs and make it required
Additionally, make Status*Exception.getTrailers() non experimental
2018-07-31 15:28:48 -07:00
Eric Anderson 989bc87dda bazel: Remove http_file trick for neverlink
The trick wasn't necessary, as any java_library can mark itself as
neverlink which applies to its dependencies.
2018-07-30 13:23:56 -07:00
Carl Mastrangelo 8da06a8bc4
all: remove unneeded deps on errorprone 2018-07-23 17:51:44 -07:00
Eric Anderson 15a5ba2698 Remove DoNotMock annotation in favor of JavaDoc
DoNotMock was removed from error_prone_annotations in 2.1.3, because
there was no enforcement mechanism (which is in google/error-prone#572).
Guava and Trust also depend on error_prone_annotations and are beginning
to use newer versions, so our usage of DoNotMock is causing diamond
dependency problems. This allows us to update to 2.2.0.

The annotations were useful internally; we're solving that in cl/205294089.
2018-07-20 14:03:55 -07:00
Carl Mastrangelo 146b6006b3
compiler,stub: update RpcMethod docs and usage 2018-07-12 17:01:47 -07:00
jbingham-google ffcb3b964b compiler, stub: Rename inputType and outputType in @RpcMethod 2018-07-10 13:24:50 -07:00
jbingham-google 9229e30287 compiler, stub: Add @RpcMethod annotation
This annotation will enable Java APT to generate code.

Addresses part of #3173.
2018-07-06 17:02:01 -07:00
Carl Mastrangelo 7edb41a4ef
stub: clarify StreamObservers interaction 2018-06-26 15:43:13 -07:00
ZHANG Dapeng 5ce10f0146
all: add gradle format checker
This PR adds an automatic gradle format checker and reformats all the *.gradle files. After this, new changes to *.gradle files will fail to build if not in good format, just like checkStyle failure.
2018-06-11 18:35:18 -07:00
Grant Oakley dbf9bd2158 stub: add @CheckReturnValue to AbstractStub 2018-05-04 15:46:34 -07:00
Carl Mastrangelo 60a0b0c471
all: normalize copyright header 2018-05-03 14:55:21 -07:00
ZHANG Dapeng d50c191aca
core/stub: fix lint warnings 2018-05-02 10:37:32 -07:00
Grant Oakley fcb48ff216 core,stub: Add toString() to ClientCallImpl and GrpcFuture 2018-05-01 16:49:56 -07:00
David Ostrovsky 23fcedfb6f Bazel: Fix compilation in Java 9
Fixes: #3633.

Test Plan:

On most recent Bazel version run:

  $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk \
    build --javacopt='--release 9' \
    --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 \
    examples:helloworld_java_grpc
2018-04-26 14:37:57 -07:00