Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

Commit 259391b

Browse files
committed
[squash this commit] Fix clirr errors
1 parent c42e1cb commit 259391b

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/Exceptions.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,23 @@ protected InflightBytesLimitExceededException(String writerId, long currentLimit
362362
currentLimit);
363363
}
364364
}
365+
366+
/**
367+
* This class is replaced by a generic one. It will be removed soon. Please use {@link
368+
* DataHasUnknownFieldException}
369+
*/
370+
public static final class JsonDataHasUnknownFieldException extends DataHasUnknownFieldException {
371+
protected JsonDataHasUnknownFieldException(String jsonFieldName) {
372+
super(jsonFieldName);
373+
}
374+
}
365375
/**
366376
* Input data object has unknown field to the schema of the SchemaAwareStreamWriter. User can
367377
* either turn on IgnoreUnknownFields option on the SchemaAwareStreamWriter, or if they don't want
368378
* the error to be ignored, they should recreate the SchemaAwareStreamWriter with the updated
369379
* table schema.
370380
*/
371-
public static final class DataHasUnknownFieldException extends IllegalArgumentException {
381+
public static class DataHasUnknownFieldException extends IllegalArgumentException {
372382
private final String jsonFieldName;
373383

374384
public DataHasUnknownFieldException(String jsonFieldName) {

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonStreamWriter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,11 @@ public Builder setIgnoreUnknownFields(boolean ignoreUnknownFields) {
306306
return this;
307307
}
308308

309+
/** This parameter is not used. It will be removed soon. */
310+
public Builder setReconnectAfter10M(boolean reconnectAfter10M) {
311+
return this;
312+
}
313+
309314
/**
310315
* Enable multiplexing for this writer. In multiplexing mode tables will share the same
311316
* connection if possible until the connection is overwhelmed. This feature is still under

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/JsonToProtoMessage.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
* Converts JSON data to Protobuf messages given the Protobuf descriptor and BigQuery table schema.
4949
* The Protobuf descriptor must have all fields lowercased.
5050
*/
51-
public final class JsonToProtoMessage implements ToProtoConverter<Object> {
51+
public class JsonToProtoMessage implements ToProtoConverter<Object> {
5252
public static final JsonToProtoMessage INSTANCE = new JsonToProtoMessage();
5353
private static final Logger LOG = Logger.getLogger(JsonToProtoMessage.class.getName());
5454
private static int NUMERIC_SCALE = 9;
@@ -103,7 +103,25 @@ public final class JsonToProtoMessage implements ToProtoConverter<Object> {
103103
.toFormatter()
104104
.withZone(ZoneOffset.UTC);
105105

106-
private JsonToProtoMessage() {}
106+
/** You can use {@link JsonToProtoMessage.INSTANCE} instead */
107+
public JsonToProtoMessage() {}
108+
109+
public static DynamicMessage convertJsonToProtoMessage(
110+
Descriptor protoSchema,
111+
TableSchema tableSchema,
112+
JSONObject json,
113+
boolean ignoreUnknownFields) {
114+
return INSTANCE.convertToProtoMessage(protoSchema, tableSchema, json, ignoreUnknownFields);
115+
}
116+
117+
public static DynamicMessage convertJsonToProtoMessage(Descriptor protoSchema, JSONObject json) {
118+
return INSTANCE.convertToProtoMessage(protoSchema, json);
119+
}
120+
121+
public static DynamicMessage convertJsonToProtoMessage(
122+
Descriptor protoSchema, TableSchema tableSchema, JSONObject json) {
123+
return INSTANCE.convertToProtoMessage(protoSchema, tableSchema, json);
124+
}
107125

108126
/**
109127
* Converts input message to Protobuf

0 commit comments

Comments
 (0)