Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add deprecated annotation and tag to bq storage alpha api #978

Merged
merged 4 commits into from Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.cloud.bigquery.storage.v1alpha2;

import com.google.cloud.GcpLaunchStage;
yirutang marked this conversation as resolved.
Show resolved Hide resolved
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
Expand All @@ -32,7 +33,9 @@
* Converts a BQ table schema to protobuf descriptor. All field names will be converted to lowercase
* when constructing the protobuf descriptor. The mapping between field types and field modes are
* shown in the ImmutableMaps below.
* @deprecated
yirutang marked this conversation as resolved.
Show resolved Hide resolved
*/
@GcpLaunchStage.Deprecated
yirutang marked this conversation as resolved.
Show resolved Hide resolved
public class BQTableSchemaToProtoDescriptor {
private static ImmutableMap<Table.TableFieldSchema.Mode, FieldDescriptorProto.Label>
BQTableSchemaModeMap =
Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.BidiStreamingCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.storage.v1alpha2.stub.BigQueryWriteStub;
import com.google.cloud.bigquery.storage.v1alpha2.stub.BigQueryWriteStubSettings;
import java.io.IOException;
Expand Down
Expand Up @@ -27,6 +27,7 @@
import com.google.api.gax.rpc.StreamingCallSettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.storage.v1alpha2.stub.BigQueryWriteStubSettings;
import java.io.IOException;
import java.util.List;
Expand Down
Expand Up @@ -20,6 +20,7 @@
import com.google.api.core.ApiFutures;
import com.google.api.gax.grpc.GrpcStatusCode;
import com.google.api.gax.rpc.InvalidArgumentException;
import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.storage.v1alpha2.ProtoBufProto.ProtoRows;
import com.google.cloud.bigquery.storage.v1alpha2.Storage.AppendRowsRequest;
import com.google.common.annotations.VisibleForTesting;
Expand Down Expand Up @@ -48,7 +49,9 @@
*
* <p>{@link DirectWriter} will use the credentials set on the channel, which uses application
* default credentials through {@link GoogleCredentials#getApplicationDefault} by default.
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class DirectWriter {
private static final Logger LOG = Logger.getLogger(DirectWriter.class.getName());
private static WriterCache cache = null;
Expand Down
Expand Up @@ -21,6 +21,7 @@
import com.google.api.gax.core.ExecutorProvider;
import com.google.api.gax.retrying.RetrySettings;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.storage.v1alpha2.ProtoBufProto.ProtoRows;
import com.google.cloud.bigquery.storage.v1alpha2.Storage.AppendRowsRequest;
import com.google.cloud.bigquery.storage.v1alpha2.Storage.AppendRowsResponse;
Expand All @@ -44,7 +45,9 @@
* functions, but also provides an additional feature: schema update support, where if the BigQuery
* table schema is updated, users will be able to ingest data on the new schema after some time (in
* order of minutes).
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class JsonStreamWriter implements AutoCloseable {
private static String streamPatternString =
"projects/[^/]+/datasets/[^/]+/tables/[^/]+/streams/[^/]+";
Expand Down
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.cloud.bigquery.storage.v1alpha2;

import com.google.cloud.GcpLaunchStage;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.protobuf.Descriptors.Descriptor;
Expand All @@ -29,7 +30,9 @@
/**
* Converts Json data to protocol buffer messages given the protocol buffer descriptor. The protobuf
* descriptor must have all fields lowercased.
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class JsonToProtoMessage {
private static ImmutableMap<FieldDescriptor.Type, String> FieldTypeToDebugMessage =
new ImmutableMap.Builder<FieldDescriptor.Type, String>()
Expand Down
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.cloud.bigquery.storage.v1alpha2;

import com.google.cloud.GcpLaunchStage;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.cache.Cache;
Expand All @@ -30,7 +31,9 @@
* A cache of JsonStreamWriters that can be looked up by Table Name. The entries will expire after 5
* minutes if not used. Code sample: JsonWriterCache cache = JsonWriterCache.getInstance();
* JsonStreamWriter writer = cache.getWriter(); // Use... cache.returnWriter(writer);
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class JsonWriterCache {
private static final Logger LOG = Logger.getLogger(JsonWriterCache.class.getName());

Expand Down
Expand Up @@ -15,11 +15,15 @@
*/
package com.google.cloud.bigquery.storage.v1alpha2;

import com.google.cloud.GcpLaunchStage;

/**
* A abstract class that implements the Runnable interface and provides access to the current
* StreamWriter and updatedSchema. This runnable will only be called when a updated schema has been
* passed back through the AppendRowsResponse. Users should only implement the run() function.
* @deprecated
*/
@GcpLaunchStage.Deprecated
public abstract class OnSchemaUpdateRunnable implements Runnable {
private StreamWriter streamWriter;
private Table.TableSchema updatedSchema;
Expand Down
Expand Up @@ -17,6 +17,7 @@

import com.google.api.gax.grpc.GrpcStatusCode;
import com.google.api.gax.rpc.InvalidArgumentException;
import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.storage.v1alpha2.ProtoBufProto.ProtoSchema;
import com.google.protobuf.DescriptorProtos.DescriptorProto;
import com.google.protobuf.DescriptorProtos.EnumDescriptorProto;
Expand All @@ -30,6 +31,8 @@
// A Converter class that turns a native protobuf::DescriptorProto to a self contained
// protobuf::DescriptorProto
// that can be reconstructed by the backend.
// @deprecated
@GcpLaunchStage.Deprecated
public class ProtoSchemaConverter {
private static String getNameFromFullName(String fullName) {
return fullName.replace('.', '_');
Expand Down
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.cloud.bigquery.storage.v1alpha2;

import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.Field;
import com.google.cloud.bigquery.LegacySQLTypeName;
Expand All @@ -41,7 +42,9 @@
*
* <p>The implementation as of now is not complete, which measn, if this check passed, there is
* still a possbility of writing will fail.
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class SchemaCompatibility {
private BigQuery bigquery;
private static SchemaCompatibility compat;
Expand Down
Expand Up @@ -36,6 +36,7 @@
import com.google.api.gax.rpc.StreamController;
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.GcpLaunchStage;
import com.google.cloud.bigquery.storage.v1alpha2.Storage.AppendRowsRequest;
import com.google.cloud.bigquery.storage.v1alpha2.Storage.AppendRowsResponse;
import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -78,7 +79,9 @@
*
* <p>{@link StreamWriter} will use the credentials set on the channel, which uses application
* default credentials through {@link GoogleCredentials#getApplicationDefault} by default.
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class StreamWriter implements AutoCloseable {
private static final Logger LOG = Logger.getLogger(StreamWriter.class.getName());

Expand Down
Expand Up @@ -19,6 +19,8 @@
import com.google.api.core.InternalApi;
import com.google.api.gax.batching.FlowControlSettings;
import com.google.api.gax.batching.FlowController;
import com.google.cloud.GcpLaunchStage;

import java.util.LinkedList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.Lock;
Expand All @@ -28,7 +30,9 @@
/**
* A barrier kind of object that helps keep track of pending actions and synchronously wait until
* all have completed.
* @deprecated
*/
@GcpLaunchStage.Deprecated
class Waiter {
private static final Logger LOG = Logger.getLogger(Waiter.class.getName());

Expand Down
Expand Up @@ -15,6 +15,7 @@
*/
package com.google.cloud.bigquery.storage.v1alpha2;

import com.google.cloud.GcpLaunchStage;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.cache.Cache;
Expand All @@ -32,7 +33,9 @@
* A cache of StreamWriters that can be looked up by Table Name. The entries will expire after 5
* minutes if not used. Code sample: WriterCache cache = WriterCache.getInstance(); StreamWriter
* writer = cache.getWriter(); // Use... cache.returnWriter(writer);
* @deprecated
*/
@GcpLaunchStage.Deprecated
public class WriterCache {
private static final Logger LOG = Logger.getLogger(WriterCache.class.getName());

Expand Down