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

Commit

Permalink
chore: Remove @BetaApi annotations for the de-facto GA features (#1627
Browse files Browse the repository at this point in the history
)

* chore: Remove `@BetaApi` annotations for the de-facto GA features

Those features have been under `BetaApi` annotation for 2-3+ years.
They are:
- Long running operations logic
- Streaming logic
- Fields extractor logic
- Interceptors logic
- Response metadata logic

Many of the classes under gax-httpjson module remain `BetaApi` as those are much younger than grpc and shared classes, and will be cleaned up with httpjson module GA (which whill hopefully happen in H1).

This also addresses a couple old issues: #1095 and #702

* undeprecate Distribution and Pages
  • Loading branch information
vam-google authored Feb 11, 2022
1 parent 2df6162 commit 837a90b
Show file tree
Hide file tree
Showing 103 changed files with 20 additions and 299 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ public CallOptions getCallOptions() {
* @see ApiCallContext#withStreamWaitTimeout(Duration)
*/
@Override
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
@Nullable
public Duration getStreamWaitTimeout() {
return streamWaitTimeout;
Expand All @@ -435,14 +434,12 @@ public Duration getStreamWaitTimeout() {
* @see ApiCallContext#withStreamIdleTimeout(Duration)
*/
@Override
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
@Nullable
public Duration getStreamIdleTimeout() {
return streamIdleTimeout;
}

/** The channel affinity for this context. */
@BetaApi("The surface for channel affinity is not stable yet and may change in the future.")
@Nullable
public Integer getChannelAffinity() {
return channelAffinity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import io.grpc.MethodDescriptor;

/** Grpc-specific settings for creating callables. */
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class GrpcCallSettings<RequestT, ResponseT> {
private final MethodDescriptor<RequestT, ResponseT> methodDescriptor;
private final RequestParamsExtractor<RequestT> paramsExtractor;
Expand All @@ -50,7 +49,6 @@ public MethodDescriptor<RequestT, ResponseT> getMethodDescriptor() {
return methodDescriptor;
}

@BetaApi
public RequestParamsExtractor<RequestT> getParamsExtractor() {
return paramsExtractor;
}
Expand Down Expand Up @@ -94,7 +92,6 @@ public Builder<RequestT, ResponseT> setMethodDescriptor(
return this;
}

@BetaApi
public Builder<RequestT, ResponseT> setParamsExtractor(
RequestParamsExtractor<RequestT> paramsExtractor) {
this.paramsExtractor = paramsExtractor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.grpc;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.rpc.BatchingCallSettings;
Expand Down Expand Up @@ -65,7 +64,6 @@
import javax.annotation.Nonnull;

/** Class with utility methods to create grpc-based direct callables. */
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class GrpcCallableFactory {
// Used to extract service and method name from a grpc MethodDescriptor.
private static final Pattern FULL_METHOD_NAME_REGEX = Pattern.compile("^.*?([^./]+)/([^./]+)$");
Expand Down Expand Up @@ -144,7 +142,6 @@ UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link UnaryCallable} callable object.
*/
@BetaApi("The surface for batching is not stable yet and may change in the future.")
public static <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
BatchingCallSettings<RequestT, ResponseT> batchingCallSettings,
Expand Down Expand Up @@ -177,8 +174,6 @@ public static <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBat
* @param operationsStub {@link OperationsStub} to use to poll for updates on the Operation.
* @return {@link com.google.api.gax.rpc.OperationCallable} callable object.
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public static <RequestT, ResponseT, MetadataT>
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
GrpcCallSettings<RequestT, Operation> grpcCallSettings,
Expand Down Expand Up @@ -223,7 +218,6 @@ OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link BidiStreamingCallable} callable object.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand Down Expand Up @@ -253,7 +247,6 @@ BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
* @deprecated Please use ServerStreamingCallSettings
*/
@Deprecated
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand All @@ -277,7 +270,6 @@ ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
* settings with.
* @param clientContext {@link ClientContext} to use to connect to the service.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand Down Expand Up @@ -312,7 +304,6 @@ ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link ClientStreamingCallable} callable object.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
ClientStreamingCallable<RequestT, ResponseT> createClientStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
*/
package com.google.api.gax.grpc;

import com.google.api.core.BetaApi;
import io.grpc.ClientInterceptor;
import java.util.List;

/** Provider of custom gRPC ClientInterceptors. */
@BetaApi(
"The surface for adding custom interceptors is not stable yet and may change in the future.")
public interface GrpcInterceptorProvider {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.grpc;

import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.ClientStreamingCallable;
Expand Down Expand Up @@ -70,7 +69,6 @@ public static <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUna
* @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable
* @return {@link BidiStreamingCallable} callable object.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand All @@ -88,7 +86,6 @@ BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
* @param grpcCallSettings the gRPC call settings
* @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand All @@ -109,7 +106,6 @@ ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
* @param grpcCallSettings the gRPC call settings
* @param retryableCodes the {@link StatusCode.Code} that should be marked as retryable
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public static <RequestT, ResponseT>
ClientStreamingCallable<RequestT, ResponseT> createClientStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.grpc;

import com.google.api.core.BetaApi;
import com.google.api.gax.rpc.ApiCallContext;
import com.google.common.base.Preconditions;
import io.grpc.Metadata;
Expand All @@ -53,7 +52,6 @@
* </code>
* </pre>
*/
@BetaApi("The surface for response metadata is not stable yet and may change in the future.")
public class GrpcResponseMetadata implements ResponseMetadataHandler {

private volatile Metadata responseMetadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.api.gax.grpc;

import com.google.api.core.BetaApi;
import com.google.api.gax.rpc.BatchingCallSettings;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.ClientContext;
Expand All @@ -45,15 +44,14 @@
import com.google.longrunning.Operation;
import com.google.longrunning.stub.OperationsStub;

@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public interface GrpcStubCallableFactory {

/**
* Create a callable object with grpc-specific functionality. Designed for use by generated code.
*
* @param grpcCallSettings the gRPC call settings
*/
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
<RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
UnaryCallSettings<RequestT, ResponseT> callSettings,
ClientContext clientContext);
Expand All @@ -67,7 +65,7 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCalla
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link UnaryCallable} callable object.
*/
public <RequestT, ResponseT, PagedListResponseT>
<RequestT, ResponseT, PagedListResponseT>
UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
PagedCallSettings<RequestT, ResponseT, PagedListResponseT> pagedCallSettings,
Expand All @@ -83,8 +81,7 @@ UnaryCallable<RequestT, PagedListResponseT> createPagedCallable(
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link UnaryCallable} callable object.
*/
@BetaApi("The surface for batching is not stable yet and may change in the future.")
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
<RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
BatchingCallSettings<RequestT, ResponseT> batchingCallSettings,
ClientContext clientContext);
Expand All @@ -100,9 +97,7 @@ public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createBatchingCa
* @param operationsStub {@link OperationsStub} to use to poll for updates on the Operation.
* @return {@link OperationCallable} callable object.
*/
@BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public <RequestT, ResponseT, MetadataT>
<RequestT, ResponseT, MetadataT>
OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
GrpcCallSettings<RequestT, Operation> grpcCallSettings,
OperationCallSettings<RequestT, ResponseT, MetadataT> operationCallSettings,
Expand All @@ -119,12 +114,10 @@ OperationCallable<RequestT, ResponseT, MetadataT> createOperationCallable(
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link BidiStreamingCallable} callable object.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public <RequestT, ResponseT>
BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
StreamingCallSettings<RequestT, ResponseT> streamingCallSettings,
ClientContext clientContext);
<RequestT, ResponseT> BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
StreamingCallSettings<RequestT, ResponseT> streamingCallSettings,
ClientContext clientContext);

/**
* Create a server-streaming callable with grpc-specific functionality. Designed for use by
Expand All @@ -135,12 +128,10 @@ BidiStreamingCallable<RequestT, ResponseT> createBidiStreamingCallable(
* settings with.
* @param clientContext {@link ClientContext} to use to connect to the service.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public <RequestT, ResponseT>
ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
ServerStreamingCallSettings<RequestT, ResponseT> streamingCallSettings,
ClientContext clientContext);
<RequestT, ResponseT> ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
ServerStreamingCallSettings<RequestT, ResponseT> streamingCallSettings,
ClientContext clientContext);

/**
* Create a client-streaming callable object with grpc-specific functionality. Designed for use by
Expand All @@ -152,10 +143,8 @@ ServerStreamingCallable<RequestT, ResponseT> createServerStreamingCallable(
* @param clientContext {@link ClientContext} to use to connect to the service.
* @return {@link ClientStreamingCallable} callable object.
*/
@BetaApi("The surface for streaming is not stable yet and may change in the future.")
public <RequestT, ResponseT>
ClientStreamingCallable<RequestT, ResponseT> createClientStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
StreamingCallSettings<RequestT, ResponseT> streamingCallSettings,
ClientContext clientContext);
<RequestT, ResponseT> ClientStreamingCallable<RequestT, ResponseT> createClientStreamingCallable(
GrpcCallSettings<RequestT, ResponseT> grpcCallSettings,
StreamingCallSettings<RequestT, ResponseT> streamingCallSettings,
ClientContext clientContext);
}
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,11 @@ public TransportChannelProvider withExecutor(Executor executor) {
}

