Commit Graph

75 Commits

Author SHA1 Message Date
Eric Anderson dd8165b2a7 api: Add ExperimentalApi to Metadata.BinaryStreamMarshaller
This was missed in d1078591 and the API has not yet been released.
2019-12-27 13:33:46 -08:00
Jihun Cho 90969b3471
core: make service config error handling optional implementation (#6564) 2019-12-26 15:07:20 -08:00
ST-DDT 2afe13487c api: Fix javadoc for ManagedChannelBuilder#forTarget(String)
The dns scheme is only the default scheme with grpc-java. Other
libraries could add more NameResolvers and thus change the default. For
compatibility reasons, the schema should therefore be specified
explicitly.
2019-12-16 15:51:53 -08:00
Dounan Shi 9e02cf089e Gracefully shutdown example servers (#6512) 2019-12-13 16:19:45 -08:00
markb74 d107859145 Support for lazily serialized values in Metadata.
First add a new a Metadata.BinaryStreamMarshaller interface which
serializes to/from instances of InputStream, and a corresponding
Key.of() factory method.

Values set with this type of key will be kept unserialized internally,
alongside a reference to the Marshaller. A new method
InternalMetadata.serializePartial(), returns values which are either
byte[] or InputStream, and allows transport-specific handling of
lazily-serialized values.

For the regular serialize() method, stream-marshalled values will be
converted to byte[] via an InputStreams.
2019-12-12 15:34:30 -08:00
Tomo Suzuki 80699f8be9 all: bump Animal-sniffer-annotation to 1.18 (#6488) 2019-12-05 13:15:59 -08:00
Chengyuan Zhang eb21c646b2
api, core: make scheduled executor service accessible for NameResolver.Args (#6455)
Added new API on NameResolver.Args to access ScheduledExecutorService, which is wrapped transport executor.
2019-11-21 16:14:13 -08:00
ZHANG Dapeng 2d454d478c
Revert "Revert "all: remove deprecated usePlaintext(boolean)""
This reverts commit 316a739e67.
2019-11-18 16:53:52 -08:00
Chengyuan Zhang 86bfefdaf2
api, core: make channel logger accessible through NameResolver.Args (#6430) 2019-11-18 16:33:39 -08:00
Chengyuan Zhang 94eb93bd3a
api: enforce NameResolver.Args creation with builder (#6437) 2019-11-18 15:31:44 -08:00
Eric Anderson 4dba65bad4 api: Rename blockingExecutor to offloadExecutor
The API review for #6279 came up with a more meaningful name that
better explains the intent. A setter for the old name was left in
ManagedChannelBuilder to ease migration to the new name by current
users.
2019-11-04 13:16:08 -08: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
Carl Mastrangelo 4503a233f4 api: stabilize safe and idempotent methods in MethodDescriptor 2019-10-22 10:59:11 -07:00
Jihun Cho ae11b9facc
api,core,stub: fix lint errors (#6305) 2019-10-18 17:30:00 -07:00
Jihun Cho eef47b26b8
core,grpclb: DnsNameResolver will use srv record by default if grpclb (#6298) 2019-10-18 13:00:47 -07:00
Eric Anderson 40f401d0e7 api: Clarify setting safe/idempotent may change other value 2019-10-17 10:01:34 -07:00
Eric Anderson 9eca2dcc4f api: Add ExperimentalApi annotations for blockingExecutor
These should have been present when initially added in #6238, but we forgot.
2019-10-16 13:58:55 -07:00
Eric Anderson 3ce5df3f78 api: Safe implies idempotent 2019-10-16 13:29:38 -07:00
Eric Anderson fa45a71ec9 api: Allow streaming methods to be safe 2019-10-16 10:08:42 -07:00
Grant Oakley adcfb3e623 api,core: Adds an Executor field to NameResolver.Args.
Adds an Executor to NameResolver.Args, which is optionally set on ManagedChannelBuilder. This allows NameResolver implementations to avoid creating their own thread pools if the application already manages its own pools.

Addresses #3703.
2019-10-14 08:46:26 -07:00
ZHANG Dapeng 316a739e67
Revert "all: remove deprecated usePlaintext(boolean)"
This reverts commit 296857b4e7.
2019-10-10 15:56:47 -07:00
ZHANG Dapeng 296857b4e7
all: remove deprecated usePlaintext(boolean) 2019-10-08 09:27:39 -07:00
ZHANG Dapeng 90b3c88fe2
api: avoid infinite loop in handleResolvedAddresses
If a `LoadBalancer` implementation does not override `handleResolvedAddressGroups()`, or overrides `handleResolvedAddressGroups()` but calls `super.handleResolvedAddressGroups()` at the beginning or the end, it will be trapped in an infinite loop.
2019-10-03 15:58:18 -07:00
Jihun Cho e9ac1b4a76
all: update modules to wait until other module's sourceSet is available (#6232) 2019-10-02 15:05:44 -07:00
ZHANG Dapeng 19b09160c9
all: stabilize ManagedChannelBuilder.usePlaintext() 2019-09-18 15:16:31 -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 5b838e5284 Apply maven-publish plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 55ac6f08af Apply JMH plugin explicitly when needed 2019-09-13 09:42:17 -07:00
edr 132e8bc8dd core: Add Attributes.Key for authority in EquivalentAddressGroup (#6126)
This enables NameResolvers to dynamically provide authority for each
Subchannel

Fixes #4469
2019-09-11 20:35:18 -07:00
Kun Zhang f9509694b9
context: allow creating Deadline with custom Ticker. (#6031)
This makes Deadline more test-friendly. Next step is to allow
ServerBuilder to take a custom Ticker and use it for creating
incoming Deadlines. With both changes in, application logic will be
able to verify the Deadlines they set.
2019-07-31 11:26:51 -07:00
ZHANG Dapeng 4114433674
doc: Add hint to users who want an experimental API to be stabilized 2019-07-26 09:22:53 -07:00
Mike Kobit 6615f2fc9d Add `@Nullable` to getter for trailers on `StatusRuntimeException` since the constructors allows it to be null 2019-07-09 15:56:42 -07:00
ZHANG Dapeng ea08150551
doc: Update javadoc that hedging is supported 2019-06-20 14:46:44 -07:00
Carl Mastrangelo 74e945ceb4
core,netty: block server shutdown until the socket is unbound 2019-06-19 17:23:08 -07:00
Kun Zhang c92c9e71bb
core: SubchannelStateListener continues to receive updates after LoadBalancer is shutdown. (#5883)
No more methods on the `LoadBalancer` will be called after
`LoadBalancer#shutdown()` is called.  This includes
`LoadBalancer#handleSubchannelState()` too.  `SubchannelStateListener`
inherited this restriction.  However, this special case makes
`onSubchannelState(SHUTDOWN)` an unreliable way of being notified
about `Subchannel` SHUTDOWN, and may confuse/complicate a
wrapping `LoadBalancer` that expects the full notification (e.g., #5875).

The javadoc isn't clear whether this restriction applies.  I think
it's more useful to make it no apply.
2019-06-14 14:43:54 -07:00
ZHANG Dapeng b69b15fddb
javadoc: exclude internal APIs
Fixes #5858 in master
2019-06-10 13:36:21 -07:00
Carl Mastrangelo 7657523b28
all: update to error prone 2.3.3 2019-06-05 15:28:43 -07:00
Manuel Kollus e526891a2b api,protobuf-lite: solve code style issues 2019-05-31 12:49:30 -07:00
Eric Anderson 3c931b40b0 api: Mention similarity of synccontext to a dedicated thread
This is the conceptual model we use. Document it to help aid others'
understanding and make it easier to understand when it is appropriate to
use.
2019-05-30 10:52:22 -07:00
Kun Zhang af2c16d301
api: deprecate Helper.updateSubchannelAddresses() and add equivalent on Subchannel (#5802)
Resolves #5676
2019-05-30 09:16:38 -07:00
Eric Anderson bc2e1764f6 api,stub: Clarify isReady()/onReady() interaction semantics 2019-05-29 17:28:45 -07:00
Tim van der Lippe ad0893737e Migrate org.mockito.Matchers#any* to org.mockito.ArgumentMatchers
The former is deprecated and replaced by the latter in Mockito 2.
However, there is a functional difference: ArgumentMatchers will reject
`null` and check the type if the matcher specified a type (e.g.
`any(Class)` or `anyInt()`). `any()` will remain to accept anything.
2019-05-29 16:53:01 -07:00
Chengyuan Zhang d86d3dd363
all: fix lint and revert redundant lint fixes in #5570 (#5787)
* Revert "all: fix lint (#5770)"

This reverts commit 00d4cc29ad.

* all: fix lint and revert redundant lint fix in #5570
2019-05-24 01:02:12 -07:00
Carl Mastrangelo cdeafcf6e0
core: add discard method for Attributes 2019-05-23 10:34:04 -07:00
Chengyuan Zhang 00d4cc29ad
all: fix lint (#5770)
* fixed lint warnings

* remove unused arg for subchannel
2019-05-23 01:05:22 -07:00
Kun Zhang f8fffeff12
api: add Subchannel.getInternalSubchannel(). (#5773)
Previously PickResult's Subchannel must be the actual implementation
returned from the Channel's Helper, and Channel would cast it to the
implementation class in order to use it.  This will be broken if
Subchannel is wrapped in the case of hierarchical LoadBalancers.

getInternalSubchannel() is the guaranteed path for the Channel to get
the InternalSubchannel implementation.  It is friendly for wrapping.

Background: #5676
2019-05-22 13:52:28 -07:00
Eric Anderson b6720c9fe6 api: Don't yet deprecate NameResolver.Listener
We think NameResolver.Listener2 may still change, so don't yet encourage
people to migrate.

Fixes #5764
2019-05-21 17:49:08 -07:00
Eric Anderson 15a453d9ef api: Fix doc for default value of idleTimeout()
It appears the docs were not updated when this was changed in d74091f5, which
was first released in v1.1.
2019-05-21 13:48:57 -07:00
Kun Zhang a2595d9e7d
api/core/grpclb: add warning about calling Subchannel.requestConnection() outside of sync-context (#5757)
The pick_first policies in core and grpclb previously would call
Subchannel.requestConnection() from data-path.  They now will schedule
that call in the sync-context to avoid the warning.  They will only
call it for the first pick of each picker, to prevent storming the
sync-context.
2019-05-20 11:39:02 -07:00