Skip to content

Commit 9206561

Browse files
committed
fine tune logs messages
1 parent 7ab5cdb commit 9206561

7 files changed

Lines changed: 161 additions & 10 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,14 @@ static BigQueryArrowBatchWrapper ofError(Exception exception) {
6363
}
6464

6565
ArrowRecordBatch getCurrentArrowBatch() {
66-
LOG.finest("++enter++");
6766
return this.currentArrowBatch;
6867
}
6968

7069
JsonStringArrayList getNestedRecords() {
71-
LOG.finest("++enter++");
7270
return this.nestedRecords;
7371
}
7472

7573
boolean isLast() {
76-
LOG.finest("++enter++");
7774
return this.isLast;
7875
}
7976

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ private ArrowDeserializer(ArrowSchema arrowSchema) throws IOException {
181181
}
182182

183183
private void deserializeArrowBatch(ArrowRecordBatch batch) throws SQLException {
184-
LOG.finest("++enter++");
185184
try {
186185
if (vectorSchemaRoot != null) {
187186
// Clear vectorSchemaRoot before populating a new batch
@@ -516,7 +515,6 @@ public boolean isFirst() throws SQLException {
516515

517516
@Override
518517
public boolean isLast() throws SQLException {
519-
LOG.finest("++enter++");
520518
checkClosed();
521519
if (this.isNested) {
522520
return this.nestedRowIndex == this.toIndexExclusive - 1;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ public class BigQueryConnection extends BigQueryNoOpsConnection {
153153
try (BigQueryJdbcMdc.MdcCloseable mdc =
154154
BigQueryJdbcMdc.registerInstance(this, this.connectionId)) {
155155
LOG.finest("++enter++");
156+
LOG.info("Initializing BigQuery Connection with properties: %s", ds.toString());
156157

157158
this.connectionUrl = url;
158159
this.openStatements = ConcurrentHashMap.newKeySet();
@@ -964,7 +965,6 @@ public void setHoldability(int holdability) throws SQLException {
964965
*/
965966
@Override
966967
public void close() throws SQLException {
967-
LOG.finest("++enter++");
968968
if (isClosed()) {
969969
return;
970970
}
@@ -1010,7 +1010,6 @@ private void closeImpl() throws SQLException {
10101010

10111011
@Override
10121012
public boolean isClosed() {
1013-
LOG.finest("++enter++");
10141013
return this.isClosed;
10151014
}
10161015

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,6 @@ private static Map<String, String> parseUrlInternal(String url) {
726726
* @return The string value of the updated URL.
727727
*/
728728
static String appendPropertiesToURL(String url, String callerClassName, Properties properties) {
729-
LOG.finest("++enter++ " + callerClassName);
730729
StringBuilder urlBuilder = new StringBuilder(url);
731730
for (Entry<Object, Object> entry : properties.entrySet()) {
732731
if (entry.getValue() != null && !"".equals(entry.getValue())) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ public boolean isFirst() throws SQLException {
346346
@Override
347347
public boolean isLast() throws SQLException {
348348
checkClosed();
349-
LOG.finest("++enter++");
350349
if (this.isNested) {
351350
return this.nestedRowIndex == this.toIndexExclusive - 1;
352351
} else {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,9 @@ public String toString() {
460460
+ ", "
461461
+ "maxBytesBilled="
462462
+ maxBytesBilled
463+
+ ", "
464+
+ "labels="
465+
+ labels
463466
+ "}";
464467
}
465468

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

Lines changed: 157 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
* registered with a naming service based on the Java™ Naming and Directory (JNDI) API.
4141
*/
4242
public class DataSource implements javax.sql.DataSource {
43-
private final BigQueryJdbcCustomLogger LOG = new BigQueryJdbcCustomLogger(this.toString());
43+
private static final BigQueryJdbcCustomLogger LOG =
44+
new BigQueryJdbcCustomLogger(DataSource.class.toString());
4445
private String URL;
4546
static final ImmutableSet<Integer> VALID_JOB_CREATION_MODES = ImmutableSet.of(1, 2);
4647

@@ -1261,6 +1262,161 @@ public void setPrivateServiceConnect(String privateServiceConnect) {
12611262
this.privateServiceConnect = privateServiceConnect;
12621263
}
12631264

1265+
@Override
1266+
public String toString() {
1267+
return "DataSource{"
1268+
+ "projectId='"
1269+
+ projectId
1270+
+ '\''
1271+
+ ", defaultDataset='"
1272+
+ defaultDataset
1273+
+ '\''
1274+
+ ", location='"
1275+
+ location
1276+
+ '\''
1277+
+ ", userAgent='"
1278+
+ userAgent
1279+
+ '\''
1280+
+ ", enableHighThroughputAPI="
1281+
+ enableHighThroughputAPI
1282+
+ ", highThroughputMinTableSize="
1283+
+ highThroughputMinTableSize
1284+
+ ", highThroughputActivationRatio="
1285+
+ highThroughputActivationRatio
1286+
+ ", unsupportedHTAPIFallback="
1287+
+ unsupportedHTAPIFallback
1288+
+ ", kmsKeyName='"
1289+
+ kmsKeyName
1290+
+ '\''
1291+
+ ", queryProperties="
1292+
+ queryProperties
1293+
+ ", logLevel='"
1294+
+ logLevel
1295+
+ '\''
1296+
+ ", enableSession="
1297+
+ enableSession
1298+
+ ", logPath='"
1299+
+ logPath
1300+
+ '\''
1301+
+ ", oAuthType="
1302+
+ oAuthType
1303+
+ ", oAuthServiceAcctEmail='"
1304+
+ oAuthServiceAcctEmail
1305+
+ '\''
1306+
+ ", useQueryCache="
1307+
+ useQueryCache
1308+
+ ", queryDialect='"
1309+
+ queryDialect
1310+
+ '\''
1311+
+ ", allowLargeResults="
1312+
+ allowLargeResults
1313+
+ ", destinationTable='"
1314+
+ destinationTable
1315+
+ '\''
1316+
+ ", destinationDataset='"
1317+
+ destinationDataset
1318+
+ '\''
1319+
+ ", destinationDatasetExpirationTime="
1320+
+ destinationDatasetExpirationTime
1321+
+ ", universeDomain='"
1322+
+ universeDomain
1323+
+ '\''
1324+
+ ", proxyHost='"
1325+
+ proxyHost
1326+
+ '\''
1327+
+ ", proxyPort='"
1328+
+ proxyPort
1329+
+ '\''
1330+
+ ", proxyUid='"
1331+
+ proxyUid
1332+
+ '\''
1333+
+ ", oAuthClientId='"
1334+
+ oAuthClientId
1335+
+ '\''
1336+
+ ", jobCreationMode="
1337+
+ jobCreationMode
1338+
+ ", maxResults="
1339+
+ maxResults
1340+
+ ", partnerToken='"
1341+
+ partnerToken
1342+
+ '\''
1343+
+ ", enableWriteAPI="
1344+
+ enableWriteAPI
1345+
+ ", additionalProjects='"
1346+
+ additionalProjects
1347+
+ '\''
1348+
+ ", filterTablesOnDefaultDataset="
1349+
+ filterTablesOnDefaultDataset
1350+
+ ", requestGoogleDriveScope="
1351+
+ requestGoogleDriveScope
1352+
+ ", metadataFetchThreadCount="
1353+
+ metadataFetchThreadCount
1354+
+ ", sslTrustStorePath='"
1355+
+ sslTrustStorePath
1356+
+ '\''
1357+
+ ", labels="
1358+
+ labels
1359+
+ ", requestReason='"
1360+
+ requestReason
1361+
+ '\''
1362+
+ ", timeout="
1363+
+ timeout
1364+
+ ", jobTimeout="
1365+
+ jobTimeout
1366+
+ ", retryInitialDelay="
1367+
+ retryInitialDelay
1368+
+ ", retryMaxDelay="
1369+
+ retryMaxDelay
1370+
+ ", httpConnectTimeout="
1371+
+ httpConnectTimeout
1372+
+ ", httpReadTimeout="
1373+
+ httpReadTimeout
1374+
+ ", maximumBytesBilled="
1375+
+ maximumBytesBilled
1376+
+ ", swaActivationRowCount="
1377+
+ swaActivationRowCount
1378+
+ ", swaAppendRowCount="
1379+
+ swaAppendRowCount
1380+
+ ", oAuthSAImpersonationEmail='"
1381+
+ oAuthSAImpersonationEmail
1382+
+ '\''
1383+
+ ", oAuthSAImpersonationChain='"
1384+
+ oAuthSAImpersonationChain
1385+
+ '\''
1386+
+ ", oAuthSAImpersonationScopes='"
1387+
+ oAuthSAImpersonationScopes
1388+
+ '\''
1389+
+ ", oAuthSAImpersonationTokenLifetime='"
1390+
+ oAuthSAImpersonationTokenLifetime
1391+
+ '\''
1392+
+ ", oAuth2TokenUri='"
1393+
+ oAuth2TokenUri
1394+
+ '\''
1395+
+ ", byoidAudienceUri='"
1396+
+ byoidAudienceUri
1397+
+ '\''
1398+
+ ", byoidPoolUserProject='"
1399+
+ byoidPoolUserProject
1400+
+ '\''
1401+
+ ", byoidSubjectTokenType='"
1402+
+ byoidSubjectTokenType
1403+
+ '\''
1404+
+ ", byoidTokenUri='"
1405+
+ byoidTokenUri
1406+
+ '\''
1407+
+ ", endpointOverrides='"
1408+
+ endpointOverrides
1409+
+ '\''
1410+
+ ", privateServiceConnect='"
1411+
+ privateServiceConnect
1412+
+ '\''
1413+
+ ", connectionPoolSize="
1414+
+ connectionPoolSize
1415+
+ ", listenerPoolSize="
1416+
+ listenerPoolSize
1417+
+ '}';
1418+
}
1419+
12641420
@Override
12651421
public PrintWriter getLogWriter() {
12661422
return null;

0 commit comments

Comments
 (0)