@Override
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public boolean needsHeaders() {
return headerProvider == null;
}

@Override
@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public TransportChannelProvider withHeaders(Map<String, String> headers) {
return toBuilder().setHeaderProvider(FixedHeaderProvider.create(headers)).build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
package com.google.api.gax.grpc;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.longrunning.OperationSnapshot;
import com.google.api.gax.rpc.ApiExceptionFactory;
import com.google.api.gax.rpc.StatusCode.Code;
Expand All @@ -39,7 +38,6 @@
import com.google.protobuf.Message;

/** Public for technical reasons; intended for use by generated code. */
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class ProtoOperationTransformers {
private ProtoOperationTransformers() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
*/
package com.google.api.gax.grpc;

import com.google.api.core.BetaApi;
import io.grpc.Metadata;

/**
* An interface to handle metadata returned from an RPC. A ResponseMetadataHandler is used by the
* GrpcMetadataHandlerInterceptor class to provide custom handling of the returned headers and
* trailers.
*/
@BetaApi("The surface for response metadata is not stable yet and may change in the future.")
public interface ResponseMetadataHandler {

/** Handle the headers returned by an RPC. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
Expand Down Expand Up @@ -125,7 +124,6 @@ public static final OperationsClient create(OperationsSettings settings) throws
* Constructs an instance of OperationsClient, using the given stub for making calls. This is for
* advanced usage - prefer to use OperationsSettings}.
*/
@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public static final OperationsClient create(OperationsStub stub) {
return new OperationsClient(stub);
}
Expand All @@ -139,7 +137,6 @@ protected OperationsClient(OperationsSettings settings) throws IOException {
this.stub = ((OperationsStubSettings) settings.getStubSettings()).createStub();
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
protected OperationsClient(OperationsStub stub) {
this.settings = null;
this.stub = stub;
Expand All @@ -149,7 +146,6 @@ public final OperationsSettings getSettings() {
return settings;
}

@BetaApi("A restructuring of stub classes is planned, so this may break in the future")
public OperationsStub getStub() {
return stub;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
package com.google.longrunning;

import com.google.api.core.ApiFunction;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.api.gax.core.InstantiatingExecutorProvider;
import com.google.api.gax.rpc.ApiClientHeaderProvider;
Expand Down Expand Up @@ -86,7 +85,6 @@ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilde
return OperationsStubSettings.defaultCredentialsProviderBuilder();
}

@BetaApi("The surface for customizing headers is not stable yet and may change in the future.")
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
return OperationsStubSettings.defaultApiClientHeaderProviderBuilder();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
*/
package com.google.longrunning.stub;

import com.google.api.core.BetaApi;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
Expand All @@ -52,7 +51,6 @@
*
* <p>This class is for advanced usage.
*/
@BetaApi("The surface for use by generated code is not stable yet and may change in the future.")
public class GrpcOperationsCallableFactory implements GrpcStubCallableFactory {
@Override
public <RequestT, ResponseT> UnaryCallable<RequestT, ResponseT> createUnaryCallable(
Expand Down
Loading

0 comments on commit 837a90b

Please sign in to comment.