Commit Graph

225 Commits

Author SHA1 Message Date
zpencer 7c37f1d32b
core,netty,okhttp,services: expose socket options to channelz (#4228)
For okhttp, expose the standard options from the Socket object.

For netty, expose all the `io.netty.channel.ChannelOption`s of the
`channel.config()`.
2018-03-30 08:48:37 -07:00
Eric Anderson 3bb6708eee services: Specify serialVersionUID for the dummy SocketAddress
This fixes a serial warning that breaks the build when building
_without_ ErrorProne. I have no clue why _disabling_ ErrorProne makes
the warning pop up, but whatever, the warning is legit.

I also gave it a name, since the anonymous $1 seems weird if we're
providing a serialVersionUID. Not to say we're actually supporting
serializing this object. But if we ever see a serialized form show up in
the future, having a more clear name would make it obvious what it is.
2018-03-26 16:57:09 -07:00
zpencer 0955866d5a
core,services: implement binarylog Client and ServerInterceptor (#4174)
- To make unit tests easier, added the BinaryLogSinkWriter abstract
  class, which allows verifying high level arguments rather than low
  level protobufs.
- remove InputStream based marshaller (IDENTITY_MARSHALLER) in favor
  of byte[] because retries will need to call serialize multiple
  times. This is achieved with a special InputStream that lets us
  access the internal byte[] without copying.
- Change ByteBuffer based internal methods to use byte[]
- Update unit tests to reflect the above
2018-03-23 09:29:24 -07:00
zpencer ca99f80999
core,services: track server sockets in channelz (#4226)
Rather than querying the ServerImpl for its sockets, we register them
into channelz as with all the other entities, for consistency.

Error conditions are checked with `assert` statements, so we throw in
tests.
2018-03-16 17:21:25 -07:00
zpencer 401726f310
services: update channelz TLS proto to use RFC names (#4233)
For context:
https://github.com/grpc/proposal/pull/71
2018-03-16 11:14:35 -07:00
Carl Mastrangelo 37cd0427d0
services: fix lint warning 2018-03-15 10:51:06 -07:00
zpencer 9224d2ab8f
services: fix binary logging empty metadata NPE, add null checks (#4213)
Fix NPE and refactor tests to make it more obvious whether tests
assume empty or non empty metadata.

Add null checks to applicable places in binary log.
2018-03-14 11:29:49 -07:00
zpencer f56ac76b35
core,services: add ChannelzService class (#4205)
This implements the methods to expose the stats as a gRPC
service. GetServerSockets is still unimplemented and will require a
follow up change.
2018-03-10 14:58:34 -08:00
zpencer f017a0657c
services: update channelz.proto to refer to sockets as socket_ref (#4203)
This is more consistent with the other fields.
2018-03-09 14:50:37 -08:00
zpencer 86fe318dea
services: add channelz protos (#4191)
This adds the proto and generated output.

These options are used:
option java_multiple_files = true;
option java_package = "io.grpc.channelz.v1";
option java_outer_classname = "ChannelzProto";
2018-03-08 14:53:54 -08:00
zpencer 887217e57b
core,services: fix binarylog unit tests (#4109)
- The unsafe operation was reverted in code, so the test should not
  use it either
- The variable naming is tripping internal linters
2018-02-22 10:08:12 -08:00
zpencer 5f7b64a250
core,services: lock down visibility of BinaryLogSink (#4100)
- This class should not be a part of the public API
- Update ServiceProvidersTest to verify package private services can be
  loaded with the utility.
2018-02-20 09:54:40 -08:00
zpencer bde2ba2444
services: introduce BinaryLogSinkProvider (#3917)
The `BinaryLog` will write `GrpcLogEntry`s to the sink, which is
intended as a pluggable interface. It is the sink's
responsibility to send the binlog protos to disk, to a remote
logging service, etc.
2018-02-16 13:47:31 -08:00
Eric Gribkoff 6f9b4e87e1
compiler: avoid invoking experimental method in generated code 2018-02-08 11:25:38 -08:00
Eric Anderson 4bc0c95d0b Update ErrorProne to 2.1.3 and fix failures
The fixes could have subtle side-effects, but I did take care when making them.
2018-01-09 12:40:55 -08:00
zpencer c96ce4de20
services: fix lint warnings on binlog (#3927) 2018-01-09 12:08:58 -08:00
Spencer Fang c4577ecc65 respond to comments 2018-01-04 13:34:47 -08:00
Spencer Fang 0191d0d555 services: utility methods for create binlog protos 2018-01-04 13:34:47 -08:00
zpencer 4c17382a43
services: let BinaryLog factory return null (#3868) 2017-12-14 17:27:52 -08:00
zpencer 02f56b0218
core,services: move BinaryLog class to grpc-services (#3867) 2017-12-14 14:20:30 -08:00
Carl Mastrangelo c9b02db276
all: add Status messages to all statuses 2017-12-04 19:00:16 -08:00
Carl Mastrangelo aee5fc4176
all: update to proto 3.5.0 2017-11-30 11:50:19 -08:00
Kun Zhang d87ef74082
core: set sampled for local span per MethodDescriptor. (#3627)
This moves away from the global String-based Span name registry which
is not as flexible as we desire.

Also renamed the option name to be more accurate.  This is not
API-breaking because the origianl addition to MethodDescriptor and
code-gen didn't make it into the 1.7.0 release.
2017-11-01 16:46:05 -07:00
ZHANG Dapeng d6ff4c259f
testing: move io.grpc.testing.StreamRecorder to internal 2017-11-01 09:37:22 -07:00
Carl Mastrangelo 87c8791983
compiler: remove references to static fields 2017-10-31 15:24:48 -07:00
Carl Mastrangelo 30b59885b7
compiler: add methods for accessing method descriptors
* MethodDescriptor is lazy loaded, so protobuf loading only happens on demand.  This also means tracing registration happens  on demand.
* The names of the getters all being with `method`.  This makes it harder for autocomplete to pick them up.
* A new field is used, which matches the getter name.  Rather than make the new-getters reference the old-fields, make the old-fields reference the new getters.  This makes removal of the old-fields a simple operation.
* The getters may not be inlineable, but thats an easy fix if it ends up being a problem.  Not worth premature optimization (but is worth future work).

The expected timeline for this is adding this to the 1.8 cut, and deprecating the old-fields.  They will be removed in 1.9.
2017-10-30 10:30:34 -07:00
Carl Mastrangelo de1630bc26 services: delete deprecated Proto reflection service 2017-09-26 15:50:06 -07:00
Kun Zhang a6653bb135 core/compiler: register Span names for code-generated methods (take 2)
This is a more favorable approach than #3467. Doing the registration
in MethodDescriptor should allow us to deregister in case the
generated stub and its MethodDescriptors are garbage-collected
routinely, e.g., if they are loaded by a separate ClassLoader.
2017-09-25 15:38:48 -07:00
Lukasz Strzalkowski 731bbefb17 core, compiler, protobuf: introduce MethodDescriptor#setSchemaDescriptor 2017-09-11 09:57:03 -07:00
Carl Mastrangelo 24ff2748b7 all: update to proto 3.4.0 2017-08-25 11:25:36 -07:00
Eric Anderson 182164eafc compiler: Add option to disable version output
If the option becomes popular, we can just remove the version.
2017-08-23 12:37:40 -07:00
zpencer ab85c5ae76 Start 1.7.0 development cycle (#3357)
This bump changelist is applied a bit late with respect to the
1.6.0 branch cut. Look at the 1.6.0 to see the source of truth of
where it was cut. Do not assume it is the commit that precedes
this one.
2017-08-22 12:29:03 -07:00
Carl Mastrangelo 424eeea8f5 all: begin 1.6 release cycle 2017-07-06 10:43:56 -07:00
Carl Mastrangelo 166108a943 all: fix licence whitespace 2017-06-01 14:28:37 -07:00
Carl Mastrangelo 3bfd630bff all: update to Apache 2 licence
Also, update the authors.
2017-05-31 13:29:01 -07:00
Carl Mastrangelo 4ce52d10f6 all: bump to 1.5.0-SNAPSHOT 2017-05-23 17:57:25 -07:00
Carl Mastrangelo 0fe2c5cca6 all: bump to proto 3.3.1 2017-05-23 17:04:51 -07:00
ZHANG Dapeng 9954c5fe90 services: HealthStatusManager not to expose server stub methods
`HealthStatusManager` should not expose server stub methods, because it is wrong to call server stub methods directly.
2017-05-10 14:06:13 -07:00
Eric Gribkoff 7aa807ce6d compiler: remove streaming calls from javadoc for newFutureStub
FutureStubs only support unary calls
2017-05-02 10:24:23 -07:00
Łukasz Strzałkowski 4f96b0a483 compiler: move over to method descriptor builder 2017-04-12 08:56:46 -07:00
Carl Mastrangelo 17b90169d8 all: begin 1.4.x development cycle 2017-04-11 14:51:39 -07:00
Eric Anderson 075b5ecddd services: Remove unused variables 2017-03-30 13:41:32 -07:00
Eric Gribkoff 260fc273b8 services: update monitoring.proto 2017-03-21 10:46:40 -07:00
Carl Mastrangelo 7ce2b4f81d all: start 1.3.0 development cycle 2017-03-06 13:12:44 -08:00
Eric Gribkoff f2beea6e9c services: add monitoring service 2017-03-02 15:04:46 -08:00
Eric Gribkoff c2cbd5f29d services: move proto services to io.grpc.protobuf.services 2017-03-01 11:54:50 -08:00
Eric Gribkoff e345273268 services: don't update reflection index mid-stream
This fix addresses https://github.com/grpc/grpc-java/issues/2689
2017-02-28 20:05:26 -08:00
Carl Mastrangelo 700abb32af compiler: add some missing final modifiers on generated code 2017-02-10 10:16:43 -08:00
Carl Mastrangelo b0323ac22c all: update to protobuf 3.2.0 2017-02-07 09:47:15 -08:00
Carl Mastrangelo e8aef5b4bb Start 1.2.0 development cycle 2017-01-30 16:40:12 -08:00
Carl Mastrangelo 237a65ebfc core: make ServiceDescriptor use the Builder pattern 2017-01-30 15:22:40 -08:00
Carl Mastrangelo cbe0ecd5e2 all: fix linter found on import 2017-01-27 15:47:53 -08:00
Carl Mastrangelo 89bc2cd3b2 all: update to latest import ordering 2017-01-26 13:43:06 -08:00
Eric Gribkoff 5bae984a88 services: remove no-op call in reflection service test
Now that the fix for #2444 is in, there's no need for the initial noop call.
2017-01-23 17:56:13 -08:00
Eric Gribkoff d59973c925 core,services: separately index mutable and immutable services
Updates the proto reflection service to process immutable services once and
mutable services as-needed.
2017-01-13 17:46:56 -08:00
ZHANG Dapeng 3d210ae875 compiler: reduce synchronzed invocation (#2539)
not necessary to synchronze every time calling
getServiceDescriptor(), if the descriptor has been created already;

go with the double-checked locking idom
2016-12-29 12:21:04 -08:00
Kun Zhang 1aaf1a989c compiler: final bindService() in generated code. (#2553)
So that it won't be overridden by Mockito when it creates a mock for
the server interface.
2016-12-29 10:32:47 -08:00
Eric Gribkoff aada0780b8 services: Flow control for proto reflection service 2016-12-14 16:14:22 -08:00
Eric Gribkoff c8c9fff679 services: Proto reflection service 2016-11-28 13:20:55 -08:00
Eric Gribkoff abffc76da2 addressing reviewer comments 2016-10-28 08:45:32 -07:00
Eric Gribkoff aff1cac7da Compiler/core changes to support the proto reflection API
core: adds @Nullable Object getAttachedObject() to ServiceDescriptor

compiler: Plumbing necessary to access proto file descriptors via
the reflection service
2016-10-28 08:45:32 -07:00
Carl Mastrangelo 894802e3ec compiler: lazily generate ServiceDescriptors 2016-10-19 16:52:47 -07:00
Eric Anderson 5e1e88357c Update protobuf to 3.0.0
Fixes #2086
2016-07-29 09:31:15 -07:00
ZHANG Dapeng 3a13aa5665 compiler: make Stub final class 2016-07-22 09:49:32 -07:00
ZHANG Dapeng e109125c62 compiler: add build option to enable deprecated generated code
partially resolving #1469

The added option for java_plugin `enable_deprecated` is `true` by default in `java_plugin.cpp`, so the generated code for `TestService.java` (`compiler/build.gradle` not setting this option) has all deprecated interfaces and static bindService method.

`./build.gradle` and `examples/build.gradle` set this option explicitly to `false`, so all the other generated classes do not have deprecated code.

Will set `enable_deprecated` to `false` by default in future PR when we are ready.
2016-07-21 16:35:18 -07:00
Eric Anderson e9643bb5d7 Start 1.1.0 development cycle 2016-07-11 16:57:58 -07:00
Eric Anderson 46379da1a6 Start 1.0.0 development cycle 2016-07-01 11:46:33 -07:00
ZHANG Dapeng f149e4c175 compiler: deprecate interfaces and add ImplBase in codegen
first step to address issue #1469:

- leave and deprecate interfaces in codegen
- introduce `ServiceImplBase`,
- `AbstractService` is deprecated and extends `ServiceImplBase`
- static `bindService()` is deprecated
2016-06-29 21:17:03 -07:00
Eric Anderson dbef1af29a Bump protobuf dependency to 3.0.0-beta-3
This allows us to play with zero-copy and proto3 support for lite.
Unfortunately, it introduced some warnings, so deprecated warnings are
now ignored for benchmarks and interop-testing.
2016-06-28 08:58:13 -07:00
Eric Anderson 66ab956f9e Reapply "Eliminate MethodDescriptor from startCall and interceptCall for servers"
This reverts commit ef178304cb, which
itself was a revert.
2016-06-23 09:27:47 -07:00
Eric Anderson ef178304cb Revert "Eliminate MethodDescriptor from startCall and interceptCall for servers"
This reverts commit 3df1446deb.

The commit was adding to the difficulty of integration for testing. By
itself it isn't bad, so this is a temporary revert until the many other
commits are absorbed and then it will be reapplied.

This does have a manual edit for ClientCallsTest.
2016-06-20 15:18:18 -07:00
Louis Ryan 3df1446deb Eliminate MethodDescriptor from startCall and interceptCall for servers
Make the MethodDescriptor a property of ServerCall
Move ServerMethodDefinition into ServerServiceDefinition
2016-06-13 14:39:58 -07:00
Eric Anderson 7c722e440e codegen: Specify URL for ExperimentalApi
Fixes #1378. These are the last ExperimentalApis that didn't have their
own separate tracking issue.
2016-06-07 15:00:29 -07:00
Carl Mastrangelo 676bf4854f core: fix nags from linter 2016-06-01 13:58:07 -07:00
ZHANG Dapeng b7eea7c13a implements health check service
resolves #647
2016-05-20 14:03:29 -07:00