Skip to content

Commit 5dab791

Browse files
committed
---
yaml --- r: 2705 b: refs/heads/update-datastore c: b32e4b9 h: refs/heads/master i: 2703: c14a5c9
1 parent 38457c7 commit 5dab791

57 files changed

Lines changed: 2220 additions & 1284 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
66
refs/heads/pubsub-alpha: 1a0e970f265af871e02274085b9662b3fe29058b
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
8-
refs/heads/update-datastore: 767c41f875facfb08f71de2f35b43eb09e77fade
8+
refs/heads/update-datastore: b32e4b94a31584ea93b10c0cb3a87525c39df3e5
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444
1010
refs/tags/v0.0.10: 207ebd2a3472fddee69fe1298eb90429e3306efd
1111
refs/tags/v0.0.11: ffbfba48a6426ff63c08ff2117e58681f251fbf2

branches/update-datastore/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,23 @@ If you are using Maven, add this to your pom.xml file
2727
<dependency>
2828
<groupId>com.google.gcloud</groupId>
2929
<artifactId>gcloud-java</artifactId>
30-
<version>0.1.2</version>
30+
<version>0.1.1</version>
3131
</dependency>
3232
```
3333
If you are using Gradle, add this to your dependencies
3434
```Groovy
35-
compile 'com.google.gcloud:gcloud-java:0.1.2'
35+
compile 'com.google.gcloud:gcloud-java:0.1.1'
3636
```
3737
If you are using SBT, add this to your dependencies
3838
```Scala
39-
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.1.2"
39+
libraryDependencies += "com.google.gcloud" % "gcloud-java" % "0.1.1"
4040
```
4141

4242
Example Applications
4343
--------------------
4444

4545
- [`BigQueryExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/BigQueryExample.java) - A simple command line interface providing some of Cloud BigQuery's functionality
4646
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/BigQueryExample.html).
47-
- [`Bookshelf`](https://github.com/GoogleCloudPlatform/getting-started-java/tree/master/bookshelf) - An App Engine app that manages a virtual bookshelf.
48-
- This app uses `gcloud-java` to interface with Cloud Datastore and Cloud Storage. It also uses Cloud SQL, another Google Cloud Platform service.
4947
- [`DatastoreExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/DatastoreExample.java) - A simple command line interface for the Cloud Datastore
5048
- Read more about using this application on the [`gcloud-java-examples` docs page](http://googlecloudplatform.github.io/gcloud-java/apidocs/?com/google/gcloud/examples/DatastoreExample.html).
5149
- [`ResourceManagerExample`](https://github.com/GoogleCloudPlatform/gcloud-java/blob/master/gcloud-java-examples/src/main/java/com/google/gcloud/examples/ResourceManagerExample.java) - A simple command line interface providing some of Cloud Resource Manager's functionality

branches/update-datastore/gcloud-java-bigquery/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ If you are using Maven, add this to your pom.xml file
2020
<dependency>
2121
<groupId>com.google.gcloud</groupId>
2222
<artifactId>gcloud-java-bigquery</artifactId>
23-
<version>0.1.2</version>
23+
<version>0.1.1</version>
2424
</dependency>
2525
```
2626
If you are using Gradle, add this to your dependencies
2727
```Groovy
28-
compile 'com.google.gcloud:gcloud-java-bigquery:0.1.2'
28+
compile 'com.google.gcloud:gcloud-java-bigquery:0.1.1'
2929
```
3030
If you are using SBT, add this to your dependencies
3131
```Scala
32-
libraryDependencies += "com.google.gcloud" % "gcloud-java-bigquery" % "0.1.2"
32+
libraryDependencies += "com.google.gcloud" % "gcloud-java-bigquery" % "0.1.1"
3333
```
3434

3535
Example Application

branches/update-datastore/gcloud-java-bigquery/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>com.google.gcloud</groupId>
1313
<artifactId>gcloud-java-pom</artifactId>
14-
<version>0.1.3-SNAPSHOT</version>
14+
<version>0.1.2-SNAPSHOT</version>
1515
</parent>
1616
<properties>
1717
<site.installationModule>gcloud-java-bigquery</site.installationModule>

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQuery.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,4 +662,12 @@ Page<List<FieldValue>> listTableData(TableId tableId, TableDataListOption... opt
662662
* @throws BigQueryException upon failure
663663
*/
664664
QueryResponse getQueryResults(JobId job, QueryResultsOption... options) throws BigQueryException;
665+
666+
/**
667+
* Returns a channel to write data to be inserted into a BigQuery table. Data format and other
668+
* options can be configured using the {@link LoadConfiguration} parameter.
669+
*
670+
* @throws BigQueryException upon failure
671+
*/
672+
TableDataWriteChannel writer(LoadConfiguration loadConfiguration);
665673
}

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/BigQueryImpl.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,10 @@ private static QueryResult.Builder transformQueryResults(JobId jobId, List<Table
619619
.results(transformTableData(rowsPb));
620620
}
621621

622+
public TableDataWriteChannel writer(LoadConfiguration loadConfiguration) {
623+
return new TableDataWriteChannel(options(), setProjectId(loadConfiguration));
624+
}
625+
622626
private Map<BigQueryRpc.Option, ?> optionMap(Option... options) {
623627
Map<BigQueryRpc.Option, Object> optionMap = Maps.newEnumMap(BigQueryRpc.Option.class);
624628
for (Option option : options) {
@@ -698,8 +702,7 @@ public TableId apply(TableId tableId) {
698702
if (job instanceof LoadJobInfo) {
699703
LoadJobInfo loadJob = (LoadJobInfo) job;
700704
LoadJobInfo.Builder loadBuilder = loadJob.toBuilder();
701-
loadBuilder.destinationTable(setProjectId(loadJob.destinationTable()));
702-
return loadBuilder.build();
705+
return loadBuilder.configuration(setProjectId(loadJob.configuration())).build();
703706
}
704707
return job;
705708
}
@@ -711,4 +714,10 @@ private QueryRequest setProjectId(QueryRequest request) {
711714
}
712715
return builder.build();
713716
}
717+
718+
private LoadConfiguration setProjectId(LoadConfiguration configuration) {
719+
LoadConfiguration.Builder builder = configuration.toBuilder();
720+
builder.destinationTable(setProjectId(configuration.destinationTable()));
721+
return builder.build();
722+
}
714723
}

branches/update-datastore/gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery/CopyJobInfo.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public Builder destinationTable(TableId destinationTable) {
9595
/**
9696
* Sets whether the job is allowed to create new tables.
9797
*
98-
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.link">
99-
* Jobs: Link Configuration</a>
98+
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy.createDisposition">
99+
* Create Disposition</a>
100100
*/
101101
public Builder createDisposition(CreateDisposition createDisposition) {
102102
this.createDisposition = createDisposition;
@@ -106,8 +106,8 @@ public Builder createDisposition(CreateDisposition createDisposition) {
106106
/**
107107
* Sets the action that should occur if the destination table already exists.
108108
*
109-
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.link">
110-
* Jobs: Link Configuration</a>
109+
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy.writeDisposition">
110+
* Write Disposition</a>
111111
*/
112112
public Builder writeDisposition(WriteDisposition writeDisposition) {
113113
this.writeDisposition = writeDisposition;
@@ -145,8 +145,8 @@ public TableId destinationTable() {
145145
/**
146146
* Returns whether the job is allowed to create new tables.
147147
*
148-
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy">
149-
* Jobs: Copy Configuration</a>
148+
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy.createDisposition">
149+
* Create Disposition</a>
150150
*/
151151
public CreateDisposition createDisposition() {
152152
return this.createDisposition;
@@ -155,8 +155,8 @@ public CreateDisposition createDisposition() {
155155
/**
156156
* Returns the action that should occur if the destination table already exists.
157157
*
158-
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy">
159-
* Jobs: Copy Configuration</a>
158+
* @see <a href="https://cloud.google.com/bigquery/docs/reference/v2/jobs#configuration.copy.writeDisposition">
159+
* Write Disposition</a>
160160
*/
161161
public WriteDisposition writeDisposition() {
162162
return writeDisposition;

0 commit comments

Comments
 (0)