diff --git a/.github/.OwlBot.yaml b/.github/.OwlBot.yaml index d4d02a44ab..1a3a604eaf 100644 --- a/.github/.OwlBot.yaml +++ b/.github/.OwlBot.yaml @@ -76,6 +76,7 @@ deep-preserve-regex: - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1.*/StreamWriter.java" - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1.*/StreamWriterV2.java" - "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1.*/Waiter.java" +- "/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/Exceptions.java" deep-copy-regex: - source: "/google/cloud/bigquery/storage/(v.*)/.*-java/proto-google-.*/src" diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java index 83c4d38fdf..d32e0fb92b 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/StreamProto.java @@ -94,26 +94,29 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\001(\tB\003\340A\003:{\352Ax\n)bigquerystorage.googleapi" + "s.com/ReadStream\022Kprojects/{project}/loc" + "ations/{location}/sessions/{session}/str" - + "eams/{stream}\"\335\003\n\013WriteStream\022\021\n\004name\030\001 " + + "eams/{stream}\"\344\004\n\013WriteStream\022\021\n\004name\030\001 " + "\001(\tB\003\340A\003\022E\n\004type\030\002 \001(\01622.google.cloud.bi" + "gquery.storage.v1.WriteStream.TypeB\003\340A\005\022" + "4\n\013create_time\030\003 \001(\0132\032.google.protobuf.T" + "imestampB\003\340A\003\0224\n\013commit_time\030\004 \001(\0132\032.goo" + "gle.protobuf.TimestampB\003\340A\003\022H\n\014table_sch" + "ema\030\005 \001(\0132-.google.cloud.bigquery.storag" - + "e.v1.TableSchemaB\003\340A\003\"F\n\004Type\022\024\n\020TYPE_UN" - + "SPECIFIED\020\000\022\r\n\tCOMMITTED\020\001\022\013\n\007PENDING\020\002\022" - + "\014\n\010BUFFERED\020\003:v\352As\n*bigquerystorage.goog" - + "leapis.com/WriteStream\022Eprojects/{projec" - + "t}/datasets/{dataset}/tables/{table}/str" - + "eams/{stream}*>\n\nDataFormat\022\033\n\027DATA_FORM" - + "AT_UNSPECIFIED\020\000\022\010\n\004AVRO\020\001\022\t\n\005ARROW\020\002B\304\001" - + "\n$com.google.cloud.bigquery.storage.v1B\013" - + "StreamProtoP\001ZGgoogle.golang.org/genprot" - + "o/googleapis/cloud/bigquery/storage/v1;s" - + "torage\252\002 Google.Cloud.BigQuery.Storage.V" - + "1\312\002 Google\\Cloud\\BigQuery\\Storage\\V1b\006pr" - + "oto3" + + "e.v1.TableSchemaB\003\340A\003\022P\n\nwrite_mode\030\007 \001(" + + "\01627.google.cloud.bigquery.storage.v1.Wri" + + "teStream.WriteModeB\003\340A\005\"F\n\004Type\022\024\n\020TYPE_" + + "UNSPECIFIED\020\000\022\r\n\tCOMMITTED\020\001\022\013\n\007PENDING\020" + + "\002\022\014\n\010BUFFERED\020\003\"3\n\tWriteMode\022\032\n\026WRITE_MO" + + "DE_UNSPECIFIED\020\000\022\n\n\006INSERT\020\001:v\352As\n*bigqu" + + "erystorage.googleapis.com/WriteStream\022Ep" + + "rojects/{project}/datasets/{dataset}/tab" + + "les/{table}/streams/{stream}*>\n\nDataForm" + + "at\022\033\n\027DATA_FORMAT_UNSPECIFIED\020\000\022\010\n\004AVRO\020" + + "\001\022\t\n\005ARROW\020\002B\304\001\n$com.google.cloud.bigque" + + "ry.storage.v1B\013StreamProtoP\001ZGgoogle.gol" + + "ang.org/genproto/googleapis/cloud/bigque" + + "ry/storage/v1;storage\252\002 Google.Cloud.Big" + + "Query.Storage.V1\312\002 Google\\Cloud\\BigQuery" + + "\\Storage\\V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -181,7 +184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_bigquery_storage_v1_WriteStream_descriptor, new java.lang.String[] { - "Name", "Type", "CreateTime", "CommitTime", "TableSchema", + "Name", "Type", "CreateTime", "CommitTime", "TableSchema", "WriteMode", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java index 2e2faa4048..8c67982561 100644 --- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java +++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStream.java @@ -40,6 +40,7 @@ private WriteStream(com.google.protobuf.GeneratedMessageV3.Builder> builder) { private WriteStream() { name_ = ""; type_ = 0; + writeMode_ = 0; } @java.lang.Override @@ -129,6 +130,13 @@ private WriteStream( tableSchema_ = subBuilder.buildPartial(); } + break; + } + case 56: + { + int rawValue = input.readEnum(); + + writeMode_ = rawValue; break; } default: @@ -346,6 +354,143 @@ private Type(int value) { // @@protoc_insertion_point(enum_scope:google.cloud.bigquery.storage.v1.WriteStream.Type) } + /** + * + * + *
+ * Mode enum of the stream. + *+ * + * Protobuf enum {@code google.cloud.bigquery.storage.v1.WriteStream.WriteMode} + */ + public enum WriteMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+ * Unknown type. + *+ * + *
WRITE_MODE_UNSPECIFIED = 0;
+ */
+ WRITE_MODE_UNSPECIFIED(0),
+ /**
+ *
+ *
+ * + * Insert new records into the table. + * It is the default value if customers do not specify it. + *+ * + *
INSERT = 1;
+ */
+ INSERT(1),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ *
+ *
+ * + * Unknown type. + *+ * + *
WRITE_MODE_UNSPECIFIED = 0;
+ */
+ public static final int WRITE_MODE_UNSPECIFIED_VALUE = 0;
+ /**
+ *
+ *
+ * + * Insert new records into the table. + * It is the default value if customers do not specify it. + *+ * + *
INSERT = 1;
+ */
+ public static final int INSERT_VALUE = 1;
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static WriteMode valueOf(int value) {
+ return forNumber(value);
+ }
+
+ /**
+ * @param value The numeric wire value of the corresponding enum entry.
+ * @return The enum associated with the given numeric wire value.
+ */
+ public static WriteMode forNumber(int value) {
+ switch (value) {
+ case 0:
+ return WRITE_MODE_UNSPECIFIED;
+ case 1:
+ return INSERT;
+ default:
+ return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return The enum numeric value on the wire for writeMode.
+ */
+ @java.lang.Override
+ public int getWriteModeValue() {
+ return writeMode_;
+ }
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return The writeMode.
+ */
+ @java.lang.Override
+ public com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode getWriteMode() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode result =
+ com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode.valueOf(writeMode_);
+ return result == null
+ ? com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode.UNRECOGNIZED
+ : result;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
@@ -642,6 +829,11 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
if (tableSchema_ != null) {
output.writeMessage(5, getTableSchema());
}
+ if (writeMode_
+ != com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode.WRITE_MODE_UNSPECIFIED
+ .getNumber()) {
+ output.writeEnum(7, writeMode_);
+ }
unknownFields.writeTo(output);
}
@@ -667,6 +859,11 @@ public int getSerializedSize() {
if (tableSchema_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getTableSchema());
}
+ if (writeMode_
+ != com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode.WRITE_MODE_UNSPECIFIED
+ .getNumber()) {
+ size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, writeMode_);
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -697,6 +894,7 @@ public boolean equals(final java.lang.Object obj) {
if (hasTableSchema()) {
if (!getTableSchema().equals(other.getTableSchema())) return false;
}
+ if (writeMode_ != other.writeMode_) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@@ -724,6 +922,8 @@ public int hashCode() {
hash = (37 * hash) + TABLE_SCHEMA_FIELD_NUMBER;
hash = (53 * hash) + getTableSchema().hashCode();
}
+ hash = (37 * hash) + WRITE_MODE_FIELD_NUMBER;
+ hash = (53 * hash) + writeMode_;
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -891,6 +1091,8 @@ public Builder clear() {
tableSchema_ = null;
tableSchemaBuilder_ = null;
}
+ writeMode_ = 0;
+
return this;
}
@@ -935,6 +1137,7 @@ public com.google.cloud.bigquery.storage.v1.WriteStream buildPartial() {
} else {
result.tableSchema_ = tableSchemaBuilder_.build();
}
+ result.writeMode_ = writeMode_;
onBuilt();
return result;
}
@@ -1001,6 +1204,9 @@ public Builder mergeFrom(com.google.cloud.bigquery.storage.v1.WriteStream other)
if (other.hasTableSchema()) {
mergeTableSchema(other.getTableSchema());
}
+ if (other.writeMode_ != 0) {
+ setWriteModeValue(other.getWriteModeValue());
+ }
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -1913,6 +2119,109 @@ public com.google.cloud.bigquery.storage.v1.TableSchemaOrBuilder getTableSchemaO
return tableSchemaBuilder_;
}
+ private int writeMode_ = 0;
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return The enum numeric value on the wire for writeMode.
+ */
+ @java.lang.Override
+ public int getWriteModeValue() {
+ return writeMode_;
+ }
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @param value The enum numeric value on the wire for writeMode to set.
+ * @return This builder for chaining.
+ */
+ public Builder setWriteModeValue(int value) {
+
+ writeMode_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return The writeMode.
+ */
+ @java.lang.Override
+ public com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode getWriteMode() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode result =
+ com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode.valueOf(writeMode_);
+ return result == null
+ ? com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode.UNRECOGNIZED
+ : result;
+ }
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @param value The writeMode to set.
+ * @return This builder for chaining.
+ */
+ public Builder setWriteMode(com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ writeMode_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return This builder for chaining.
+ */
+ public Builder clearWriteMode() {
+
+ writeMode_ = 0;
+ onChanged();
+ return this;
+ }
+
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java
index c14850b8a1..029de2eff0 100644
--- a/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java
+++ b/proto-google-cloud-bigquerystorage-v1/src/main/java/com/google/cloud/bigquery/storage/v1/WriteStreamOrBuilder.java
@@ -216,4 +216,33 @@ public interface WriteStreamOrBuilder
*
*/
com.google.cloud.bigquery.storage.v1.TableSchemaOrBuilder getTableSchemaOrBuilder();
+
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return The enum numeric value on the wire for writeMode.
+ */
+ int getWriteModeValue();
+ /**
+ *
+ *
+ * + * Immutable. Mode of the stream. + *+ * + *
+ * .google.cloud.bigquery.storage.v1.WriteStream.WriteMode write_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];
+ *
+ *
+ * @return The writeMode.
+ */
+ com.google.cloud.bigquery.storage.v1.WriteStream.WriteMode getWriteMode();
}
diff --git a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto
index dc62e8c00c..0b0bc1ad05 100644
--- a/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto
+++ b/proto-google-cloud-bigquerystorage-v1/src/main/proto/google/cloud/bigquery/storage/v1/stream.proto
@@ -171,6 +171,16 @@ message WriteStream {
BUFFERED = 3;
}
+ // Mode enum of the stream.
+ enum WriteMode {
+ // Unknown type.
+ WRITE_MODE_UNSPECIFIED = 0;
+
+ // Insert new records into the table.
+ // It is the default value if customers do not specify it.
+ INSERT = 1;
+ }
+
// Output only. Name of the stream, in the form
// `projects/{project}/datasets/{dataset}/tables/{table}/streams/{stream}`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
@@ -193,4 +203,7 @@ message WriteStream {
// compatible with this schema to send in initial `AppendRowsRequest`.
// The table schema could go out of date during the life time of the stream.
TableSchema table_schema = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // Immutable. Mode of the stream.
+ WriteMode write_mode = 7 [(google.api.field_behavior) = IMMUTABLE];
}