Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Updated annotations
Browse files Browse the repository at this point in the history
Removed exceptions not thrown
Updated params in javadocs
Fixed broken doc links

Pre-push hook installed.

Change-Id: I2a259ea65dd9a9094a67fdf8d78ad820abf3d7e2
  • Loading branch information
michaelbausor committed Apr 26, 2016
1 parent 566052f commit 82ab4a2
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.Status;

import java.io.IOException;
import java.util.concurrent.ScheduledExecutorService;

/**
Expand Down Expand Up @@ -39,7 +38,7 @@ protected ApiCallSettingsTyped(ImmutableSet<Status.Code> retryableCodes,
}

protected ApiCallable<RequestT, ResponseT> createBaseCallable(
ManagedChannel channel, ScheduledExecutorService executor) throws IOException {
ManagedChannel channel, ScheduledExecutorService executor) {
ClientCallFactory<RequestT, ResponseT> clientCallFactory =
new DescriptorClientCallFactory<>(methodDescriptor);
ApiCallable<RequestT, ResponseT> callable =
Expand Down
58 changes: 30 additions & 28 deletions src/main/java/com/google/api/gax/grpc/ApiCallable.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import io.grpc.Status;
import io.grpc.StatusRuntimeException;

import java.io.IOException;
import java.util.concurrent.ScheduledExecutorService;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -104,68 +103,71 @@ public final class ApiCallable<RequestT, ResponseT> {
private final ApiCallSettings settings;

/**
* Create a callable object that represents a simple API method.
* Public only for technical reasons - for advanced usage
* Create a callable object that represents a simple API method. Public only for technical reasons
* - for advanced usage
*
* @param simpleCallSettings {@link com.google.api.gax.grpc.SimpleCallSettings} to configure
* the method-level settings with.
* @param serviceSettings{@link com.google.api.gax.grpc.ServiceApiSettings}
* to configure the service-level settings with.
* @param simpleCallSettings {@link com.google.api.gax.grpc.SimpleCallSettings} to configure the
* method-level settings with.
* @param channel {@link ManagedChannel} to use to connect to the service.
* @param executor {@link ScheduledExecutorService} to use to when connecting to the service.
* @return {@link com.google.api.gax.grpc.ApiCallable} callable object.
*/
public static <RequestT, ResponseT> ApiCallable<RequestT, ResponseT> create(
SimpleCallSettings<RequestT, ResponseT> simpleCallSettings,
ManagedChannel channel, ScheduledExecutorService executor) throws IOException {
ManagedChannel channel,
ScheduledExecutorService executor) {
return simpleCallSettings.create(channel, executor);
}

/**
* Create a paged callable object that represents a page-streaming API method.
* Public only for technical reasons - for advanced usage
* Create a paged callable object that represents a page-streaming API method. Public only for
* technical reasons - for advanced usage
*
* @param pageStreamingCallSettings {@link com.google.api.gax.grpc.PageStreamingCallSettings} to
* configure the page-streaming related settings with.
* @param serviceSettings{@link com.google.api.gax.grpc.ServiceApiSettings}
* to configure the service-level settings with.
* @param channel {@link ManagedChannel} to use to connect to the service.
* @param executor {@link ScheduledExecutorService} to use to when connecting to the service.
* @return {@link com.google.api.gax.grpc.ApiCallable} callable object.
*/
public static <RequestT, ResponseT, ResourceT>
ApiCallable<RequestT, PageAccessor<ResourceT>> createPagedVariant(
PageStreamingCallSettings<RequestT, ResponseT, ResourceT> pageStreamingCallSettings,
ManagedChannel channel, ScheduledExecutorService executor) throws IOException {
ManagedChannel channel,
ScheduledExecutorService executor) {
return pageStreamingCallSettings.createPagedVariant(channel, executor);
}

