-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the option to use parent project for the metadata/jobs API as well
- Loading branch information
1 parent
c1b3f3c
commit 875d23b
Showing
11 changed files
with
142 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...y-connector-common/src/main/java/com/google/cloud/bigquery/connector/common/HttpUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.google.cloud.bigquery.connector.common; | ||
|
||
import com.google.api.gax.rpc.FixedHeaderProvider; | ||
import com.google.api.gax.rpc.HeaderProvider; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class HttpUtil { | ||
|
||
private HttpUtil() {} | ||
|
||
public static HeaderProvider createHeaderProvider(BigQueryConfig config, String userAgent) { | ||
Map<String, String> headers = new HashMap<>(); | ||
if (config.useParentProjectForMetadataOperations()) { | ||
headers.put("X-Goog-User-Project", config.getParentProjectId()); | ||
} | ||
headers.put("user-agent", userAgent); | ||
return FixedHeaderProvider.create(headers); | ||
} | ||
} |
53 changes: 0 additions & 53 deletions
53
...mon/src/main/java/com/google/cloud/bigquery/connector/common/UserAgentHeaderProvider.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.