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: migrate from google-http-client-jackson2 to google-http-client-gson #2471

Merged
merged 6 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ If you are using Maven without BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies:

```Groovy
implementation platform('com.google.cloud:libraries-bom:26.3.0')
implementation platform('com.google.cloud:libraries-bom:26.4.0')

implementation 'com.google.cloud:google-cloud-bigquery'
```
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-bigquery:2.20.1'
implementation 'com.google.cloud:google-cloud-bigquery:2.20.2'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.1"
libraryDependencies += "com.google.cloud" % "google-cloud-bigquery" % "2.20.2"
```

## Authentication
Expand Down
2 changes: 1 addition & 1 deletion google-cloud-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-jackson2</artifactId>
<artifactId>google-http-client-gson</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.google.cloud.bigquery.benchmark;

import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.FieldValue;
Expand All @@ -40,7 +40,7 @@ public static void main(String[] args) throws Exception {
return;
}
String[] requests =
new JacksonFactory()
new GsonFactory()
.createJsonParser(new FileInputStream(args[0]))
.parseAndClose(String[].class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.json.JsonHttpContent;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.core.InternalApi;
import com.google.api.core.InternalExtensionOnly;
import com.google.api.services.bigquery.Bigquery;
Expand Down Expand Up @@ -105,7 +105,7 @@ public HttpBigQueryRpc(BigQueryOptions options) {
HttpRequestInitializer initializer = transportOptions.getHttpRequestInitializer(options);
this.options = options;
bigquery =
new Bigquery.Builder(transport, new JacksonFactory(), initializer)
new Bigquery.Builder(transport, new GsonFactory(), initializer)
.setRootUrl(options.getHost())
.setApplicationName(options.getApplicationName())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.client.util.store.FileDataStoreFactory;
import com.google.api.gax.paging.Page;
import com.google.auth.oauth2.GoogleCredentials;
Expand All @@ -49,7 +49,7 @@ public class AuthUserFlow {

private static final File DATA_STORE_DIR =
new File(AuthUserFlow.class.getResource("/").getPath(), "credentials");
private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
// i.e redirect_uri http://localhost:61984/Callback
private static final int LOCAL_RECEIVER_PORT = 61984;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.api.client.util.store.FileDataStoreFactory;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.UserCredentials;
Expand All @@ -49,7 +49,7 @@ public class AuthUserQuery {

private static final File DATA_STORE_DIR =
new File(AuthUserQuery.class.getResource("/").getPath(), "credentials");
private static final JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
private static final JsonFactory JSON_FACTORY = GsonFactory.getDefaultInstance();
// i.e redirect_uri http://localhost:61984/Callback
private static final int LOCAL_RECEIVER_PORT = 61984;

Expand Down