Skip to content

Commit 5152d79

Browse files
authored
Merge branch 'main' into netty-upgrade
2 parents 80f1a35 + 85f51b2 commit 5152d79

36 files changed

Lines changed: 364 additions & 270 deletions

generation_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2209,7 +2209,7 @@ libraries:
22092209
GAPICs:
22102210
- proto_path: google/cloud/run/v2
22112211
- api_shortname: saasservicemgmt
2212-
name_pretty: SaaS Runtime API
2212+
name_pretty: App Lifecycle Manager
22132213
product_documentation: https://cloud.google.com/saas-runtime/docs/overview
22142214
api_description: "Model, deploy, and operate your SaaS at scale.\t"
22152215
client_documentation:

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@
1616

1717
package com.google.cloud.bigquery.exception;
1818

19+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
1920
import java.sql.SQLException;
2021

2122
/**
2223
* Exception for errors that occur when the driver cannot convert a value from one type to another.
2324
*/
2425
public class BigQueryConversionException extends SQLException {
26+
private static final BigQueryJdbcCustomLogger LOG =
27+
new BigQueryJdbcCustomLogger(BigQueryConversionException.class.getName());
2528

2629
public BigQueryConversionException(String message, Throwable cause) {
2730
super(message, cause);
31+
LOG.severe(message, this);
2832
}
2933
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
package com.google.cloud.bigquery.exception;
1818

1919
import com.google.api.core.InternalApi;
20+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
2021

2122
/**
2223
* Thrown to indicate that the coercion was attempted but couldn't be performed successfully because
2324
* of some error.
2425
*/
2526
@InternalApi
2627
public class BigQueryJdbcCoercionException extends RuntimeException {
28+
private static final BigQueryJdbcCustomLogger LOG =
29+
new BigQueryJdbcCustomLogger(BigQueryJdbcCoercionException.class.getName());
2730

2831
/**
2932
* Construct a new exception with the specified cause.
@@ -32,5 +35,6 @@ public class BigQueryJdbcCoercionException extends RuntimeException {
3235
*/
3336
public BigQueryJdbcCoercionException(Exception cause) {
3437
super("Coercion error", cause);
38+
LOG.severe("Coercion error", this);
3539
}
3640
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionNotFoundException.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,16 @@
1717
package com.google.cloud.bigquery.exception;
1818

1919
import com.google.api.core.InternalApi;
20+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
2021

2122
/**
2223
* Thrown to indicate that the current TypeCoercer can not perform the coercion as the Coercion
2324
* implementation is not registered for the mentioned source and target type.
2425
*/
2526
@InternalApi
2627
public class BigQueryJdbcCoercionNotFoundException extends RuntimeException {
28+
private static final BigQueryJdbcCustomLogger LOG =
29+
new BigQueryJdbcCustomLogger(BigQueryJdbcCoercionNotFoundException.class.getName());
2730

2831
/**
2932
* Construct a new exception.
@@ -36,5 +39,6 @@ public BigQueryJdbcCoercionNotFoundException(Class<?> source, Class<?> target) {
3639
String.format(
3740
"Coercion not found for [%s -> %s] conversion",
3841
source.getCanonicalName(), target.getCanonicalName()));
42+
LOG.severe(this.getMessage(), this);
3943
}
4044
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcException.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@
1717
package com.google.cloud.bigquery.exception;
1818

1919
import com.google.cloud.bigquery.BigQueryException;
20+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
2021
import java.sql.SQLException;
2122

2223
public class BigQueryJdbcException extends SQLException {
24+
private static final BigQueryJdbcCustomLogger LOG =
25+
new BigQueryJdbcCustomLogger(BigQueryJdbcException.class.getName());
2326
private BigQueryException bigQueryException = null;
2427

2528
/**
@@ -29,6 +32,7 @@ public class BigQueryJdbcException extends SQLException {
2932
*/
3033
public BigQueryJdbcException(String message) {
3134
super(message);
35+
LOG.severe(message, this);
3236
}
3337

3438
/**
@@ -38,16 +42,19 @@ public BigQueryJdbcException(String message) {
3842
*/
3943
public BigQueryJdbcException(InterruptedException ex) {
4044
super(ex);
45+
LOG.severe(ex.getMessage(), this);
4146
}
4247

4348
/**
4449
* Constructs a new BigQueryJdbcException from BigQueryException
4550
*
51+
* @param message Specific message that is being added to the Exception.
4652
* @param ex The BigQueryException to be thrown.
4753
*/
48-
public BigQueryJdbcException(BigQueryException ex) {
49-
super(ex);
54+
public BigQueryJdbcException(String message, BigQueryException ex) {
55+
super(message, ex);
5056
this.bigQueryException = ex;
57+
LOG.severe(ex.getMessage(), this);
5158
}
5259

5360
/**
@@ -58,6 +65,7 @@ public BigQueryJdbcException(BigQueryException ex) {
5865
*/
5966
public BigQueryJdbcException(String message, Throwable cause) {
6067
super(message, cause);
68+
LOG.severe(message, this);
6169
}
6270

6371
/**
@@ -68,6 +76,7 @@ public BigQueryJdbcException(String message, Throwable cause) {
6876
*/
6977
public BigQueryJdbcException(Throwable cause) {
7078
super(cause);
79+
LOG.severe(cause.getMessage(), this);
7180
}
7281

7382
public BigQueryException getBigQueryException() {

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcRuntimeException.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@
1616

1717
package com.google.cloud.bigquery.exception;
1818

19+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
20+
1921
public class BigQueryJdbcRuntimeException extends RuntimeException {
2022

23+
private static final BigQueryJdbcCustomLogger LOG =
24+
new BigQueryJdbcCustomLogger(BigQueryJdbcRuntimeException.class.getName());
25+
2126
/**
2227
* Constructs a new BigQueryJdbcRuntimeException with the given message.
2328
*
2429
* @param message The detail message.
2530
*/
2631
public BigQueryJdbcRuntimeException(String message) {
2732
super(message);
33+
LOG.severe(message, this);
2834
}
2935

3036
/**
@@ -34,6 +40,7 @@ public BigQueryJdbcRuntimeException(String message) {
3440
*/
3541
public BigQueryJdbcRuntimeException(Throwable ex) {
3642
super(ex);
43+
LOG.severe(ex.getMessage(), this);
3744
}
3845

3946
/**
@@ -44,5 +51,11 @@ public BigQueryJdbcRuntimeException(Throwable ex) {
4451
*/
4552
public BigQueryJdbcRuntimeException(String message, InterruptedException ex) {
4653
super(message, ex);
54+
LOG.severe(message, this);
55+
}
56+
57+
public BigQueryJdbcRuntimeException(String message, Throwable ex) {
58+
super(message, ex);
59+
LOG.severe(message, this);
4760
}
4861
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlFeatureNotSupportedException.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@
1717
package com.google.cloud.bigquery.exception;
1818

1919
import com.google.cloud.bigquery.BigQueryException;
20+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
2021
import java.sql.SQLFeatureNotSupportedException;
2122

2223
public class BigQueryJdbcSqlFeatureNotSupportedException extends SQLFeatureNotSupportedException {
24+
private static final BigQueryJdbcCustomLogger LOG =
25+
new BigQueryJdbcCustomLogger(BigQueryJdbcSqlFeatureNotSupportedException.class.getName());
26+
2327
/**
2428
* Constructs a new BigQueryJdbcSqlFeatureNotSupportedException with the given message.
2529
*
2630
* @param message The detail message.
2731
*/
2832
public BigQueryJdbcSqlFeatureNotSupportedException(String message) {
2933
super(message);
34+
LOG.severe(message, this);
3035
}
3136

3237
/**
@@ -36,5 +41,6 @@ public BigQueryJdbcSqlFeatureNotSupportedException(String message) {
3641
*/
3742
public BigQueryJdbcSqlFeatureNotSupportedException(BigQueryException ex) {
3843
super(ex);
44+
LOG.severe(ex.getMessage(), this);
3945
}
4046
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcSqlSyntaxErrorException.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.bigquery.exception;
1818

1919
import com.google.cloud.bigquery.BigQueryException;
20+
import com.google.cloud.bigquery.jdbc.BigQueryJdbcCustomLogger;
2021
import java.sql.SQLSyntaxErrorException;
2122

2223
/**
@@ -25,12 +26,21 @@
2526
* rules.
2627
*/
2728
public class BigQueryJdbcSqlSyntaxErrorException extends SQLSyntaxErrorException {
29+
private static final BigQueryJdbcCustomLogger LOG =
30+
new BigQueryJdbcCustomLogger(BigQueryJdbcSqlSyntaxErrorException.class.getName());
31+
2832
/**
2933
* Constructs a new BigQueryJdbcSqlSyntaxErrorException from BigQueryException
3034
*
3135
* @param ex The BigQueryException to be thrown.
3236
*/
3337
public BigQueryJdbcSqlSyntaxErrorException(BigQueryException ex) {
3438
super(ex.getMessage(), "Incorrect SQL syntax.");
39+
LOG.severe(ex.getMessage(), this);
40+
}
41+
42+
public BigQueryJdbcSqlSyntaxErrorException(String message, BigQueryException ex) {
43+
super(message, ex);
44+
LOG.severe(message, this);
3545
}
3646
}

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryArrowResultSet.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private BigQueryArrowResultSet(
108108
try {
109109
this.arrowDeserializer = new ArrowDeserializer(arrowSchema);
110110
} catch (IOException ex) {
111-
throw new BigQueryJdbcException(ex);
111+
throw new BigQueryJdbcException("IOException during ArrowDeserializer creation", ex);
112112
}
113113
}
114114
}
@@ -215,8 +215,11 @@ public boolean next() throws SQLException {
215215
checkClosed();
216216
if (this.isNested) {
217217
if (this.currentNestedBatch == null || this.currentNestedBatch.getNestedRecords() == null) {
218-
throw new IllegalStateException(
219-
"currentNestedBatch/JsonStringArrayList can not be null working with the nested record");
218+
IllegalStateException ex =
219+
new IllegalStateException(
220+
"currentNestedBatch/JsonStringArrayList can not be null working with the nested record");
221+
LOG.severe(ex.getMessage(), ex);
222+
throw ex;
220223
}
221224
if (this.nestedRowIndex < (this.toIndexExclusive - 1)) {
222225
/* Check if there's a next record in the array which can be read */
@@ -283,12 +286,16 @@ private Object getObjectInternal(int columnIndex) throws SQLException {
283286
// BigQuery doesn't support multidimensional arrays, so
284287
// just the default row num column (1) and the actual column (2) is supposed to be read
285288
if (!(columnIndex == 1 || columnIndex == 2)) {
286-
287-
throw new IllegalArgumentException(
288-
"Column index is required to be 1 or 2 for nested arrays");
289+
IllegalArgumentException ex =
290+
new IllegalArgumentException("Column index is required to be 1 or 2 for nested arrays");
291+
LOG.severe(ex.getMessage(), ex);
292+
throw ex;
289293
}
290294
if (this.currentNestedBatch.getNestedRecords() == null) {
291-
throw new IllegalStateException("JsonStringArrayList cannot be null for nested records.");
295+
IllegalStateException ex =
296+
new IllegalStateException("JsonStringArrayList cannot be null for nested records.");
297+
LOG.severe(ex.getMessage(), ex);
298+
throw ex;
292299
}
293300
// For Arrays the first column is Index, ref:
294301
// https://docs.oracle.com/javase/7/docs/api/java/sql/Array.html#getResultSet()

java-bigquery/google-cloud-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseArray.java

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,36 +71,24 @@ public final int getBaseType() {
7171

7272
@Override
7373
public final Object getArray(Map<String, Class<?>> map) throws SQLException {
74-
BigQueryJdbcSqlFeatureNotSupportedException ex =
75-
new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
76-
LOG.severe(ex, CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
77-
throw ex;
74+
throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
7875
}
7976

8077
@Override
8178
public final Object getArray(long index, int count, Map<String, Class<?>> map)
8279
throws SQLException {
83-
BigQueryJdbcSqlFeatureNotSupportedException ex =
84-
new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
85-
LOG.severe(ex, CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
86-
throw ex;
80+
throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
8781
}
8882

8983
@Override
9084
public final ResultSet getResultSet(Map<String, Class<?>> map) throws SQLException {
91-
BigQueryJdbcSqlFeatureNotSupportedException ex =
92-
new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
93-
LOG.severe(ex, CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
94-
throw ex;
85+
throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
9586
}
9687

9788
@Override
9889
public final ResultSet getResultSet(long index, int count, Map<String, Class<?>> map)
9990
throws SQLException {
100-
BigQueryJdbcSqlFeatureNotSupportedException ex =
101-
new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
102-
LOG.severe(ex, CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
103-
throw ex;
91+
throw new BigQueryJdbcSqlFeatureNotSupportedException(CUSTOMER_TYPE_MAPPING_NOT_SUPPORTED);
10492
}
10593

10694
protected Object getArrayInternal(int fromIndex, int toIndexExclusive) {
@@ -119,7 +107,7 @@ protected void ensureValid() throws IllegalStateException {
119107
LOG.finest("++enter++");
120108
if (!this.valid) {
121109
IllegalStateException ex = new IllegalStateException(INVALID_ARRAY);
122-
LOG.severe(ex, INVALID_ARRAY);
110+
LOG.severe(INVALID_ARRAY, ex);
123111
throw ex;
124112
}
125113
}
@@ -146,7 +134,7 @@ protected Tuple<Integer, Integer> createRange(long index, int count, int size)
146134
String.format(
147135
"The array index is out of range: %d, number of elements: %d.",
148136
index + count, size));
149-
LOG.severe(ex, ex.getMessage());
137+
LOG.severe(ex.getMessage(), ex);
150138
throw ex;
151139
}
152140
long toIndex = normalisedFromIndex + count;

0 commit comments

Comments
 (0)