/**
* Create a base callable object that represents a page-streaming API method.
* Public only for technical reasons - for advanced usage
* Create a base callable object that represents a page-streaming API method. Public only for
* technical reasons - for advanced usage
*
* @param pageStreamingCallSettings {@link com.google.api.gax.grpc.PageStreamingCallSettings} to
* configure the page-streaming related settings with.
* @param serviceSettings{@link com.google.api.gax.grpc.ServiceApiSettings}
* to configure the service-level settings with.
* @param channel {@link ManagedChannel} to use to connect to the service.
* @param executor {@link ScheduledExecutorService} to use to when connecting to the service.
* @return {@link com.google.api.gax.grpc.ApiCallable} callable object.
*/
public static <RequestT, ResponseT, ResourceT>
ApiCallable<RequestT, ResponseT> create(
PageStreamingCallSettings<RequestT, ResponseT, ResourceT> pageStreamingCallSettings,
ManagedChannel channel, ScheduledExecutorService executor) throws IOException {
public static <RequestT, ResponseT, ResourceT> ApiCallable<RequestT, ResponseT> create(
PageStreamingCallSettings<RequestT, ResponseT, ResourceT> pageStreamingCallSettings,
ManagedChannel channel,
ScheduledExecutorService executor) {
return pageStreamingCallSettings.create(channel, executor);
}

/**
* Create a callable object that represents a bundling API method.
* Public only for technical reasons - for advanced usage
* Create a callable object that represents a bundling API method. Public only for technical
* reasons - for advanced usage
*
* @param bundlingCallSettings {@link com.google.api.gax.grpc.BundlingSettings} to configure
* the bundling related settings with.
* @param serviceSettings{@link com.google.api.gax.grpc.ServiceApiSettings}
* to configure the service-level settings with.
* @param bundlingCallSettings {@link com.google.api.gax.grpc.BundlingSettings} to configure the
* bundling related settings with.
* @param channel {@link ManagedChannel} to use to connect to the service.
* @param executor {@link ScheduledExecutorService} to use to when connecting to the service.
* @return {@link com.google.api.gax.grpc.ApiCallable} callable object.
*/
public static <RequestT, ResponseT> ApiCallable<RequestT, ResponseT> create(
BundlingCallSettings<RequestT, ResponseT> bundlingCallSettings,
ManagedChannel channel, ScheduledExecutorService executor) throws IOException {
ManagedChannel channel,
ScheduledExecutorService executor) {
return bundlingCallSettings.create(channel, executor);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.Status;

import java.io.IOException;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;

Expand All @@ -24,8 +23,8 @@ public final class BundlingCallSettings<RequestT, ResponseT>
/**
* Package-private, for use by ApiCallable.
*/
ApiCallable<RequestT, ResponseT> create(ManagedChannel channel, ScheduledExecutorService executor)
throws IOException {
ApiCallable<RequestT, ResponseT> create(
ManagedChannel channel, ScheduledExecutorService executor) {
ApiCallable<RequestT, ResponseT> baseCallable = createBaseCallable(channel, executor);
bundlerFactory = new BundlerFactory<>(bundlingDescriptor, bundlingSettings);
return baseCallable.bundling(bundlingDescriptor, bundlerFactory);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/google/api/gax/grpc/ChannelProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* Implementations of {@link ChannelProvider} may choose to create a new {@link ManagedChannel} for
* each call to {@link #getChannel}, or may return a fixed {@link ManagedChannel} instance. In cases
* where the same {@link ManagedChannel} instance is returned, for example by a
* {@link ChannelProvider} created using the
* {@link ServiceApiSettings#provideChannelWith(ManagedChannel, boolean)} method, and
* shouldAutoClose returns true, the {@link #getChannel} method will throw an
* {@link OperationNotSupportedException} if it is called more than once. This is to prevent the
* same {@link ManagedChannel} being closed prematurely when it is used by multiple client objects.
* {@link ChannelProvider} created using the {@link ServiceApiSettings}
* provideChannelWith(ManagedChannel, boolean) method, and shouldAutoClose returns true, the
* {@link #getChannel} method will throw an {@link OperationNotSupportedException} if it is called
* more than once. This is to prevent the same {@link ManagedChannel} being closed prematurely when
* it is used by multiple client objects.
*/
public interface ChannelProvider {
/**
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/google/api/gax/grpc/ExecutorProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
* Implementations of ExecutorProvider may choose to create a new {@link ScheduledExecutorService}
* for each call to {@link #getExecutor}, or may return a fixed {@link ScheduledExecutorService}
* instance. In cases where the same {@link ScheduledExecutorService} instance is returned, for
* example by an {@link ExecutorProvider} created using the
* {@link ServiceApiSettings#provideExecutorWith(ScheduledExecutorService, boolean)} method, and
* shouldAutoClose returns true, the {@link #getExecutor} method will throw an
* {@link OperationNotSupportedException} if it is called more than once. This is to prevent the
* same {@link ScheduledExecutorService} being closed prematurely when it is used by multiple client
* objects.
* example by an {@link ExecutorProvider} created using the {@link ServiceApiSettings}
* provideExecutorWith(ScheduledExecutorService, boolean) method, and shouldAutoClose returns true,
* the {@link #getExecutor} method will throw an {@link OperationNotSupportedException} if it is
* called more than once. This is to prevent the same {@link ScheduledExecutorService} being closed
* prematurely when it is used by multiple client objects.
*/
public interface ExecutorProvider {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.Status;

import java.io.IOException;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;

Expand All @@ -24,16 +23,16 @@ public final class PageStreamingCallSettings<RequestT, ResponseT, ResourceT>
/**
* Package-private, for use by ApiCallable.
*/
ApiCallable<RequestT, ResponseT> create(ManagedChannel channel, ScheduledExecutorService executor)
throws IOException {
ApiCallable<RequestT, ResponseT> create(
ManagedChannel channel, ScheduledExecutorService executor) {
return createBaseCallable(channel, executor);
}

/**
* Package-private, for use by ApiCallable.
*/
ApiCallable<RequestT, PageAccessor<ResourceT>> createPagedVariant(
ManagedChannel channel, ScheduledExecutorService executor) throws IOException {
ManagedChannel channel, ScheduledExecutorService executor) {
ApiCallable<RequestT, ResponseT> baseCallable = createBaseCallable(channel, executor);
return baseCallable.pageStreaming(pageDescriptor);
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/google/api/gax/grpc/SimpleCallSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import io.grpc.MethodDescriptor;
import io.grpc.Status;

import java.io.IOException;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;

Expand All @@ -21,8 +20,8 @@ public final class SimpleCallSettings<RequestT, ResponseT>
/**
* Package-private, for use by ApiCallable.
*/
ApiCallable<RequestT, ResponseT> create(ManagedChannel channel, ScheduledExecutorService executor)
throws IOException {
ApiCallable<RequestT, ResponseT> create(
ManagedChannel channel, ScheduledExecutorService executor) {
return createBaseCallable(channel, executor);
}

Expand Down

0 comments on commit 82ab4a2

Please sign in to comment.